Package htsjdk.beta.codecs.reads.cram
Class CRAMDecoder
java.lang.Object
htsjdk.beta.codecs.reads.cram.CRAMDecoder
- All Implemented Interfaces:
HtsDecoder<SAMFileHeader,,SAMRecord> HtsQuery<SAMRecord>,ReadsDecoder,ReadsQuery<SAMRecord>,Closeable,AutoCloseable,Iterable<SAMRecord>
- Direct Known Subclasses:
CRAMDecoderV2_1,CRAMDecoderV3_0,CRAMDecoderV3_1
InternalAPI
Base class for
BundleResourceType.FMT_READS_CRAM decoders.-
Constructor Summary
ConstructorsConstructorDescriptionCRAMDecoder(Bundle inputBundle, ReadsDecoderOptions readsDecoderOptions) InternalAPI Common constructor for CRAM decoders. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close any resources associated with this decoder.static CRAMReferenceSourcegetCRAMReferenceSource(CRAMDecoderOptions cramDecoderOptions) final StringGet a user-friendly display name for this decoder.final StringGet the name of the file format supported by this decoder.The format name defines the underlying format handled by this decoder, and also corresponds to the format of the primary bundle resource that is required when decoding (seeBundleResourceTypeandBundleResource.getFileFormat()).Get the file header for this decoder.Get the inputBundlefor this decoder.Get theReadsDecoderOptionsfor this decoder.booleanhasIndex()Return true if the underlying resource has an index.booleanGte 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface htsjdk.beta.plugin.HtsDecoder
getVersionMethods inherited from interface htsjdk.beta.plugin.interval.HtsQuery
query, query, query, queryContained, queryContained, queryContained, queryOverlapping, queryOverlapping, queryOverlappingMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
CRAMDecoder
InternalAPI Common constructor for CRAM decoders.- Parameters:
inputBundle- anBundlecontaining cram resourcereadsDecoderOptions-ReadsDecoderOptionsto use.
-
-
Method Details
-
getFileFormat
Description copied from interface:HtsDecoderGet the name of the file format supported by this decoder.The format name defines the underlying format handled by this decoder, and also corresponds to the format of the primary bundle resource that is required when decoding (seeBundleResourceTypeandBundleResource.getFileFormat()).- Specified by:
getFileFormatin interfaceHtsDecoder<SAMFileHeader,SAMRecord> - Returns:
- the name of the underlying file format handled by this decoder
-
getDisplayName
Description copied from interface:HtsDecoderGet a user-friendly display name for this decoder.- Specified by:
getDisplayNamein interfaceHtsDecoder<SAMFileHeader,SAMRecord> - Returns:
- a user-friendly display name for this decoder for use in error and warning messages
-
getHeader
Description copied from interface:HtsDecoderGet the file header for this decoder.- Specified by:
getHeaderin interfaceHtsDecoder<SAMFileHeader,SAMRecord> - Returns:
- the file header for this decoder, of type
H
-
close
public void close()Description copied from interface:HtsDecoderClose any resources associated with this decoder.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceHtsDecoder<SAMFileHeader,SAMRecord>
-
iterator
Description copied from interface:HtsQueryGet an iterator of all records in the underlying resource. -
isQueryable
public boolean isQueryable()Description copied from interface:HtsQueryGte true if the underlying resource is queryable.- Specified by:
isQueryablein interfaceHtsQuery<SAMRecord>- 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:HtsQueryReturn true if the underlying resource has an index. -
query
Description copied from interface:HtsQueryGet 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.- Specified by:
queryin interfaceHtsQuery<SAMRecord>- 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:HtsQueryGet an iterator over all records from the underlying resource that overlap the start position- Specified by:
queryStartin interfaceHtsQuery<SAMRecord>- 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:ReadsDecoderGet an iterator of unmapped reads. Requires an index resource to be included in the inputBundle.- Specified by:
queryUnmappedin interfaceReadsDecoder- Specified by:
queryUnmappedin interfaceReadsQuery<SAMRecord>
-
queryMate
Description copied from interface:ReadsDecoderFetch the mate for the given read. Requires an index resource to be included in the inputBundle.- Specified by:
queryMatein interfaceReadsDecoder- Specified by:
queryMatein interfaceReadsQuery<SAMRecord>- Parameters:
rec- the source record- Returns:
- the source record's mate, or Optional.empty() if the source record has no mate
-
getInputBundle
Get the inputBundlefor this decoder.- Returns:
- the input
Bundlefor this decoder
-
getReadsDecoderOptions
Get theReadsDecoderOptionsfor this decoder.- Returns:
- the
ReadsDecoderOptionsfor this decoder.
-
getCRAMReferenceSource
@InternalAPI public static CRAMReferenceSource getCRAMReferenceSource(CRAMDecoderOptions cramDecoderOptions)
-