DaehwanKimLab / hisat2

Graph-based alignment (Hierarchical Graph FM index)
GNU General Public License v3.0
473 stars 116 forks source link

Feature Request - Output hisat-3n-table count as a "bed format" or "bed-like" format #368

Open aleighbrown opened 2 years ago

aleighbrown commented 2 years ago

Hello,

Would it be possible to change the output format on the hisat-3n-table to be sort of a fake bed format?

For my own purposes I've converted them to a sorta bedlike format so that I can use the excellent tabix tool to do rapid querying with a bed file like so

tabix myconversion_fake_bed.conversion.tsv.fake.bed.gz \
-R my_regions.bed > myconversions_in_these_region.tsv

It's easy enough to do afterwards, but maybe more useful for downstream analysis if it's directly output that way?

Otherwise this is what I've been doing to convince tabix I'm using a bed format

awk 'BEGIN { FS="\t"; OFS="\t" } { $2=$2 "\t" $2 } 1' myconversion.conversion.tsv > myconversion_fake_bed.conversion.tsv.fake.bed

bgzip myconversion_fake_bed.conversion.tsv.fake.bed

tabix -p bed -S 1 myconversion_fake_bed.conversion.tsv.fake.bed.gz

Thank you!