public class KAligner<P> extends Object implements PipedBatchAlignerWithBase<NucleotideSequence,P,KAlignmentHit<P>>, BatchAlignerWithBaseWithFilter<NucleotideSequence,P,KAlignmentHit<P>>, Serializable
KAligner is a comprehensive aligner for nucleotide sequences.
Complete alignment of sequence performed using KMapper.addReference(com.milaboratory.core.sequence.NucleotideSequence,
int, int)
method from which preliminary hits are obtained and used by align(com.milaboratory.core.sequence.NucleotideSequence),
align(com.milaboratory.core.sequence.NucleotideSequence, int, int),
align(com.milaboratory.core.sequence.NucleotideSequence, int, int, boolean, BitArray)
methods.
All settings are stored in parameters property.
| Constructor and Description |
|---|
KAligner(KAlignerParameters parameters)
Creates new KAligner.
|
KAligner(KAlignerParameters parameters,
boolean lazyResults)
Creates new KAligner.
|
| Modifier and Type | Method and Description |
|---|---|
int |
addReference(NucleotideSequence sequence)
Adds new reference sequence to the base of this aligner and returns index assigned to it.
|
int |
addReference(NucleotideSequence sequence,
int offset,
int length)
Adds new reference sequence to the base of this mapper and returns index assigned to it.
|
void |
addReference(NucleotideSequence sequence,
P payload)
Adds a record to the base of this aligner (a set of subject sequences that this instance aligns queries
with).
|
KAlignmentResult<P> |
align(NucleotideSequence sequence)
Performs a comprehensive alignment of a sequence.
|
KAlignmentResult<P> |
align(NucleotideSequence sequence,
int from,
int to)
Performs a comprehensive alignment of a sequence.
|
AlignmentResult<KAlignmentHit<P>> |
align(NucleotideSequence sequence,
int from,
int to,
BitArray filter) |
KAlignmentResult<P> |
align(NucleotideSequence sequence,
int from,
int to,
boolean restrictToRange,
BitArray filter)
Performs a comprehensive alignment of a sequence.
|
<Q extends HasSequence<NucleotideSequence>> |
align(cc.redberry.pipe.OutputPort<Q> input)
Starts processing of input sequences and returns pipe of results.
|
<Q> cc.redberry.pipe.OutputPort<KAlignmentResultP<P,Q>> |
align(cc.redberry.pipe.OutputPort<Q> input,
SequenceExtractor<Q,NucleotideSequence> extractor)
Starts processing of input sequences and returns pipe of results.
|
BitArray |
createFilter(cc.redberry.primitives.Filter<P> filter) |
NucleotideSequence |
getReference(int id)
Returns sequence by its id (order number) in a base.
|
void |
setThreadCount(int threads)
Sets number of threads to be used in piped processing.
0 -> Runtime.getRuntime().availableProcessors() 1 -> process in the same thread as take() method call 2... |
public KAligner(KAlignerParameters parameters)
Creates new KAligner.
Sets lazyResults flag to false, which means that all alignments inside KAlignmentResult
obtained by align(com.milaboratory.core.sequence.NucleotideSequence,
int, int, boolean, BitArray) method
will be loaded immediately.
parameters - parameters from which new KAligner needs to be createdpublic KAligner(KAlignerParameters parameters, boolean lazyResults)
Creates new KAligner.
parameters - parameters from which new KAligner needs to be createdlazyResults - true if all alignments inside KAlignmentResult
obtained by align(com.milaboratory.core.sequence.NucleotideSequence,
int, int, boolean, BitArray) method
need to be loaded at first requestpublic void setThreadCount(int threads)
public int addReference(NucleotideSequence sequence)
sequence - sequencepublic BitArray createFilter(cc.redberry.primitives.Filter<P> filter)
createFilter in interface BatchAlignerWithBaseWithFilter<NucleotideSequence,P,KAlignmentHit<P>>public int addReference(NucleotideSequence sequence, int offset, int length)
public NucleotideSequence getReference(int id)
id - id of sequence to be returnedpublic KAlignmentResult<P> align(NucleotideSequence sequence)
The procedure consists of 2 steps:
KMappingResult from KMapper
using KMapper.align(com.milaboratory.core.sequence.NucleotideSequence)
which contains preliminary hits
KMappingResult from step 1, obtaining KAlignmentResult
by align(com.milaboratory.core.sequence.NucleotideSequence, int, int, boolean, BitArray) method,
where all hit alignments may be loaded lazily (at first request) or immediately (depends on lazyResults
flag value)
align in interface BatchAligner<NucleotideSequence,KAlignmentHit<P>>sequence - sequence to be alignedpublic KAlignmentResult<P> align(NucleotideSequence sequence, int from, int to)
The procedure consists of 2 steps:
KMappingResult from KMapper
using KMapper.align(com.milaboratory.core.sequence.NucleotideSequence)
which contains preliminary hits
KMappingResult from step 1, obtaining KAlignmentResult
by align(com.milaboratory.core.sequence.NucleotideSequence, int, int, boolean, BitArray) method,
where all hit alignments may be loaded lazily (at first request) or immediately (depends on lazyResults
flag value)
align in interface BatchAligner<NucleotideSequence,KAlignmentHit<P>>sequence - sequence to be alignedfrom - first nucleotide to be aligned (inclusive)to - last nucleotide to be aligned (exclusive)public KAlignmentResult<P> align(NucleotideSequence sequence, int from, int to, boolean restrictToRange, BitArray filter)
The procedure consists of 2 steps:
KMappingResult from KMapper
using KMapper.align(com.milaboratory.core.sequence.NucleotideSequence)
which contains preliminary hits
KMappingResult from step 1, obtaining KAlignmentResult
by align(com.milaboratory.core.sequence.NucleotideSequence, int, int, boolean, BitArray) method,
where all hit alignments may be loaded lazily (at first request) or immediately (depends on lazyResults
flag value)
sequence - sequence to be alignedfrom - first nucleotide to be aligned by KMapper
(inclusive)to - last nucleotide to be aligned by KMapper
(exclusive)restrictToRange - true if hits alignments from obtained KAlignmentResult
should be
restricted by the same range (from - to)public AlignmentResult<KAlignmentHit<P>> align(NucleotideSequence sequence, int from, int to, BitArray filter)
align in interface BatchAlignerWithBaseWithFilter<NucleotideSequence,P,KAlignmentHit<P>>public <Q> cc.redberry.pipe.OutputPort<KAlignmentResultP<P,Q>> align(cc.redberry.pipe.OutputPort<Q> input, SequenceExtractor<Q,NucleotideSequence> extractor)
PipedBatchAligneralign in interface PipedBatchAligner<NucleotideSequence,KAlignmentHit<P>>Q - type of query objectinput - pipe of queriesextractor - extractor of sequences from query objectpublic <Q extends HasSequence<NucleotideSequence>> cc.redberry.pipe.OutputPort<KAlignmentResultP<P,Q>> align(cc.redberry.pipe.OutputPort<Q> input)
PipedBatchAligneralign in interface PipedBatchAligner<NucleotideSequence,KAlignmentHit<P>>Q - type of query objectsinput - pipe of queriespublic void addReference(NucleotideSequence sequence, P payload)
WithBaseaddReference in interface WithBase<NucleotideSequence,P>sequence - sequencepayload - payload to store additional information with this record (can be retrieved from resulting AlignmentHit)Copyright © 2018. All rights reserved.