If you happen to see a question you know the answer to, please do chime in and help your fellow community members. We appreciate your help!

Test-drive the GATK tools and Best Practices pipelines on Terra

Check out this blog post to learn how you can get started with GATK and try out the pipelines in preconfigured workspaces (with a user-friendly interface!) without having to install anything.

[GATK4] combining g.vcf files for single sample on different intervals

tcezardtcezard EdinburghMember

I'm working with WGS using GATK 4.1.0 HaplotypeCaller to generate g.vcf file on many different non overlapping intervals.
I'd like to have a single final g.vcf file for the sample.
I'm trying to combine the g.vcf file using CombineGVCF but this seems very slow (>24 hours for 100 g.vcf file).

gatk CombineGVCFs --output out.g.vcf  --reference hg38.fa -V list_g.vcf_file

I tried concatenating the g.vcf with unix tools.

cat <(grep '^#' {first.g.vcf}) <(cat `cat {list_g.vcf_file}` | grep -v '^#' )  > output.g.vcf

That took about a minute and a half.
Considering I know the order of the intervals and the fact that they are non overlapping, is there a fundamental problem with concatenating g.vcf files?


  • tcezardtcezard EdinburghMember

    I wanted to add that I have tried GatherVCF and MergeVCF and both had failed with error:
    Illegal character in fragment at index 1: ##fileformat=VCFv4.2
    I though that this was due to the fact that I'm merging GVCF files instead of VCF files.
    Turns out this is due to the file extension I was using .gvcf instead of .g.vcf.
    I'll be trying this two tools now.

    My original question still stand though would there be any issue with using unix tools to concatenate?

  • tcezardtcezard EdinburghMember

    Both GatherVCF and MergeVCF finished relatively promptly (~ 1 hour) and produced exactly the same g.vcf file as the concatenated file generated with unix tool.

  • bhanuGandhambhanuGandham Cambridge MAMember, Administrator, Broadie, Moderator admin

    Hi @tcezard

    If you are able to produce the exact same files with all three methods (unix, GatherVCF and MergeVCF) and if you are able to concatenate it in the right order then it probably should work for your purposes. Let me know if you find any errors with this in the downstream steps. I am curious to know if it would work.

Sign In or Register to comment.