This is a test version of Biostars. For the public version, visit https://www.biostars.org.
intersecting bed and vcf files for polyploid samples

Hello,

I want to intersect a vcf file with a bed file, that is to get the list of SNPs falling in a specific interval.

For my diploid samples, I could successfully use this command:

vcftools --vcf Sample.1.vcf --bed coordinates.bed --out VCFNEW --recode

But using this for my pooled samples which have a higher ploidy, I get the following error:

Error: Polypolidy found, and not supported by vcftools

I was wondering how I could overcome this problem.

Thanks.

vcftools intersectbed

2 answers

Have you tried just using bedtools intersect? I've never tried that with a polyploid VCF file, but since it's not trying to recode anything it might work.

Oh sure, it worked, thanks a lot!

Mapping with BEDOPS bedmap provides the intervals, along with any SNPs overlapping each interval:

$ bedmap --echo --echo-map coordinates.bed <(vcf2bed < Sample.1.vcf) > answer.bed

Log in to answer this question.