This is a test version of Biostars. For the public version, visit https://www.biostars.org.
polyploidy found and not supported by vcftools

Hi, I apologise in advance for the naive question, I have never used vcftools before. I am trying to complete what seems to be a fairly standard operation, where I filter a vcf file based on the presence/absence of snps:

  vcftools --vcf main.vcf --out test --snps filter.xlsx --recode

The above command returns the error:

Error: Polyploidy found, and not supported by vcftools: 1:50591

The above is based on a previous post: Variant calling results in polyploidy data I tried the following:

 grep -v "^#" main.vcf | cut -f 10- | cut -d ':' -f 1 | sort | uniq

which returns:

./././././././././././././././././././.
0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/1
0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/1/1
0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/1/2
0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/1/1/1
0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/1/2/2
0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/1/1/1/1
0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/1/1/1/1/1.....

The previous post did not seem to solve the problem can anyone tell me how to solve this???

software error

Hi, Thank you again for your answers. There was an error in the file. Do you know how to change xlsx to vcf directly?

2 answers

--snps filter.xlsx

use GATK SelectVariants with option --keepIDs

If a file containing a list of IDs is provided to this argument, the tool will only select variants whose ID field is present in this list of IDs. The matching is done by exact string matching. The expected file format is simply plain text with one ID per line.

PS: filter.xlsx tell me it's not really an excel spreadsheet.

Hi, Thank you very much for your answer. It seems my data is a little unconventional. I have a list of snps (in excel format) which I have to source from vcf file and filter into an output vcf file. But an ID is not supplied for each line, so I have to search for them using the numbers of chromosomes and positions. Do you know how can I extract them to vcf format? I am a beginner and would prefer to become familiar with vcf before trying another software like 'GATK' Also, yes the filter file is actually in excel format.... do you recommend a txt/vcf rather than xlsx format for the filter file instead?

, so I have to search for them using the numbers of chromosomes and positions.

convert your table to bed. (chrom / 0-based-start/ 0-based-end) and use https://samtools.github.io/bcftools/bcftools.html

bcftools view  --targets-file the.bed input.vcf

Log in to answer this question.