Heads up:
We’re moving the GATK website, docs and forum to a new platform. Read the full story and breakdown of key changes on this blog.
If you happen to see a question you know the answer to, please do chime in and help your fellow community members. We encourage our fourm members to be more involved, jump in and help out your fellow researchers with their questions. GATK forum is a community forum and helping each other with using GATK tools and research is the cornerstone of our success as a genomics research community.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.

Order of the sample names in cohort VCF file using GenotypeGVCFs

jpoulojpoulo BostonMember

I wanted to produce the cohort vcf file from several g.vcf files made using HaplotypeCaller. I used the 'GenotypeGVCFs' and gave a list of g.vcf files. The order of samples in the final vcf file is different from the gvcf file list I provided. It looks like it sorted alphabetically with the sample name. How can I get samples in the same order as in the gvcf file list? I am using GATK 3.3.


Best Answer


  • tommycarstensentommycarstensen United KingdomMember ✭✭✭
    edited August 2015

    @jpoulo I didn't like this feature myself initially for a range of reasons, but I have really come to appreciate, that I always know my samples are alphabetically sorted in a VCF generated by GATK. If you really want to reorder your samples, then it can easily be done with unix utilities such as cut and paste for the header line and the data lines. Remember to concatenate the metadata lines on top of the cake. This can be done in many ways.

    Alternatively you can rename your samples on the fly using --sample_rename_mapping_file; e.g. A -> 3A, B -> 2B, C -> 1C, to have them ordered 1C, 2B, 3A.

  • MatteodiggMatteodigg ItalyMember

    Hi @Sheila ,

    the default is to order samples numerically or alphabetically

    what is the command option to order samples numerically?
    Thanks in advice for your help!

  • SheilaSheila Broad InstituteMember, Broadie admin


    It looks like the output sample names are ordered in ASCII. Basically, the default is to order the names numerically and you don't have to set any special arguments :smile:


Sign In or Register to comment.