Entering edit mode
5.1 years ago
Hann
▴
110
Hello all,
I have a vcf file (SNP data) of 157 a cereal crop individuals. I have extracted only SNPs in chromosome 9 as the following:
vcftools --vcf file.vcf --chr chr09 --recode --recode-INFO-all --out chr9_output
I am interested in getting a subset of VCF files in a window 10 Mbp from chromosome 9 vcf file. Is this possible?
.
Thanks,
You want to split your vcf in 10 Mbp windows? Or do you want to extract a certain 10 Mbp window?
I want to have a vcf file has the SNPs from 1 to 10 Mbp another vcf file has SNPs from 10 Mbp to 20 Mbp ... and so on
one of the ideas that I think it will work is use bedtools intersect like this
wind.bed is a tab-delimited file has one line as following
But I am getting error Error: unable to open file or unable to determine types for file Fonio_cultivated_noSingletons_chr09A.recode.vcf
That means that your VCF is not formatted properly, maybe the header is missing. Also
-bed
is the wrong flag, use-b
, please read the docs why. Also, tabix will be notably faster. Simply make a file with the windows you want and loop through it with the linked tabix code.Very good! worked! Thanks a lot!