public class NonAmbiguousAlignmentReader extends Object implements AlignmentReader
| Modifier and Type | Field and Description |
|---|---|
static DynamicOptionClient |
doc |
| Constructor and Description |
|---|
NonAmbiguousAlignmentReader(long startOffset,
long endOffset,
String basename) |
NonAmbiguousAlignmentReader(String basename) |
NonAmbiguousAlignmentReader(String basename,
int startReferenceIndex,
int startPosition,
int endReferenceIndex,
int endPosition) |
| Modifier and Type | Method and Description |
|---|---|
String |
basename()
Returns the basename for the alignment being read, or null if the basename is unknown.
|
void |
close() |
static DynamicOptionClient |
doc() |
String |
getAlignerName()
Return the name of the aligner that produced this alignment.
|
String |
getAlignerVersion()
Return the version of the aligner that produced this alignment.
|
int |
getConstantQueryLength() |
long |
getEndByteOffset(int startReferenceIndex,
int startPosition,
int endReferenceIndex,
int endPosition)
Obtain the byte offset at the end of the chunk with entries at or before the given genomic end position.
|
int |
getLargestSplitQueryIndex() |
it.unimi.dsi.fastutil.objects.ObjectList<ReferenceLocation> |
getLocations(int modulo)
Returns a sample of locations covered by this alignment.
|
it.unimi.dsi.fastutil.objects.ObjectList<ReferenceLocation> |
getLocationsByBytes(int bytesPerSlice)
Returns a sample of locations covered by this alignment.
|
ReferenceLocation |
getMaxLocation()
Return the maximum location in this alignment.
|
ReferenceLocation |
getMinLocation()
Return the minimum location in this alignment.
|
int |
getNumberOfAlignedReads()
Obtain the number of aligned reads from the header.
|
int |
getNumberOfQueries() |
int |
getNumberOfTargets() |
edu.cornell.med.icb.identifier.IndexedIdentifier |
getQueryIdentifiers() |
boolean |
getQueryIndicesWerePermuted()
Indicate whether query indices are small indices.
|
ReadOriginInfo |
getReadOriginInfo()
Return the read origin infos from the header.
|
int |
getSmallestSplitQueryIndex() |
long |
getStartByteOffset(int startReferenceIndex,
int startPosition)
Obtain the byte offset at the start of the chunk with entries at or after the given genomic position.
|
Properties |
getStatistics()
Obtain statistics asssociated with the alignment.
|
edu.cornell.med.icb.identifier.IndexedIdentifier |
getTargetIdentifiers() |
int[] |
getTargetLength() |
boolean |
hasAmbiguity()
This field is true when entries in the alignment .entries file all have the ambiguity field populated
(Since Goby 2.0).
|
boolean |
hasNext()
Determine if the reader has another entry that is not ambiguous.
|
boolean |
hasQueryIndexOccurrences()
This field is true when entries in the alignment .entries file all have the query_index_occurences field populated
(Since Goby 2.0).
|
boolean |
isConstantQueryLengths() |
boolean |
isIndexed()
Returns true if this alignment is indexed.
|
boolean |
isQueryLengthStoredInEntries()
Indicates if query lengths are stored in alignment entries (True) or in the alignment header (alignments produced with goby 1.7-, False).
|
boolean |
isSorted()
Returns whether this alignment is sorted.
|
Iterator<Alignments.AlignmentEntry> |
iterator() |
Alignments.AlignmentEntry |
next()
Returns the next non-ambiguous entry.
|
void |
readHeader()
Read the header of this alignment.
|
void |
readIndex()
Read the index.
|
void |
remove()
This operation is not supported.
|
void |
reposition(int targetIndex,
int position)
Reposition the reader to a new target sequence and start position.
|
void |
setMaxLocations(int maxLocations) |
Alignments.AlignmentEntry |
skipTo(int targetIndex,
int position)
Skip all entries that have position before (targetIndex,position).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingforEach, spliteratorpublic static final DynamicOptionClient doc
public NonAmbiguousAlignmentReader(String basename, int startReferenceIndex, int startPosition, int endReferenceIndex, int endPosition) throws IOException
IOExceptionpublic NonAmbiguousAlignmentReader(long startOffset,
long endOffset,
String basename)
throws IOException
IOExceptionpublic NonAmbiguousAlignmentReader(String basename) throws IOException
IOExceptionpublic void setMaxLocations(int maxLocations)
public boolean isSorted()
AlignmentReaderisSorted in interface AlignmentReaderpublic boolean isIndexed()
AlignmentReaderisIndexed in interface AlignmentReaderpublic String basename()
AlignmentReaderbasename in interface AlignmentReaderpublic static DynamicOptionClient doc()
public final boolean hasNext()
hasNext in interface Iterator<Alignments.AlignmentEntry>hasNext in interface AlignmentReaderpublic final Alignments.AlignmentEntry next()
next in interface Iterator<Alignments.AlignmentEntry>next in interface AlignmentReaderpublic Alignments.AlignmentEntry skipTo(int targetIndex, int position) throws IOException
AlignmentReaderskipTo in interface AlignmentReadertargetIndex - The index of the target sequence to skip to.position - The position on the target sequence.IOException - If an error occurs reading the alignment header. The header is accessed to check that the alignment is sorted.public void reposition(int targetIndex,
int position)
throws IOException
AlignmentReaderreposition in interface AlignmentReadertargetIndex - Index of the target sequence to reposition to.position - Position in the target sequence to reposition to.IOException - If an error occurs repositioning.public void remove()
AlignmentReaderremove in interface Iterator<Alignments.AlignmentEntry>remove in interface AlignmentReaderpublic void readHeader()
throws IOException
AlignmentReaderreadHeader in interface AlignmentReaderIOException - If an error occurs.public void readIndex()
throws IOException
AlignmentReaderreadIndex in interface AlignmentReaderIOException - If an error occurs loading the index or header.public void close()
AlignmentReaderclose in interface Closeableclose in interface AutoCloseableclose in interface AlignmentReaderpublic Iterator<Alignments.AlignmentEntry> iterator()
iterator in interface Iterable<Alignments.AlignmentEntry>iterator in interface AlignmentReaderpublic Properties getStatistics()
AlignmentReadergetStatistics in interface AlignmentReaderpublic int getNumberOfAlignedReads()
AlignmentReadergetNumberOfAlignedReads in interface AlignmentReaderpublic it.unimi.dsi.fastutil.objects.ObjectList<ReferenceLocation> getLocations(int modulo) throws IOException
AlignmentReadergetLocations in interface AlignmentReadermodulo - Modulo to avoid sampling every position in the genome.IOExceptionpublic ReferenceLocation getMinLocation() throws IOException
AlignmentReadergetMinLocation in interface AlignmentReaderIOExceptionpublic ReferenceLocation getMaxLocation() throws IOException
AlignmentReadergetMaxLocation in interface AlignmentReaderIOExceptionpublic it.unimi.dsi.fastutil.objects.ObjectList<ReferenceLocation> getLocationsByBytes(int bytesPerSlice) throws IOException
AlignmentReadergetLocationsByBytes in interface AlignmentReaderbytesPerSlice - Return locations approximately spaced by this number of compressed bytes.IOExceptionpublic boolean isQueryLengthStoredInEntries()
AlignmentReaderisQueryLengthStoredInEntries in interface AlignmentReaderpublic String getAlignerName()
AlignmentReadergetAlignerName in interface AlignmentReaderpublic String getAlignerVersion()
AlignmentReadergetAlignerVersion in interface AlignmentReaderpublic int getSmallestSplitQueryIndex()
getSmallestSplitQueryIndex in interface AlignmentReaderpublic int getLargestSplitQueryIndex()
getLargestSplitQueryIndex in interface AlignmentReaderpublic edu.cornell.med.icb.identifier.IndexedIdentifier getTargetIdentifiers()
getTargetIdentifiers in interface AlignmentReaderpublic int[] getTargetLength()
getTargetLength in interface AlignmentReaderpublic int getNumberOfTargets()
getNumberOfTargets in interface AlignmentReaderpublic int getNumberOfQueries()
getNumberOfQueries in interface AlignmentReaderpublic boolean isConstantQueryLengths()
isConstantQueryLengths in interface AlignmentReaderpublic int getConstantQueryLength()
getConstantQueryLength in interface AlignmentReaderpublic edu.cornell.med.icb.identifier.IndexedIdentifier getQueryIdentifiers()
getQueryIdentifiers in interface AlignmentReaderpublic long getStartByteOffset(int startReferenceIndex,
int startPosition)
AlignmentReadergetStartByteOffset in interface AlignmentReaderstartReferenceIndex - Index of the reference sequence for the genomic position.startPosition - genomic coordinate in the reference sequence.public boolean getQueryIndicesWerePermuted()
AlignmentReadergetQueryIndicesWerePermuted in interface AlignmentReaderpublic boolean hasQueryIndexOccurrences()
AlignmentReaderhasQueryIndexOccurrences in interface AlignmentReaderpublic boolean hasAmbiguity()
AlignmentReaderhasAmbiguity in interface AlignmentReaderpublic long getEndByteOffset(int startReferenceIndex,
int startPosition,
int endReferenceIndex,
int endPosition)
AlignmentReadergetEndByteOffset in interface AlignmentReaderstartReferenceIndex - Index of the reference sequence for the start genomic position.startPosition - start genomic coordinate in the reference sequence.endReferenceIndex - Index of the reference sequence for the end genomic position.endPosition - end genomic coordinate in the reference sequence.public ReadOriginInfo getReadOriginInfo()
AlignmentReadergetReadOriginInfo in interface AlignmentReaderCopyright © 2017 Campagne Laboratory. All rights reserved.