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
ConstructorsConstructorDescriptionVCFDecoder(Bundle inputBundle, AbstractVCFCodec vcfCodec, VariantsDecoderOptions variantsDecoderOptions) InternalAPI Create a new VCF decoder. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close any resources associated with this decoder.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 theVariantsDecoderOptionsfor 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.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, waitMethods inherited from interface htsjdk.beta.plugin.HtsDecoder
getVersionMethods inherited from interface htsjdk.beta.plugin.interval.HtsQuery
query, query, queryContained, queryContained, queryContained, queryOverlapping, queryOverlapping, queryOverlappingMethods 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 inputBundleto decodevcfCodec- theAbstractVCFCodecto use for this decodervariantsDecoderOptions- theVariantsDecoderOptionsfor this decoder
-
-
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<VCFHeader,VariantContext> - 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<VCFHeader,VariantContext> - 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<VCFHeader,VariantContext> - Returns:
- the file header for this decoder, of type
H
-
iterator
Description copied from interface:HtsQueryGet an iterator of all records in the underlying resource.- Specified by:
iteratorin interfaceHtsQuery<VariantContext>- Specified by:
iteratorin interfaceIterable<VariantContext>- Returns:
- 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<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:HtsQueryReturn true if the underlying resource has an index.- Specified by:
hasIndexin interfaceHtsQuery<VariantContext>- Returns:
- 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<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:HtsQueryGet an iterator over all records from the underlying resource that match the query string- Specified by:
queryin 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:HtsQueryGet an iterator over all records from the underlying resource that overlap the start position- Specified by:
queryStartin 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:HtsDecoderClose any resources associated with this decoder.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceHtsDecoder<VCFHeader,VariantContext>
-
getInputBundle
Get the inputBundlefor this decoder.- Returns:
- the input
Bundlefor this decoder
-
getReadsDecoderOptions
Get theVariantsDecoderOptionsfor this decoder.- Returns:
- the
VariantsDecoderOptionsfor this decoder.
-