public final class KMapper extends Object implements Serializable
align(com.milaboratory.core.sequence.NucleotideSequence, int, int) and align(com.milaboratory.core.sequence.NucleotideSequence) methods of this object are thread-safe and can
be concurrently used by several threads if no new sequences added after its first invocation.
Algorithm inspired by: Liao Y et al. The Subread aligner: fast, accurate and scalable read mapping by seed-and-vote. Nucleic Acids Res. 2013 May 1;41(10):e108. doi: 10.1093/nar/gkt214. Epub 2013 Apr 4.
| Modifier and Type | Field and Description |
|---|---|
static int |
SEED_NOT_FOUND_OFFSET |
| Constructor and Description |
|---|
KMapper(int kValue,
int minDistance,
int maxDistance,
float absoluteMinScore,
float relativeMinScore,
int minAlignmentLength,
float matchScore,
float mismatchPenalty,
float offsetShiftPenalty,
int maxIndels,
boolean floatingLeftBound,
boolean floatingRightBound)
Creates new KMer mapper.
|
| Modifier and Type | Method and Description |
|---|---|
int |
addReference(NucleotideSequence sequence)
Adds new reference sequence to the base of this mapper 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.
|
KMappingResult |
align(NucleotideSequence sequence)
Performs an alignment.
|
KMappingResult |
align(NucleotideSequence sequence,
int from,
int to)
Performs an alignment for a part of the target sequence.
|
KMappingResult |
align(NucleotideSequence sequence,
int from,
int to,
BitArray filter)
Performs an alignment for a part of the target sequence.
|
static KMapper |
createFromParameters(KAlignerParameters parameters)
Factory method to create KMapper using parametners specified in the
KAlignerParameters
object. |
float |
getAbsoluteMinScore()
Returns minimal score
|
int |
getKValue()
Returns number of nucleotides in kMer (value of k)
|
int |
getMaxDistance()
Returns maximal distance between kMer seed positions in target sequence
|
int |
getMaxIndels()
Returns maximal number of insertions and deletions
|
int |
getMinDistance()
Returns minimal distance between kMer seed positions in target sequence
|
org.apache.commons.math3.stat.descriptive.SummaryStatistics |
getRecordSizeSummaryStatistics()
Method used internally.
|
float |
getRelativeMinScore()
Returns maximal ratio between best hit score and other hits scores in returned result
|
String |
toString() |
public static final int SEED_NOT_FOUND_OFFSET
public KMapper(int kValue,
int minDistance,
int maxDistance,
float absoluteMinScore,
float relativeMinScore,
int minAlignmentLength,
float matchScore,
float mismatchPenalty,
float offsetShiftPenalty,
int maxIndels,
boolean floatingLeftBound,
boolean floatingRightBound)
kValue - nucleotides in kMer (value of k)minDistance - minimal distance between kMer seed positions in target sequencemaxDistance - maximal distance between kMer seed positions in target sequenceabsoluteMinScore - minimal scorerelativeMinScore - maximal ratio between best hit score and other hits scores in returned resultminAlignmentLength - minimal alignment lengthmatchScore - reward for match (must be > 0)mismatchPenalty - penalty for mismatch (must be < 0)maxIndels - maximal number of insertions and deletionsfloatingLeftBound - true if left bound of alignment could be floatingfloatingRightBound - true if right bound of alignment could be floatingpublic static KMapper createFromParameters(KAlignerParameters parameters)
KAlignerParameters
object.parameters - parameters instancepublic int addReference(NucleotideSequence sequence)
sequence - sequencepublic int addReference(NucleotideSequence sequence, int offset, int length)
User can specify a part of a sequence to be indexed (only this part will be identified during the alignment procedure). The offset returned by alignment procedure will be in global sequence coordinates, relative to the beginning of the sequence (not to the specified offset).
sequence - sequenceoffset - offset of subsequence to be indexedlength - length of subsequence to be indexedpublic KMappingResult align(NucleotideSequence sequence)
This methods is thread-safe and can be concurrently used by several threads if no new sequences added after its first invocation.
sequence - target sequencepublic KMappingResult align(NucleotideSequence sequence, int from, int to)
This methods is thread-safe and can be concurrently used by several threads if no new sequences added after its first invocation.
sequence - target sequencefrom - first nucleotide to align (inclusive)to - last nucleotide to align (exclusive)public KMappingResult align(NucleotideSequence sequence, int from, int to, BitArray filter)
This methods is thread-safe and can be concurrently used by several threads if no new sequences added after its first invocation.
sequence - target sequencefrom - first nucleotide to align (inclusive)to - last nucleotide to align (exclusive)filter - record filter (align only records with filter[id] == true)public int getKValue()
public float getAbsoluteMinScore()
public int getMaxDistance()
public int getMinDistance()
public int getMaxIndels()
public float getRelativeMinScore()
public org.apache.commons.math3.stat.descriptive.SummaryStatistics getRecordSizeSummaryStatistics()
Copyright © 2018. All rights reserved.