Skip to content

About

Selects a subset of variants from a VCF file based on criteria such as variant type (SNP, INDEL), sample identity, JEXL filter expressions, and filtering status. Produces a new VCF containing only the variants that meet the selection criteria. Part of the GATK4 variant filtering toolkit.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

gatk.SelectVariants

Version: 1
Author: GenePattern Team, Broad Institute
Contact: gp-help@broadinstitute.org
Algorithm Version: GATK 4.1.4.1


Summary

gatk.SelectVariants selects a subset of variants from a VCF file based on one or more filtering criteria. The output is a new VCF containing only the variants that meet the specified criteria, with AN, AC, and AF annotations automatically recalculated for the selected subset.

Typical workflow position:

Mutect2 / HaplotypeCaller
        |
        v
  [raw variants VCF]
        |
        v
  gatk.SelectVariants   <-- this module
        |
        v
  [filtered subset VCF]
        |
        v
  Downstream analysis (annotation, filtering, etc.)

Common use cases include:

  • Extracting only SNPs or only INDELs for separate VQSR/filtering pipelines
  • Subsetting to a single sample from a multi-sample VCF
  • Selecting high-confidence variants using JEXL expressions (e.g., AF > 0.01)
  • Removing filtered sites or reference-only calls from a VCF

References


Parameters

Name Description Default
input.vcf Input VCF file containing variants to be subsetted (.vcf or .vcf.gz) --
input.vcf.tbi Tabix index (.tbi) for bgzip-compressed input VCF; required when input is .vcf.gz --
reference Reference genome FASTA file (same reference used for alignment and variant calling) --
reference.fai FASTA index (.fai) for the reference; generated by samtools faidx --
reference.dict Sequence dictionary (.dict) for the reference; generated by GATK/Picard CreateSequenceDictionary --
output.vcf.name Name for the output VCF file selected.vcf
select.type.to.include Select only variants of a specific type: SNP, INDEL, MIXED, MNP, SYMBOLIC, or NO_VARIATION --
select.expressions JEXL expression for variant filtering (e.g., AF > 0.001, DP > 100) --
exclude.filtered When Yes, exclude variants with any FILTER value other than PASS --
exclude.non.variants When Yes, exclude sites where no sample carries an alternate allele --
remove.unused.alternates When Yes, remove alternate alleles absent from all output genotypes --
keep.original.chr.counts When Yes, store original AC/AF/AN values in AC_Orig/AF_Orig/AN_Orig fields --
sample.name Include only genotypes from this sample; AC/AF/AN are recalculated for the subset --
arguments.file GATK arguments file for advanced options not exposed as parameters --
gatk.config.file GATK configuration file for customizing runtime behavior --

Input Files

  1. input.vcf (required) -- VCF file of variants to subset. Accepted formats: .vcf (uncompressed) or .vcf.gz (bgzip-compressed). If providing .vcf.gz, also supply the companion .tbi tabix index.

  2. input.vcf.tbi (optional) -- Tabix index for the compressed input VCF. Must have the same base name as the input VCF with .tbi appended (e.g., variants.vcf.gz.tbi).

  3. reference (required) -- Reference genome FASTA. Must be the same reference used for alignment and variant calling. Companion .fai and .dict files are required.

  4. reference.fai (required) -- FASTA index generated by samtools faidx reference.fasta. Must correspond to the reference FASTA.

  5. reference.dict (required) -- Sequence dictionary generated by gatk CreateSequenceDictionary -R reference.fasta. Must correspond to the reference FASTA.

  6. arguments.file (optional) -- Plain text file containing additional GATK SelectVariants arguments, one per line. Useful for advanced options or for specifying multiple --sample-name or --select-type-to-include values. Passed to GATK as --arguments_file.

  7. gatk.config.file (optional) -- GATK properties configuration file. Passed to GATK as --gatk-config-file.


Output Files

  1. <output.vcf.name> -- VCF file containing only the variants that met the selection criteria. AN, AC, and AF annotations are automatically recalculated for the selected subset. If keep.original.chr.counts is enabled, original values are preserved in AC_Orig, AF_Orig, and AN_Orig INFO fields.

Requirements

  • Docker image: broadinstitute/gatk:4.1.4.1
  • Memory: 8 GB
  • CPUs: 2

Version Comments

Version Comment
1 Initial release wrapping GATK 4.1.4.1 SelectVariants

About

Selects a subset of variants from a VCF file based on criteria such as variant type (SNP, INDEL), sample identity, JEXL filter expressions, and filtering status. Produces a new VCF containing only the variants that meet the selection criteria. Part of the GATK4 variant filtering toolkit.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages