• Diagnostics and Quality Control Tools
  • ASEReadCounter
  • AnalyzeCovariates
  • CallableLoci
  • CheckPileup
  • CompareCallableLoci
  • ContEst
  • CountBases
  • CountIntervals
  • CountLoci
  • CountMales
  • CountRODs
  • CountRODsByRef
  • CountReadEvents
  • CountReads
  • CountTerminusEvent
  • DepthOfCoverage
  • DiagnoseTargets
  • DiffObjects
  • ErrorRatePerCycle
  • FastaStats
  • FindCoveredIntervals
  • FlagStat
  • GCContentByInterval
  • GatherBqsrReports
  • Pileup
  • PrintRODs
  • QualifyMissingIntervals
  • ReadClippingStats
  • ReadGroupProperties
  • ReadLengthDistribution
  • SimulateReadsForVariants
  • Sequence Data Processing Tools
  • BaseRecalibrator
  • ClipReads
  • IndelRealigner
  • LeftAlignIndels
  • PrintReads
  • RealignerTargetCreator
  • SplitNCigarReads
  • SplitSamFile
  • Variant Discovery Tools
  • ApplyRecalibration
  • CalculateGenotypePosteriors
  • GATKPaperGenotyper
  • GenotypeGVCFs
  • HaplotypeCaller
  • MuTect2
  • RegenotypeVariants
  • UnifiedGenotyper
  • VariantRecalibrator
  • Variant Evaluation Tools
  • GenotypeConcordance
  • ValidateVariants
  • VariantEval
  • VariantFiltration
  • Variant Manipulation Tools
  • CatVariants
  • CombineGVCFs
  • CombineVariants
  • HaplotypeResolver
  • LeftAlignAndTrimVariants
  • PhaseByTransmission
  • RandomlySplitVariants
  • ReadBackedPhasing
  • SelectHeaders
  • SelectVariants
  • ValidationSiteSelector
  • VariantAnnotator
  • VariantsToAllelicPrimitives
  • VariantsToBinaryPed
  • VariantsToTable
  • VariantsToVCF

  • Annotation Modules
  • AS_BaseQualityRankSumTest
  • AS_FisherStrand
  • AS_InbreedingCoeff
  • AS_InsertSizeRankSum
  • AS_MQMateRankSumTest
  • AS_MappingQualityRankSumTest
  • AS_QualByDepth
  • AS_RMSMappingQuality
  • AS_ReadPosRankSumTest
  • AS_StrandOddsRatio
  • AlleleBalance
  • AlleleBalanceBySample
  • AlleleCountBySample
  • BaseCounts
  • BaseCountsBySample
  • BaseQualityRankSumTest
  • BaseQualitySumPerAlleleBySample
  • ChromosomeCounts
  • ClippingRankSumTest
  • ClusteredReadPosition
  • Coverage
  • DepthPerAlleleBySample
  • DepthPerSampleHC
  • ExcessHet
  • FisherStrand
  • FractionInformativeReads
  • GCContent
  • GenotypeSummaries
  • HaplotypeScore
  • HardyWeinberg
  • HomopolymerRun
  • InbreedingCoeff
  • LikelihoodRankSumTest
  • LowMQ
  • MVLikelihoodRatio
  • MappingQualityRankSumTest
  • MappingQualityZero
  • MappingQualityZeroBySample
  • NBaseCount
  • OxoGReadCounts
  • PossibleDeNovo
  • QualByDepth
  • RMSMappingQuality
  • ReadPosRankSumTest
  • SampleList
  • SnpEff
  • SpanningDeletions
  • StrandAlleleCountsBySample
  • StrandBiasBySample
  • StrandOddsRatio
  • TandemRepeatAnnotator
  • TransmissionDisequilibriumTest
  • VariantType
  • Read Filters
  • BadCigarFilter
  • BadMateFilter
  • CountingFilteringIterator.CountingReadFilter
  • DuplicateReadFilter
  • FailsVendorQualityCheckFilter
  • HCMappingQualityFilter
  • LibraryReadFilter
  • MalformedReadFilter
  • MappingQualityFilter
  • MappingQualityUnavailableFilter
  • MappingQualityZeroFilter
  • MateSameStrandFilter
  • MaxInsertSizeFilter
  • MissingReadGroupFilter
  • NoOriginalQualityScoresFilter
  • NotPrimaryAlignmentFilter
  • OverclippedReadFilter
  • Platform454Filter
  • PlatformFilter
  • PlatformUnitFilter
  • ReadGroupBlackListFilter
  • ReadLengthFilter
  • ReadNameFilter
  • ReadStrandFilter
  • ReassignMappingQualityFilter
  • ReassignOneMappingQualityFilter
  • ReassignOriginalMQAfterIndelRealignmentFilter
  • SampleFilter
  • SingleReadGroupFilter
  • UnmappedReadFilter
  • Resource File Codecs
  • BeagleCodec
  • BedTableCodec
  • RawHapMapCodec
  • RefSeqCodec
  • SAMPileupCodec
  • SAMReadCodec
  • TableCodec

  • Reference Utilities
  • FastaAlternateReferenceMaker
  • FastaReferenceMaker
  • QCRef
  • Showing docs for version 3.7-0


    CombineVariants

    Combine variant records from different sources

    Category Variant Manipulation Tools

    Traversal LocusWalker

    PartitionBy LOCUS


    Overview

    CombineVariants reads in variants records from separate ROD (Reference-Ordered Data) sources and combines them into a single VCF. Any number of sources can be input. This tool aims to fulfill two main possible use cases, reflected by the two combination options (MERGE and UNION), for merging records at the variant level (the first 8 fields of the VCF) or at the genotype level (the rest).

    By default, the input sets will be named variants, variants2, variants3, and so on. You can override this by providing an explicit name tag for each input, using the syntax " -V:name,format". Each input tagged in this way will be labeled as such in the output (i.e., set=name rather than set=variants2). For example, you could specify a set of control samples as " -V:control,vcf my_control_samples.vcf", and the resulting VCF records would contain the annotation "set=control" in the INFO field. It is strongly recommended to provide explicit names in this way when a rod priority list is provided.

    CombineVariants will emit a record for every site that was present in any of your input VCF files, and will annotate (in the set attribute in the INFO field) whether the record had a PASS or FILTER status in each input ROD . In effect, CombineVariants always produces a union of the input VCFs. However, any part of the Venn of the merged VCFs can be extracted using JEXL expressions on the set attribute using SelectVariants. If you want to extract just the records in common between two VCFs, you would first run CombineVariants on the two files to generate a single VCF and then run SelectVariants to extract the common records with `-select 'set == "Intersection"'`, as worked out in the detailed example in the documentation guide.

    Input

    Two or more variant sets to combine.

    Output

    A combined VCF.

    Usage examples

     

    Merge two separate callsets

     java -jar GenomeAnalysisTK.jar \
       -T CombineVariants \
       -R reference.fasta \
       --variant input1.vcf \
       --variant input2.vcf \
       -o output.vcf \
       -genotypeMergeOptions UNIQUIFY
     

    Get the union of calls made on the same samples

     java -jar GenomeAnalysisTK.jar \
       -T CombineVariants \
       -R reference.fasta \
       --variant:foo input1.vcf \
       --variant:bar input2.vcf \
       -o output.vcf \
       -genotypeMergeOptions PRIORITIZE \
       -priority foo,bar
     

    Caveats

    Additional notes


    Additional Information

    Read filters

    These Read Filters are automatically applied to the data by the Engine before processing by CombineVariants.

    Parallelism options

    This tool can be run in multi-threaded mode using this option.

    Window size

    This tool uses a sliding window on the reference.


    Command-line Arguments

    Engine arguments

    All tools inherit arguments from the GATK Engine' "CommandLineGATK" argument collection, which can be used to modify various aspects of the tool's function. For example, the -L argument directs the GATK engine to restrict processing to specific genomic intervals; or the -rf argument allows you to apply certain read filters to exclude some of the data from the analysis.

    CombineVariants specific arguments

    This table summarizes the command-line arguments that are specific to this tool. For more details on each argument, see the list further down below the table or click on an argument name to jump directly to that entry in the list.

    Argument name(s) Default value Summary
    Required Inputs
    --variant
     -V
    NA VCF files to merge together
    Optional Outputs
    --out
     -o
    stdout File to which variants should be written
    Optional Parameters
    --filteredrecordsmergetype
     -filteredRecordsMergeType
    KEEP_IF_ANY_UNFILTERED Determines how we should handle records seen at the same site in the VCF, but with different FILTER fields
    --genotypemergeoption
     -genotypeMergeOptions
    NA Determines how we should merge genotype records for samples shared across the ROD files
    --minimumN
     -minN
    1 Minimum number of input files the site must be observed in to be included
    --rod_priority_list
     -priority
    NA Ordered list specifying priority for merging
    --setKey
    set Key name for the set attribute
    Optional Flags
    --assumeIdenticalSamples
    false Assume input VCFs have identical sample sets and disjoint calls
    --excludeNonVariants
     -env
    false Exclude sites where no variation is present after merging
    --filteredAreUncalled
    false Treat filtered variants as uncalled
    --mergeInfoWithMaxAC
    false Use the INFO content of the record with the highest AC
    --minimalVCF
    false Emit a sites-only file
    --printComplexMerges
    false Emit interesting sites requiring complex compatibility merging to file
    --suppressCommandLineHeader
    false Do not output the command line to the header

    Argument details

    Arguments in this list are specific to this tool. Keep in mind that other arguments are available that are shared with other tools (e.g. command-line GATK arguments); see Inherited arguments above.


    --assumeIdenticalSamples / -assumeIdenticalSamples

    Assume input VCFs have identical sample sets and disjoint calls
    This option allows you to perform a simple merge (concatenation) to combine the VCFs, drastically reducing runtime. Note that in many cases where you think you want to use this option, you may want to check out the CatVariants tool instead, because CatVariants provides the same functionality, but does so even more efficiently.

    boolean  false


    --excludeNonVariants / -env

    Exclude sites where no variation is present after merging
    Exclude sites that do not contain any called ALT alleles in the merged callset. The evaluation is made after the merging procedure is complete.

    boolean  false


    --filteredAreUncalled / -filteredAreUncalled

    Treat filtered variants as uncalled
    If enabled, this flag causes filtered variants (i.e. variant records where the FILTER field is populated by something other than PASS or a dot) to be omitted from the output.

    boolean  false


    --filteredrecordsmergetype / -filteredRecordsMergeType

    Determines how we should handle records seen at the same site in the VCF, but with different FILTER fields

    The --filteredrecordsmergetype argument is an enumerated type (FilteredRecordMergeType), which can have one of the following values:

    KEEP_IF_ANY_UNFILTERED
    Union - leaves the record if any record is unfiltered.
    KEEP_IF_ALL_UNFILTERED
    Requires all records present at site to be unfiltered. VCF files that don't contain the record don't influence this.
    KEEP_UNCONDITIONAL
    If any record is present at this site (regardless of possibly being filtered), then all such records are kept and the filters are reset.

    FilteredRecordMergeType  KEEP_IF_ANY_UNFILTERED


    --genotypemergeoption / -genotypeMergeOptions

    Determines how we should merge genotype records for samples shared across the ROD files

    The --genotypemergeoption argument is an enumerated type (GenotypeMergeType), which can have one of the following values:

    UNIQUIFY
    Make all sample genotypes unique by file. Each sample shared across RODs gets named sample.ROD.
    PRIORITIZE
    Take genotypes in priority order (see the priority argument).
    UNSORTED
    Take the genotypes in any order.
    REQUIRE_UNIQUE
    Require that all samples/genotypes be unique between all inputs.

    GenotypeMergeType  NA


    --mergeInfoWithMaxAC / -mergeInfoWithMaxAC

    Use the INFO content of the record with the highest AC
    By default, the INFO field of the merged variant record only contains the INFO field attributes for which all original overlapping records had the same values. Discordant attributes are therefore discarded. This flag allows you to override that behavior and simply copy over the INFO field contents of whichever record had the highest AC value.

    boolean  false


    --minimalVCF / -minimalVCF

    Emit a sites-only file
    If this flag is enabled, the INFO, FORMAT and sample-level (genotype) fields will not be emitted to the output file.

    boolean  false


    --minimumN / -minN

    Minimum number of input files the site must be observed in to be included
    Sites that are present in fewer than this number of inputs will be ignored. This is a convenient way to build a collection of common variants and exclude rare variants.

    int  1  [ [ -∞  ∞ ] ]


    --out / -o

    File to which variants should be written

    VariantContextWriter  stdout


    --printComplexMerges / -printComplexMerges

    Emit interesting sites requiring complex compatibility merging to file

    boolean  false


    --rod_priority_list / -priority

    Ordered list specifying priority for merging
    Refers to the merging priority behavior described in the tool documentation regarding the choice of which record gets emitted when taking the union of variants that contain genotypes. The list must be passed as a comma-separated string listing the names of the variant input files. The list must be complete and include all variant inputs that are being provided to the tool. Use name tags for best results.

    String  NA


    --setKey / -setKey

    Key name for the set attribute
    Key used in the INFO key=value tag emitted describing which set(s) the combined record came from (e.g. set=control). This provides the option to override the default naming, so instead of set=control you could have it be origin=control, or any other word you want that is not already an INFO field attribute. Set this to 'null' if you don't want the set attribute emitted at all.

    String  set


    --suppressCommandLineHeader / -suppressCommandLineHeader

    Do not output the command line to the header
    By default, this tool writes the command line that was used in the header of the output VCF file. This flag enables you to override that behavior . This is most often useful when combining variants for dozens or hundreds of smaller VCFs iteratively, to avoid cluttering the header with a lot of command lines.

    boolean  false


    --variant / -V

    VCF files to merge together

    R List[RodBindingCollection[VariantContext]]  NA