Hello all,
I am a beginner programmer analysing some data in VCF format.
I have a .txt file, 'regions.txt' that contains a list of chromosomal positions in the format 1:3435245-34378385 (chromosome: then window coordinates).
I would like to create a loop that does the following:
For each line in regions.txt, extract this region from vcf.gz file, then run vcftools --window-pi on the region (all regions are 10kb in size) and export results to fileofresults.txt
So that in the end there is a single text file with results for all the regions in the regions.txt file.
If anyone knows how to do this or something similar your help is really appreciated. (Or if you know why this would not be possible please let me know!)
Thanks in advance for your help.
I am a beginner programmer analysing some data in VCF format.
I have a .txt file, 'regions.txt' that contains a list of chromosomal positions in the format 1:3435245-34378385 (chromosome: then window coordinates).
I would like to create a loop that does the following:
For each line in regions.txt, extract this region from vcf.gz file, then run vcftools --window-pi on the region (all regions are 10kb in size) and export results to fileofresults.txt
So that in the end there is a single text file with results for all the regions in the regions.txt file.
If anyone knows how to do this or something similar your help is really appreciated. (Or if you know why this would not be possible please let me know!)
Thanks in advance for your help.
Comment