public class VariantContextWriterBuilder
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
VariantContextWriterBuilder.OutputType |
| Modifier and Type | Field and Description |
|---|---|
static java.util.EnumSet<Options> |
DEFAULT_OPTIONS |
static java.util.EnumSet<VariantContextWriterBuilder.OutputType> |
FILE_TYPES |
static java.util.EnumSet<Options> |
NO_OPTIONS |
protected java.util.EnumSet<Options> |
options |
static java.util.EnumSet<VariantContextWriterBuilder.OutputType> |
STREAM_TYPES |
| Constructor and Description |
|---|
VariantContextWriterBuilder()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
VariantContextWriter |
build(java.nio.file.OpenOption... openOptions)
Validate and build the
VariantContextWriter. |
VariantContextWriterBuilder |
clearIndexCreator()
Do not pass an
IndexCreator to the next VariantContextWriter created by this builder. |
VariantContextWriterBuilder |
clearOptions()
Remove all options from the set of
Options for the VariantContextWriterBuilder. |
static VariantContextWriterBuilder.OutputType |
determineOutputTypeFromFile(java.nio.file.Path path)
Attempts to determine the type of file/data to write based on the File path being
written to.
|
VariantContextWriterBuilder |
modifyOption(Options option,
boolean setIt)
Set or unset option depending on the boolean given
|
VariantContextWriterBuilder |
setBuffer(int bufferSize)
Set a buffer size for the file output stream passed to the next
VariantContextWriter created by this builder. |
VariantContextWriterBuilder |
setCreateMD5()
Create an MD5 digest file for the next
VariantContextWriter created by this builder. |
VariantContextWriterBuilder |
setCreateMD5(boolean createMD5)
Choose whether to also create an MD5 digest file for the next
VariantContextWriter created by this builder. |
static void |
setDefaultOption(Options option)
Add one option to the set of default
Options that will be used as the initial set of options
for all VariantContextWriterBuilders created after this call. |
VariantContextWriterBuilder |
setIndexCreator(IndexCreator idxCreator)
Set an IndexCreator for the next
VariantContextWriter created by this builder. |
VariantContextWriterBuilder |
setOption(Options option)
Add one option to the set of
Options for the VariantContextWriterBuilder, if it's not already present. |
VariantContextWriterBuilder |
setOptions(java.util.EnumSet<Options> options)
Replace the set of
Options for the VariantContextWriterBuilder with a new set. |
VariantContextWriterBuilder |
setOutputBCFStream(java.io.OutputStream outStream)
Set the output BCF stream for the next
VariantContextWriter created by this builder. |
VariantContextWriterBuilder |
setOutputFile(java.io.File outFile)
Set the output file for the next
VariantContextWriter created by this builder. |
VariantContextWriterBuilder |
setOutputFile(java.lang.String outFile)
Set the output file for the next
VariantContextWriter created by this builder. |
VariantContextWriterBuilder |
setOutputFileType(VariantContextWriterBuilder.OutputType outType)
Set the output file type for the next
VariantContextWriter created by this builder. |
VariantContextWriterBuilder |
setOutputPath(java.nio.file.Path outPath)
Set the output file for the next
VariantContextWriter created by this builder. |
VariantContextWriterBuilder |
setOutputStream(java.io.OutputStream outStream)
Set the output stream (VCF, by default) for the next
VariantContextWriter created by this builder. |
VariantContextWriterBuilder |
setOutputVCFStream(java.io.OutputStream outStream)
Set the output VCF stream for the next
VariantContextWriter created by this builder. |
VariantContextWriterBuilder |
setReferenceDictionary(SAMSequenceDictionary refDict)
Set the reference dictionary to be used by
VariantContextWriters created by this builder. |
VariantContextWriterBuilder |
unsetBuffering()
Do not use buffering in the next
VariantContextWriter created by this builder. |
VariantContextWriterBuilder |
unsetCreateMD5()
Don't create an MD5 digest file for the next
VariantContextWriter created by this builder. |
static void |
unsetDefaultOption(Options option)
Remove an option from the set of default
Options that will be used as the initial set of options
for all VariantContextWriterBuilders created after this call. |
VariantContextWriterBuilder |
unsetOption(Options option)
Remove one option from the set of
Options for the VariantContextWriterBuilder, if it's present. |
public static final java.util.EnumSet<Options> DEFAULT_OPTIONS
public static final java.util.EnumSet<Options> NO_OPTIONS
public static final java.util.EnumSet<VariantContextWriterBuilder.OutputType> FILE_TYPES
public static final java.util.EnumSet<VariantContextWriterBuilder.OutputType> STREAM_TYPES
protected java.util.EnumSet<Options> options
public VariantContextWriterBuilder()
USE_ASYNC_IO to the Options if it is present in Defaults.public VariantContextWriterBuilder setReferenceDictionary(SAMSequenceDictionary refDict)
VariantContextWriters created by this builder.refDict - the reference dictionaryVariantContextWriterBuilderpublic VariantContextWriterBuilder setOutputFile(java.io.File outFile)
VariantContextWriter created by this builder.
Determines file type implicitly from the filename.outFile - the file the VariantContextWriter will write toVariantContextWriterBuilderpublic VariantContextWriterBuilder setOutputPath(java.nio.file.Path outPath)
VariantContextWriter created by this builder.
Determines file type implicitly from the filename.outPath - the file the VariantContextWriter will write toVariantContextWriterBuilderpublic VariantContextWriterBuilder setOutputFile(java.lang.String outFile)
VariantContextWriter created by this builder.
Determines file type implicitly from the filename.outFile - the file the VariantContextWriter will write toVariantContextWriterBuilderpublic VariantContextWriterBuilder setOutputFileType(VariantContextWriterBuilder.OutputType outType)
VariantContextWriter created by this builder.outType - the type of file the VariantContextWriter will write toVariantContextWriterBuilderpublic VariantContextWriterBuilder setOutputVCFStream(java.io.OutputStream outStream)
VariantContextWriter created by this builder.
If buffered writing is desired, caller must provide some kind of buffered OutputStream.outStream - the output stream to write toVariantContextWriterBuilderpublic VariantContextWriterBuilder setOutputBCFStream(java.io.OutputStream outStream)
VariantContextWriter created by this builder.
If buffered writing is desired, caller must provide some kind of buffered OutputStream.outStream - the output stream to write toVariantContextWriterBuilderpublic VariantContextWriterBuilder setOutputStream(java.io.OutputStream outStream)
VariantContextWriter created by this builder.
If buffered writing is desired, caller must provide some kind of buffered OutputStream.outStream - the output stream to write topublic VariantContextWriterBuilder setIndexCreator(IndexCreator idxCreator)
VariantContextWriter created by this builder.idxCreator - the IndexCreator to useVariantContextWriterBuilderpublic VariantContextWriterBuilder clearIndexCreator()
IndexCreator to the next VariantContextWriter created by this builder.VariantContextWriterBuilderpublic VariantContextWriterBuilder setBuffer(int bufferSize)
VariantContextWriter created by this builder.
Set to 0 for no buffering.
Does not affect OutputStreams passed directly to VariantContextWriterBuilder.bufferSize - the buffer size to useVariantContextWriterBuilderpublic VariantContextWriterBuilder unsetBuffering()
VariantContextWriter created by this builder.
Does not affect OutputStreams passed directly to VariantContextWriterBuilder.VariantContextWriterBuilderpublic VariantContextWriterBuilder setCreateMD5(boolean createMD5)
VariantContextWriter created by this builder.createMD5 - boolean, true to create an MD5 digestVariantContextWriterBuilderpublic VariantContextWriterBuilder setCreateMD5()
VariantContextWriter created by this builder.VariantContextWriterBuilderpublic VariantContextWriterBuilder unsetCreateMD5()
VariantContextWriter created by this builder.VariantContextWriterBuilderpublic VariantContextWriterBuilder setOptions(java.util.EnumSet<Options> options)
Options for the VariantContextWriterBuilder with a new set.options - the complete set of options to useVariantContextWriterBuilderpublic VariantContextWriterBuilder setOption(Options option)
Options for the VariantContextWriterBuilder, if it's not already present.option - the option to setVariantContextWriterBuilderpublic VariantContextWriterBuilder unsetOption(Options option)
Options for the VariantContextWriterBuilder, if it's present.option - the option to unsetVariantContextWriterBuilderpublic VariantContextWriterBuilder modifyOption(Options option, boolean setIt)
option - the option to modifysetIt - true to set the option, false to unset it.VariantContextWriterBuilderpublic static void setDefaultOption(Options option)
Options that will be used as the initial set of options
for all VariantContextWriterBuilders created after this call.option - the option to setpublic static void unsetDefaultOption(Options option)
Options that will be used as the initial set of options
for all VariantContextWriterBuilders created after this call.option - the option to unsetpublic VariantContextWriterBuilder clearOptions()
Options for the VariantContextWriterBuilder.public VariantContextWriter build(java.nio.file.OpenOption... openOptions)
VariantContextWriter.VariantContextWriter as specified by previous method calls,
optionally applying the specified OpenOptions.RuntimeIOException - if the writer is configured to write to a file, and the corresponding path does not exist.java.lang.IllegalArgumentException - if no output file or stream is specified.java.lang.IllegalArgumentException - if Options.INDEX_ON_THE_FLY is specified and no reference dictionary is provided.java.lang.IllegalArgumentException - if Options.INDEX_ON_THE_FLY is specified and a stream output is specified.public static VariantContextWriterBuilder.OutputType determineOutputTypeFromFile(java.nio.file.Path path)
f - A file whose VariantContextWriterBuilder.OutputType we want to inferVariantContextWriterBuilder.OutputType. Never null.