How to convert gvcf file to normal vcf file ?
1
0
Entering edit mode
3.7 years ago
DareDevil ★ 4.3k

Hi, I followed following steps to arrive at gvcf file:

#Mark duplicates in the aligned file
gatk MarkDuplicates -I s1.bam --METRICS_FILE s1_markdups_gatk_metrics.txt -O s1_sorted_gatkMarkDups.bam --VALIDATION_STRINGENCY LENIENT

#Recalibrating bases based on known Indels, snp data
gatk BaseRecalibrator --input s1_sorted_gatkMarkDups.bam --known-sites $MillsIndels --known-sites $Indels1kGenome --known-sites $DBSNP --output s1_recal_data.table --reference $reference

# Applying the recalibrated base info on Bam
gatk ApplyBQSR --input s1.sorted_gatkMarkDups.bam --reference $reference --bqsr-recal-file s1_recal_data.table --output s1_sorted.deduped.bqsr.bam

# Variant calling using Haplotype caller algorithm 
gatk HaplotypeCaller --input s1_sorted.deduped.bqsr.bam --reference $reference --emit-ref-confidence GVCF --dbsnp $DBSNP --output s1_genome.g.vcf.gz

Now, I want to convert to gvcf file to a normal vcf file. Is it fine to use the following code to convert the files?

#calling only variants from a Genome VCF file
gatk GenotypeGVCFs -R $reference --variant s1_genome.g.vcf.gz -O s1.vcf

I have seen other post about convrting here and here. But, I did not get an accepted answer from those posts.

vcf gatk gvcf • 4.9k views
ADD COMMENT
1
Entering edit mode
--output s1_genome.g.vcf.gz
ADD REPLY
0
Entering edit mode

thanks for indicating!!

ADD REPLY
4
Entering edit mode
3.7 years ago
tothepoint ▴ 940

This gatk GenotypeGVCFs -R $reference --variant s1_genome.g.vcf.gz -O s1.vcf look fine but you can also try bcftools convert --gvcf2vcf to convert your file/s.

ADD COMMENT
1
Entering edit mode
 --variant s1_genome.g.vcf.gz

not

 --variant s1_genomevcf.gz

I think GATK is sensitive to the extensions.

ADD REPLY
0
Entering edit mode

Missed. Updated the post. Thank You

ADD REPLY

Login before adding your answer.

Traffic: 2440 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