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, IfRecordAndOffsetclass is used, one object represents one aligned read that overlaps the locus. IfTypedRecordAndOffsetclass 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 voidadd(E recordAndOffset)Accumulates info for one read aligned to the locus.StringgetContig()Gets the contig name for the contig this is mapped to.intgetEnd()intgetPosition()List<E>getRecordAndOffsets()List<E>getRecordAndPositions()Deprecated.since name of the method can be confusing, new implementation should be usedgetRecordAndOffsets()intgetSequenceIndex()intgetSequenceLength()StringgetSequenceName()intgetStart()booleanisEmpty()intsize()StringtoString()-
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, thatrecordAndOffsetis 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:
getSequenceIndexin interfaceLocus- Returns:
- the index of reference sequence
-
getPosition
public int getPosition()
- Specified by:
getPositionin 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:
trueif RecordAndOffset list is empty;
-
getContig
public String getContig()
Description copied from interface:LocatableGets the contig name for the contig this is mapped to. May return null if there is no unique mapping.
-
getStart
public int getStart()
-
-