How to pass a variable to vcftools --weir-fst-pop
1
0
Entering edit mode
4.7 years ago

Is it possible to pass a population list as a variable to the vcftools --weir-fst-pop function instead of a file?

My original code is correct and works: vcftools --bcf <bcf_file.txt> --weir-fst-pop <pop_1_file.txt> --weir-fst-pop <pop_2_file.txt> --out <output_file.txt>

However I need to run this code many times in a loop and it would be preferable not to create lots of files of population lists.

I have tried:

vcftools --bcf <bcf_file.txt> --weir-fst-pop ${<pop_1_list_as_variable>} --weir-fst-pop ${<pop_2_list_as_variable>} --out <output_file.txt>

and

vcftools --bcf <bcf_file.txt> --weir-fst-popecho ${<pop_1_list_as_variable>}--weir-fst-popecho ${<pop_2_list_as_variable>}--out <output_file.txt>

but I get the error Error: Unknown option: <first_sample_name_in_pop_1_variable>

Is this possible?

Thanks

vcftools fst bash • 1.5k views
ADD COMMENT
0
Entering edit mode
4.7 years ago

This seems to work:

vcftools --bcf <bcf_file.bcf> --weir-fst-pop <(echo ${<pop_1_list_as_variable>}) --weir-fst-pop <(echo ${<pop_2_list_as_variable>})

ADD COMMENT

Login before adding your answer.

Traffic: 2119 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6