This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to convert gvcf file to normal vcf file ?

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

thanks for indicating!!

1 answer

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.

 --variant s1_genome.g.vcf.gz

not

 --variant s1_genomevcf.gz

I think GATK is sensitive to the extensions.

Missed. Updated the post. Thank You

Log in to answer this question.