Package htsjdk.beta.codecs.variants.vcf
Class VCFDecoder
java.lang.Object
htsjdk.beta.codecs.variants.vcf.VCFDecoder
- All Implemented Interfaces:
HtsDecoder<VCFHeader,
,VariantContext> HtsQuery<VariantContext>
,VariantsDecoder
,Closeable
,AutoCloseable
,Iterable<VariantContext>
- Direct Known Subclasses:
VCFDecoderV3_2
,VCFDecoderV3_3
,VCFDecoderV4_0
,VCFDecoderV4_1
,VCFDecoderV4_2
,VCFDecoderV4_3
InternalAPII
Base class for concrete implementations of
HtsContentType.VARIANT_CONTEXTS
decoders.-
Constructor Summary
ConstructorDescriptionVCFDecoder
(Bundle inputBundle, AbstractVCFCodec vcfCodec, VariantsDecoderOptions variantsDecoderOptions) InternalAPI Create a new VCF decoder. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close any resources associated with this decoder.final String
Get a user-friendly display name for this decoder.final String
Get 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 (seeBundleResourceType
andBundleResource.getFileFormat()
).Get the file header for this decoder.Get the inputBundle
for this decoder.Get theVariantsDecoderOptions
for 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.Get an iterator over all records from the underlying resource that match the query stringquery
(List<HtsInterval> intervals, HtsQueryRule queryRule) Get an iterator over all records from the underlying resource that match the query arguments.queryStart
(String queryName, long start) Get an iterator over all records from the underlying resource that overlap the start positionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface htsjdk.beta.plugin.HtsDecoder
getVersion
Methods inherited from interface htsjdk.beta.plugin.interval.HtsQuery
query, query, queryContained, queryContained, queryContained, queryOverlapping, queryOverlapping, queryOverlapping
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
VCFDecoder
@InternalAPI public VCFDecoder(Bundle inputBundle, AbstractVCFCodec vcfCodec, VariantsDecoderOptions variantsDecoderOptions) InternalAPI Create a new VCF decoder.- Parameters:
inputBundle
- the inputBundle
to decodevcfCodec
- theAbstractVCFCodec
to use for this decodervariantsDecoderOptions
- theVariantsDecoderOptions
for this decoder
-
-
Method Details
-
getFileFormat
Description copied from interface:HtsDecoder
Get 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 (seeBundleResourceType
andBundleResource.getFileFormat()
).- Specified by:
getFileFormat
in interfaceHtsDecoder<VCFHeader,
VariantContext> - Returns:
- the name of the underlying file format handled by this decoder
-
getDisplayName
Description copied from interface:HtsDecoder
Get a user-friendly display name for this decoder.- Specified by:
getDisplayName
in interfaceHtsDecoder<VCFHeader,
VariantContext> - Returns:
- a user-friendly display name for this decoder for use in error and warning messages
-
getHeader
Description copied from interface:HtsDecoder
Get the file header for this decoder.- Specified by:
getHeader
in interfaceHtsDecoder<VCFHeader,
VariantContext> - 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.- Specified by:
iterator
in interfaceHtsQuery<VariantContext>
- Specified by:
iterator
in interfaceIterable<VariantContext>
- 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.- Specified by:
isQueryable
in interfaceHtsQuery<VariantContext>
- 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.- Specified by:
hasIndex
in interfaceHtsQuery<VariantContext>
- 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.- Specified by:
query
in interfaceHtsQuery<VariantContext>
- 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
-
query
Description copied from interface:HtsQuery
Get an iterator over all records from the underlying resource that match the query string- Specified by:
query
in interfaceHtsQuery<VariantContext>
- Parameters:
queryString
- decoder specific query string- Returns:
- an iterator over all records from the underlying resource that match the query string
-
queryStart
Description copied from interface:HtsQuery
Get an iterator over all records from the underlying resource that overlap the start position- Specified by:
queryStart
in interfaceHtsQuery<VariantContext>
- Parameters:
queryName
- name to matchstart
- start position to overlap- Returns:
- an iterator over all records from the underlying resource that overlap the start position
-
close
public void close()Description copied from interface:HtsDecoder
Close any resources associated with this decoder.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceHtsDecoder<VCFHeader,
VariantContext>
-
getInputBundle
Get the inputBundle
for this decoder.- Returns:
- the input
Bundle
for this decoder
-
getReadsDecoderOptions
Get theVariantsDecoderOptions
for this decoder.- Returns:
- the
VariantsDecoderOptions
for this decoder.
-