Package htsjdk.beta.codecs.variants.vcf
Class VCFEncoder
java.lang.Object
htsjdk.beta.codecs.variants.vcf.VCFEncoder
- All Implemented Interfaces:
HtsEncoder<VCFHeader,,VariantContext> VariantsEncoder,Closeable,AutoCloseable
- Direct Known Subclasses:
VCFEncoderV3_2,VCFEncoderV3_3,VCFEncoderV4_0,VCFEncoderV4_1,VCFEncoderV4_2
InternalAPI
Base class for concrete implementations of
HtsContentType.VARIANT_CONTEXTS encoders.-
Constructor Summary
ConstructorsConstructorDescriptionVCFEncoder(Bundle outputBundle, VariantsEncoderOptions variantsEncoderOptions) InternalAPI Create a new VCF encoder from aBundle. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close any resources associated with this decoder.final StringGet a user-friendly display name for this encoder.final StringGet the name of the file format supported by this encoder.Get the outputBundlefor this encoder.Get theVariantsEncoderOptionsfor this encoder.voidSet the file format header for this decoder, of typeHtsEncoder.voidwrite(VariantContext variantContext) Write a single record to the underlying output.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface htsjdk.beta.plugin.HtsEncoder
getVersion
-
Constructor Details
-
VCFEncoder
InternalAPI Create a new VCF encoder from aBundle. NOTE: callers that provide an output stream resource should provide a buffered output stream if buffering is desired, since the encoder does not provide an additional buffering layer.- Parameters:
outputBundle- the outputBundleto encodevariantsEncoderOptions- theVariantsEncoderOptionsto use
-
-
Method Details
-
getFileFormat
Description copied from interface:HtsEncoderGet the name of the file format supported by this encoder. The format name defines the underlying format handled by this encoder, and also corresponds to the format of the primary bundle resource that is required when encoding (seeBundleResourceTypeandBundleResource.getFileFormat()).- Specified by:
getFileFormatin interfaceHtsEncoder<VCFHeader,VariantContext> - Returns:
- the name of the underlying file format handled by this encoder
-
getDisplayName
Description copied from interface:HtsEncoderGet a user-friendly display name for this encoder.- Specified by:
getDisplayNamein interfaceHtsEncoder<VCFHeader,VariantContext> - Returns:
- a user-friendly display name for this encoder for use in error and warning messages
-
setHeader
Description copied from interface:HtsEncoderSet the file format header for this decoder, of typeHtsEncoder.HtsEncoder.setHeader(HtsHeader)must be called beforeHtsEncoder.write(HtsRecord)can be called.- Specified by:
setHeaderin interfaceHtsEncoder<VCFHeader,VariantContext> - Parameters:
vcfHeader- to use
-
write
Description copied from interface:HtsEncoderWrite a single record to the underlying output.HtsEncoder.write(HtsRecord)may only called afterHtsEncoder.setHeader(HtsHeader)has been called.- Specified by:
writein interfaceHtsEncoder<VCFHeader,VariantContext> - Parameters:
variantContext- record to write
-
close
public void close()Description copied from interface:HtsEncoderClose any resources associated with this decoder.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceHtsEncoder<VCFHeader,VariantContext>
-
getOutputBundle
Get the outputBundlefor this encoder.- Returns:
- the output
Bundlefor this encoder
-
getVariantsEncoderOptions
Get theVariantsEncoderOptionsfor this encoder.- Returns:
- the
VariantsEncoderOptionsfor this encoder.
-