GATK's selectVariants not outputting VCF
1
0
Entering edit mode
2.4 years ago
dec986 ▴ 380

I create a gVCF via GATK:

gatk-4.2.6.0/gatk --java-options "-Xmx4g" HaplotypeCaller --input HGFLY.AddOrReplaceReadGroups.sort.bam --reference /usr/local/share/hg38/hg38.fa -O HGFLY.g.vcf.gz -ERC GVCF

and then I attempt to get the SNP/indels thus:

gatk-4.2.6.0/gatk SelectVariants -V HGFLY.g.vcf.gz -R /usr/local/share/hg38/hg38.fa -O HGFLY.selectVariants.vcf

but this outputs a gVCF, when this isn't what I need:

chr1    1   .   N   <NON_REF>   .   .   END=10066   GT:DP:GQ:MIN_DP:PL  0/0:0:0:0:0,0,0
chr1    10067   .   T   <NON_REF>   .   .   END=10067   GT:DP:GQ:MIN_DP:PL  0/0:1:3:1:0,3,30
chr1    10068   .   A   <NON_REF>   .   .   END=10068   GT:DP:GQ:MIN_DP:PL  0/0:1:0:1:0,0,0
chr1    10069   .   A   <NON_REF>   .   .   END=10071   GT:DP:GQ:MIN_DP:PL  0/0:1:3:1:0,3,15
chr1    10072   .   C   <NON_REF>   .   .   END=10072   GT:DP:GQ:MIN_DP:PL  0/0:1:0:1:0,0,0
chr1    10073   .   T   <NON_REF>   .   .   END=10073   GT:DP:GQ:MIN_DP:PL  0/0:1:3:1:0,3,42
chr1    10074   .   A   <NON_REF>   .   .   END=10074   GT:DP:GQ:MIN_DP:PL  0/0:1:0:1:0,0,0
chr1    10075   .   A   <NON_REF>   .   .   END=10077   GT:DP:GQ:MIN_DP:PL  0/0:1:3:1:0,3,15
chr1    10078   .   C   <NON_REF>   .   .   END=10078   GT:DP:GQ:MIN_DP:PL  0/0:1:0:1:0,0,0

why is SelectVariants outputting another gVCF? How can I alter the command so that a proper VCF is output?

GATK • 1.7k views
ADD COMMENT
0
Entering edit mode

Your command seems incomplete... Try using with --select-type-to-include INDEL

If it works, you can use --select-type-to-include multiple times.

ADD REPLY
0
Entering edit mode

friends shouldn't let you select variants in a GVCF file.

ADD REPLY
0
Entering edit mode

How can I select variant from the aligned bam without the intermediate gVCF? I would prefer to not use the gVCF, but https://gatk.broadinstitute.org/hc/en-us/articles/360037225632-HaplotypeCaller implies that the gVCF is necessary. The manual doesn't show how to make the VCF directly from HaplotypeCaller

ADD REPLY
0
Entering edit mode

This is how I use HaplotypeCaller to generate VCF only

$GATK HaplotypeCaller -R $REF_GATK -I ${i}.bam -O $GATK_OUT/${i}.vcf --sequence-dictionary $DICT --dbsnp $DBSNP -stand-call-conf 30 --min-pruning 3 --add-output-vcf-command-line false -L $TARGETS
ADD REPLY
0
Entering edit mode

you'll need to generate a VCF with gatk GenotypeGVCF

ADD REPLY
1
Entering edit mode
2.4 years ago
dec986 ▴ 380

The correct way to enter in the command to GATK's HaplotypeCaller is

/usr/local/share/gatk-4.2.6.0/gatk --java-options '-Xmx4g' HaplotypeCaller --input HGFLY.AORGs.sort.bam -reference /usr/local/share/hg38/hg38.fa -O HGFLY.variants.only.vcf

the above command generates a VCF that has the necessary VCF

ADD COMMENT

Login before adding your answer.

Traffic: 1376 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6