Package htsjdk.samtools.util
Class AbstractLocusInfo<E extends AbstractRecordAndOffset>
java.lang.Object
htsjdk.samtools.util.AbstractLocusInfo<E>
- Direct Known Subclasses:
SamLocusIterator.LocusInfo
public class AbstractLocusInfo<E extends AbstractRecordAndOffset>
extends Object
implements Locus, Locatable
The unit of iteration for AbstractLocusIterator.
Holds information about the locus (the SAMSequenceRecord and 1-based position on the reference),
plus list of AbstractRecordAndOffset objects,
If
RecordAndOffset
class is used, one object represents one aligned read that overlaps the locus.
If TypedRecordAndOffset
class is used, one object represents one aligned read,
that starts or ends at the locus.-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface htsjdk.samtools.util.Locatable
contains, contigsMatch, getLengthOnReference, overlaps, withinDistanceOf
-
Constructor Details
-
AbstractLocusInfo
- Parameters:
referenceSequence
- reference sequence to which the reads are alignedposition
- position in the sequence to which the reads are aligned
-
-
Method Details
-
add
Accumulates info for one read aligned to the locus. Method doesn't check, thatrecordAndOffset
is really aligned to current reference position, so it must have valid reference sequence and position or further processing can go wrong.- Parameters:
recordAndOffset
- object to add to current locus
-
getSequenceIndex
public int getSequenceIndex()- Specified by:
getSequenceIndex
in interfaceLocus
- Returns:
- the index of reference sequence
-
getPosition
public int getPosition()- Specified by:
getPosition
in interfaceLocus
- Returns:
- 1-based reference position
-
getRecordAndPositions
Deprecated.since name of the method can be confusing, new implementation should be usedgetRecordAndOffsets()
- Returns:
- unmodifiable list of aligned to the reference position
recordsAndOffsets
-
getRecordAndOffsets
- Returns:
- unmodifiable list of aligned to the reference position
recordsAndOffsets
-
getSequenceName
- Returns:
- the name of reference sequence
-
toString
-
getSequenceLength
public int getSequenceLength()- Returns:
- the length of reference sequence
-
size
public int size()- Returns:
- the number of records overlapping the position
-
isEmpty
public boolean isEmpty()- Returns:
true
if RecordAndOffset list is empty;
-
getContig
Description copied from interface:Locatable
Gets the contig name for the contig this is mapped to. May return null if there is no unique mapping. -
getStart
public int getStart() -
getEnd
public int getEnd()
-
getRecordAndOffsets()