How to pass a variable to vcftools --weir-fst-pop
1
0
Entering edit mode
2.6 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 • 931 views
ADD COMMENT
0
Entering edit mode
2.6 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: 1402 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