samtools / bcftools

This is the official development repository for BCFtools. See installation instructions and other documentation here http://samtools.github.io/bcftools/howtos/install.html
http://samtools.github.io/bcftools/
Other
678 stars 240 forks source link

How to format a file to extract a set of SNPs from a BCF file? #1196

Open montenegrina opened 4 years ago

montenegrina commented 4 years ago

Hello,

in order to run: bcftools view -T mylist.txt file.bcf -Ou -o filteredfile.bcf

can you please show me how a first few lines of "mylist.txt" should look like?

Thanks Ana

pd3 commented 4 years ago

It's a tab-delimtied file with the columns chrom, pos and optional end. This is described in the manual page http://samtools.github.io/bcftools/bcftools.html

montenegrina commented 4 years ago

Thank you so much, so it would look like this:

chr2 48407477 chr2 48408216 chr2 48408487 chr2 48181348

do I need here string "chr" or no?

On Mon, Apr 13, 2020 at 9:09 AM Petr Danecek notifications@github.com wrote:

Closed #1196 https://github.com/samtools/bcftools/issues/1196.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/samtools/bcftools/issues/1196#event-3227198438, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACF3RTFRL3ZQF2C6FGYXTBDRMMMK3ANCNFSM4MFYLQYA .

montenegrina commented 4 years ago

Hello,

I tried running it like:

bcftools view -T mylist.txt gokind2.bcf -Ou -o filteredfile.bcf
[E::bcf_sr_regions_init] Could not parse the file mylist.txt, using the columns 1,2[,-1]
Failed to read the targets: mylist.txt

where mylist.txt is tab separated and looks like this:

20  33371323
12  73950313
1   216957281
5   174820027

Please advise

sk6-nibmg commented 4 months ago

Hii @montenegrina . How did you solve the error afterwards? I have encountered similar error and could not go further. Please share.

pd3 commented 3 months ago

Please share a small test case to for us verify what's going on. What you show looks correct on a cursory glance.