@DocumentedFeature public final class UpdateVCFSequenceDictionary extends VariantWalker
This tool is designed to update the sequence dictionary in a variant file using a dictionary from another variant, alignment, dictionary, or reference file. The dictionary must be valid, i.e. must contain a sequence record, for all variants in the target file. The dictionary lines start with '##contig='.
By specifying both --replace and --disable-sequence-dictionary-validation, one can force replace an invalid sequence dictionary in a variant file with a valid sequence dictionary in another file.
gatk UpdateVCFSequenceDictionary \ -V cohort.vcf.gz \ --source-dictionary sample.bam \ --output cohort_replacedcontiglines.vcf.gz \ --replace=true
gatk UpdateVCFSequenceDictionary \ -V resource.vcf.gz \ --source-dictionary reference.dict \ --output resource_newcontiglines.vcf.gz
gatk UpdateVCFSequenceDictionary \ -V resource.vcf.gz \ -R reference.fasta \ --output resource_newcontiglines.vcf.gz
The -O argument specifies the name of the updated file. The --source-dictionary argument specifies the input sequence dictionary. The --replace argument is optional, and forces the replacement of the dictionary if the input file already has a dictionary.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DICTIONARY_ARGUMENT_NAME |
java.lang.String |
outFile |
static java.lang.String |
REPLACE_ARGUMENT_NAME |
drivingVariantFile
DEFAULT_DRIVING_VARIANTS_LOOKAHEAD_BASES, genomicsDBOptions
addOutputSAMProgramRecord, addOutputVCFCommandLine, cloudIndexPrefetchBuffer, cloudPrefetchBuffer, createOutputBamIndex, createOutputBamMD5, createOutputVariantIndex, createOutputVariantMD5, disableBamIndexCaching, features, intervalArgumentCollection, lenientVCFProcessing, outputSitesOnlyVCFs, progressMeter, readArguments, referenceArguments, SECONDS_BETWEEN_PROGRESS_UPDATES_NAME, seqValidationArguments
GATK_CONFIG_FILE, NIO_MAX_REOPENS, NIO_PROJECT_FOR_REQUESTER_PAYS, QUIET, specialArgumentsCollection, tmpDir, useJdkDeflater, useJdkInflater, VERBOSITY
Constructor and Description |
---|
UpdateVCFSequenceDictionary() |
Modifier and Type | Method and Description |
---|---|
void |
apply(htsjdk.variant.variantcontext.VariantContext vc,
ReadsContext readsContext,
ReferenceContext ref,
FeatureContext featureContext)
Process an individual variant.
|
void |
closeTool()
Close out the new variants file.
|
htsjdk.samtools.SAMSequenceDictionary |
getBestAvailableSequenceDictionary()
Overriding the superclass method to preferentially
choose the sequence dictionary from the driving source of variants.
|
void |
onTraversalStart()
Operations performed just prior to the start of traversal.
|
getDrivingVariantsFeatureInput, getHeaderForVariants, getSequenceDictionaryForDrivingVariants, getSpliteratorForDrivingVariants, initializeDrivingVariants, onShutdown, onStartup, traverse
getDrivingVariantCacheLookAheadBases, getGenomicsDBOptions, getProgressMeterRecordLabel, getTransformedVariantStream, getTransformedVariantStream, makePostVariantFilterTransformer, makePreVariantFilterTransformer, makeVariantFilter, requiresFeatures
directlyAccessEngineFeatureManager, directlyAccessEngineReadsDataSource, directlyAccessEngineReferenceDataSource
addFeatureInputsAfterInitialization, createSAMWriter, createSAMWriter, createVCFWriter, createVCFWriter, doWork, getDefaultCloudIndexPrefetchBufferSize, getDefaultCloudPrefetchBufferSize, getDefaultReadFilters, getDefaultToolVCFHeaderLines, getDefaultVariantAnnotationGroups, getDefaultVariantAnnotations, getHeaderForFeatures, getHeaderForReads, getHeaderForSAMWriter, getMasterSequenceDictionary, getPluginDescriptors, getReferenceDictionary, getSequenceDictionaryValidationArgumentCollection, getToolName, getTransformedReadStream, getTraversalIntervals, hasFeatures, hasReads, hasReference, hasUserSuppliedIntervals, makePostReadFilterTransformer, makePreReadFilterTransformer, makeReadFilter, makeVariantAnnotations, onTraversalSuccess, requiresIntervals, requiresReads, requiresReference, transformTraversalIntervals, useVariantAnnotations
customCommandLineValidation, getCommandLine, getCommandLineParser, getDefaultHeaders, getMetricsFile, getSupportInformation, getToolkitName, getToolkitShortName, getToolStatusWarning, getUsage, getVersion, instanceMain, instanceMainPostParseArgs, isBetaFeature, isExperimentalFeature, parseArgs, printLibraryVersions, printSettings, printStartupMessage, runTool, setDefaultHeaders, warnOnToolStatus
@Argument(fullName="output", shortName="O", doc="File to which updated variants should be written") public java.lang.String outFile
public static final java.lang.String DICTIONARY_ARGUMENT_NAME
public static final java.lang.String REPLACE_ARGUMENT_NAME
public void onTraversalStart()
GATKTool
onTraversalStart
in class GATKTool
public void apply(htsjdk.variant.variantcontext.VariantContext vc, ReadsContext readsContext, ReferenceContext ref, FeatureContext featureContext)
VariantWalker
apply
in class VariantWalker
vc
- Current variant being processed.readsContext
- Reads overlapping the current variant. Will be an empty, but non-null, context object
if there is no backing source of reads data (in which case all queries on it will return
an empty array/iterator)ref
- Reference bases spanning the current variant. Will be an empty, but non-null, context object
if there is no backing source of reference data (in which case all queries on it will return
an empty array/iterator). Can request extra bases of context around the current variant's interval
by invoking ReferenceContext.setWindow(int, int)
on this object before calling ReferenceContext.getBases()
featureContext
- Features spanning the current variant. Will be an empty, but non-null, context object
if there is no backing source of Feature data (in which case all queries on it will return an
empty List).public void closeTool()
public htsjdk.samtools.SAMSequenceDictionary getBestAvailableSequenceDictionary()
VariantWalkerBase
getBestAvailableSequenceDictionary
in class VariantWalkerBase
null
if no one dictionary is the best one.