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
663 stars 240 forks source link

Pipe into bcftools view with region specification #2269

Closed gevro closed 1 month ago

gevro commented 1 month ago

Hi, With bcftools 1.20, it seems that piping into bcftools view doesn't work if the view function is also run with a region specified. It causes bcftools view to think that the region is the input file rather than the piped in data.

gevro commented 1 month ago

Actually, nevermind, I think the issue is that piping into bcftools view means that the piped in VCF does not yet have an index, which then prevents the downstream view command from having an index by which to retrieve the region. Not sure what a work-around could be for this, probably no way around this.

pd3 commented 3 weeks ago

You can use the -t/-T options. While -r/-R use the index to jump regions, -t/-T go through the entire stream and drop sites outside the regions.