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, IfRecordAndOffset
class is used, one object represents one aligned read that overlaps the locus. IfTypedRecordAndOffset
class is used, one object represents one aligned read, that starts or ends at the locus.
-
-
Constructor Summary
Constructors Constructor Description AbstractLocusInfo(SAMSequenceRecord referenceSequence, int position)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(E recordAndOffset)
Accumulates info for one read aligned to the locus.String
getContig()
Gets the contig name for the contig this is mapped to.int
getEnd()
int
getPosition()
List<E>
getRecordAndOffsets()
List<E>
getRecordAndPositions()
Deprecated.since name of the method can be confusing, new implementation should be usedgetRecordAndOffsets()
int
getSequenceIndex()
int
getSequenceLength()
String
getSequenceName()
int
getStart()
boolean
isEmpty()
int
size()
String
toString()
-
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 Detail
-
AbstractLocusInfo
public AbstractLocusInfo(SAMSequenceRecord referenceSequence, int position)
- Parameters:
referenceSequence
- reference sequence to which the reads are alignedposition
- position in the sequence to which the reads are aligned
-
-
Method Detail
-
add
public void add(E recordAndOffset)
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 public List<E> 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
public List<E> getRecordAndOffsets()
- Returns:
- unmodifiable list of aligned to the reference position
recordsAndOffsets
-
getSequenceName
public String getSequenceName()
- Returns:
- the name of reference sequence
-
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
public String 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()
-
-