Unable to filter chromosomal coordinates with bcftools
0
0
Entering edit mode
9 months ago
beepboop • 0

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 • 520 views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

R option requires indexed VCF/BCF files.

Is that also the case?

ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 1606 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6