This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Unable to filter chromosomal coordinates with bcftools

I have txt file which contains the chromosomal positions of interest:

chromPos.txt
1 55
1 56
1 58
1 67
1 69

and so on.

i would like to use it to filter my snpeff file. To achieve this, i use the following command:

bcftools view -R chromPos.txt -o regions.txt file.vcf.snpeff 

Since my input is a txt file, I get an error that bcfools is not able to parse the input file. My guess is that it arises due to the chromPos.txt format. I found threads concerning the same topic Best way to query VCF for specific variants My issue lies in the fact that I dont know how to make my text file a vcf file. Is it possible for a vcf file to only contain 2 columns (chrom and position)? I've tried mv chromPos.txt chromPos.vcf .It yields the same error as the txt file.

I am thankful for any advice you have for me.

Edit/Update: was able to solve all my issues regarding filtering and subsettinng the vcf file through the articles found at:

https://www.biocomputix.com/post/bcftools Highly recommend!

snpeff vcf bcftools

Is your chromPos.txt file tab delimited? And the chromosome names match with VCF file?

Yes, my chromPos.txt is separated by tabs and the chromosomes’ names in the vcf file are denoted the same way as the ones in the chromPos file.

R option requires indexed VCF/BCF files.

Is that also the case?

Neither the vcf file or my chromPos are indexed. I'll try indexing them. Thank you

0 answers

No answers yet.

Log in to answer this question.