SelectVariants to get a vcf file with 1 individual from a vcf file with 3 individuals
Hi!
I'm new to GATK. I have a vcf file from a trio family so it has the mom, dad, and child. I am trying to get a vcf file with only the child and not the parents.
a) GATK version used: gatk-4.1.6.0
b) Exact GATK commands used
gatk SelectVariants -R /vipbg-data/home/20180828_NG/VariantFiltration/reference/GCF_000001405.39_GRCh38.p13_genomic.fna.gz -V /vipbg-data/home/20140708_BC/variants/Name/craSyn-Trio2.recode.vcf -O /vipbg-data/home/20180828_NG/VariantFiltration/CS64.vcf sn 10017333.1_CS-64
and the header of the VCF file is
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT 10017333.1_CS-64 10017333.1_CS-65 10017333.1_CS-66
c) The entire error log if applicable.
USAGE: SelectVariants [arguments]
This tool makes it possible to select a subset of variants based on various criteria in order to facilitate certain analyses. Examples include comparing and contrasting cases vs. controls, extracting variant or non-variant loci that meet certain requirements, or troubleshooting some unexpected results, to name a few.
Version:4.1.6.0
Required Arguments:
--output,-O:GATKPathSpecifier Path to which variants should be written Required.
--variant,-V:String A VCF file containing variants Required.
...[There's more but it is very long so I won't include it here **so, the output is a long list of specific arguments for SelectVariants and then the error message below**]...
***********************************************************************
A USER ERROR has occurred: Invalid argument 'sn'.
***********************************************************************
Thank you in advance!
-
Hi Linda Do
Such simple tasks do not require such complex solutions. There is a BCFtools package for any manipulations with VCF files. All you have to do is to run
bcftools view -O v -o <output_vcf_file> -s <sample_name> <input_vcf_file>
The sample names in your VCF are 10017333.1_CS-64, 10017333.1_CS-65 and 10017333.1_CS-66. You have to know which one corresponds to a child.
-
Thank you so much!
I used:
bcftools view -O v -o CS64.vcf -s 10017333.1_CS-64 craSyn-Trio2.recode.vcf
And it worked! -
Hi Linda Do,
The only problem with your code was that you forgot to put a "-" before sn, like this "-sn".
Just in case anyone else stumbles on this :)
Best,
Please sign in to leave a comment.
3 comments