We've moved!
This site is now read-only. You can find our new documentation site and support forum for posting questions here.
Be sure to read our welcome blog!

Ordering samples with SelectVariants and VariantsToTable

Hello GATK team,

Given a sample.txt file to be used with -sf flag, and sample names given on each line, is there an option in SelectVariants and/or VariantsToTable that allows output to be ordered as specified?

sample.txt file:

desired sample fields in .vcf file:
Ind1 Ind4 Ind2 Ind3

This can be done with command line tools, but thought I would ask here first. Thanks!

Issue · Github
by Sheila

Issue Number
Last Updated
Closed By

Best Answer


  • SheilaSheila Broad InstituteMember, Broadie ✭✭✭✭✭


    Unfortunately, it seems like the output is in numerical order and there is no option to override that. Let me see if I can put in a feature request.


  • SheilaSheila Broad InstituteMember, Broadie ✭✭✭✭✭


    This feature has been turned down by the developers. They would prefer to have a universally consistent rule for ordering. You can either write scripts that are not order-sensitive, or convert to a specific order using some other solution. It seems like you already know how to do that, so it should not be a problem.


  • o_Oo_O Member

    Thank you, Sheila. Is there an option to keep the columns as is (i.e., not re-ordered) in my vcf when using VariantsToTable? Thanks!

Sign In or Register to comment.