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.

Tagged:

Best Answer

Answers

  • 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, Moderator admin

    @Matteodigg
    Hi,

    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:

    -Sheila

Sign In or Register to comment.