public class KAlignmentResult<P> extends Object implements AlignmentResult<KAlignmentHit<P>>, Iterable<KAlignmentHit<P>>, Serializable
KAligner.align(com.milaboratory.core.sequence.NucleotideSequence),
KAligner.align(com.milaboratory.core.sequence.NucleotideSequence,
int, int), KAligner#align(com.milaboratory.core.sequence.NucleotideSequence,
int, int, boolean) methods.
It contains link to according KMappingResult, list of hits found
in target sequence as well as range of target sequence to be aligned.
| Constructor and Description |
|---|
KAlignmentResult(KAligner<P> aligner,
KMappingResult mappingResult,
NucleotideSequence target,
int targetFrom,
int targetTo)
Creates new KAlignmentResult
|
| Modifier and Type | Method and Description |
|---|---|
void |
calculateAllAlignments()
Calculates alignments for all hits
|
KAligner |
getAligner()
Returns link to aligner
|
KAlignmentHit |
getBestHit()
Returns best hit (hit with highest alignment or mapper (if lazy alignment is used) score) or null if there is no
hits in this result
|
List<KAlignmentHit<P>> |
getHits()
Returns list of hits found in target sequence
|
KMappingResult |
getMappingResult()
Returns mapping result
|
NucleotideSequence |
getTarget()
Returns target sequence
|
int |
getTargetFrom()
Returns position of first nucleotide of target sequence to be aligned
|
int |
getTargetTo()
Returns position of last nucleotide of target sequence to be aligned
|
boolean |
hasHits()
Checks if there are hits
|
Iterator<KAlignmentHit<P>> |
iterator() |
void |
refresh()
Refresh alignments of all hits
|
void |
sortAccordingToMapperScores()
Sorts hits according to
KMappingHit alignment score |
public KAlignmentResult(KAligner<P> aligner, KMappingResult mappingResult, NucleotideSequence target, int targetFrom, int targetTo)
aligner - link to alignermappingResult - link to according mapping result (which is result of com.milaboratory.core.sequence.alignment.KMapper#align(com.milaboratory.core.sequence.NucleotideSequence),
KMapper.align(com.milaboratory.core.sequence.NucleotideSequence,
int, int) methods)target - target sequence to be alignedtargetFrom - position of first nucleotide of target sequence to be alignedtargetTo - position of last nucleotide of target sequence to be alignedpublic KAligner getAligner()
public KMappingResult getMappingResult()
public boolean hasHits()
hasHits in interface AlignmentResult<KAlignmentHit<P>>true if hits array is not emptypublic KAlignmentHit getBestHit()
getBestHit in interface AlignmentResult<KAlignmentHit<P>>public List<KAlignmentHit<P>> getHits()
getHits in interface AlignmentResult<KAlignmentHit<P>>public NucleotideSequence getTarget()
public int getTargetFrom()
public int getTargetTo()
public void sortAccordingToMapperScores()
KMappingHit alignment scorepublic void calculateAllAlignments()
public void refresh()
public Iterator<KAlignmentHit<P>> iterator()
iterator in interface Iterable<KAlignmentHit<P>>Copyright © 2018. All rights reserved.