Class BAMDecoderV1_0
java.lang.Object
htsjdk.beta.codecs.reads.bam.BAMDecoder
htsjdk.beta.codecs.reads.bam.bamV1_0.BAMDecoderV1_0
- All Implemented Interfaces:
HtsDecoder<SAMFileHeader,
,SAMRecord> HtsQuery<SAMRecord>
,ReadsDecoder
,ReadsQuery<SAMRecord>
,Closeable
,AutoCloseable
,Iterable<SAMRecord>
BAM v1.0 decoder.
-
Constructor Summary
ConstructorsConstructorDescriptionBAMDecoderV1_0
(Bundle inputBundle, ReadsDecoderOptions readsDecoderOptions) Create a V1.0 BAM decoder for the given input bundle. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close any resources associated with this decoder.Get the file header for this decoder.Get the version of the file format supported by this decoder.boolean
hasIndex()
Return true if the underlying resource has an index.boolean
Gte true if the underlying resource is queryable.iterator()
Get an iterator of all records in the underlying resource.query
(List<HtsInterval> intervals, HtsQueryRule queryRule) Get an iterator over all records from the underlying resource that match the query arguments.Fetch the mate for the given read.queryStart
(String queryName, long start) Get an iterator over all records from the underlying resource that overlap the start positionGet an iterator of unmapped reads.Methods inherited from class htsjdk.beta.codecs.reads.bam.BAMDecoder
getDisplayName, getFileFormat, getInputBundle, getReadsDecoderOptions
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface htsjdk.beta.plugin.interval.HtsQuery
query, query, query, queryContained, queryContained, queryContained, queryOverlapping, queryOverlapping, queryOverlapping
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
BAMDecoderV1_0
Create a V1.0 BAM decoder for the given input bundle. The primary resource in the bundle must have content typeBundleResourceType.CT_ALIGNED_READS
, and the resource must be an appropriate format and version for this encoder (to find an encoder for a bundle, seeReadsResolver
).- Parameters:
inputBundle
- bundle to decoderreadsDecoderOptions
- options to use
-
-
Method Details
-
getVersion
Description copied from interface:HtsDecoder
Get the version of the file format supported by this decoder. -
getHeader
Description copied from interface:HtsDecoder
Get the file header for this decoder.- Returns:
- the file header for this decoder, of type
H
-
iterator
Description copied from interface:HtsQuery
Get an iterator of all records in the underlying resource.- Returns:
- an iterator of all records in the underlying resource
-
isQueryable
public boolean isQueryable()Description copied from interface:HtsQuery
Gte true if the underlying resource is queryable.- Returns:
- true if the underlying resource is queryable. this may be true even if the underlying
resource returns false for
HtsQuery.hasIndex()
-
hasIndex
public boolean hasIndex()Description copied from interface:HtsQuery
Return true if the underlying resource has an index.- Returns:
- true if the underlying resource has an index
-
query
Description copied from interface:HtsQuery
Get an iterator over all records from the underlying resource that match the query arguments. Callers much ensure that the intervals are in increasing order and do not overlap or abut.- Parameters:
intervals
- list of intervals to matchqueryRule
- query rule to use, fromHtsQueryRule
- Returns:
- an iterator over all records from the underlying resource that match the query arguments
-
queryStart
Description copied from interface:HtsQuery
Get an iterator over all records from the underlying resource that overlap the start position- Parameters:
queryName
- name to matchstart
- start position to overlap- Returns:
- an iterator over all records from the underlying resource that overlap the start position
-
queryUnmapped
Description copied from interface:ReadsDecoder
Get an iterator of unmapped reads. Requires an index resource to be included in the inputBundle
. -
queryMate
Description copied from interface:ReadsDecoder
Fetch the mate for the given read. Requires an index resource to be included in the inputBundle
.- Parameters:
samRecord
- the source record- Returns:
- the source record's mate, or Optional.empty() if the source record has no mate
-
close
public void close()Description copied from interface:HtsDecoder
Close any resources associated with this decoder.
-