walaj / bxtools

Tools for analyzing 10X Genomics data
MIT License
42 stars 10 forks source link

Split by HP tag including unphased reads? [Feature request] #26

Closed lkhilton closed 6 years ago

lkhilton commented 6 years ago

For the purposes of easily viewing coverage across the haplotypes, I split my longranger bams by haplotype. bxtools can create bam files for phased reads - is it possible to also output the unphased reads when -t HP is used? Something like an option to output to a single BAM file all the reads that don't match the specified tag would be great.

walaj commented 6 years ago

Do you mean reads with no HP tag? I can include that in the next update. In the meantime, a two-pass solution using grep + samtools to get these would also work.

lkhilton commented 6 years ago

Yes, that's what I mean - reads with no HP tag. I'm currently using the samtools + grep solution, but bxtools is definitely faster.

walaj commented 6 years ago

Thank you for your patience with this.

I just pushed an update to bxtools split that allows for a -e flag to output a BAM with the reads without the specified tag.

walaj commented 6 years ago

Will close for now, but re-open if you have issues. On my tests this works well.

jahanshah commented 3 years ago

Thank you for your fantastic tool. Unfortunately, bxtools split -e doesn't work for me!