bxtools icon indicating copy to clipboard operation
bxtools copied to clipboard

SAM to FASTQ functionality

Open JustinChu opened this issue 8 years ago • 3 comments

Say you are only given a longranger processed BAM file that you would like to use for other purposes. Many tools cannot use BAM format directly. It could be useful to support a fast SAM/BAM conversion to fastq that preserves BX tags, RX tags and even MI tags in the header.

This is pretty easy to script, but I think this could be useful if written efficiently. It would also present the opportunity to encourage some sort of standardized fastq header format for chromium data.

JustinChu avatar May 11 '17 22:05 JustinChu

Is there a preferred format for this header? This would be easy to incorporate, just give me the format.

walaj avatar May 12 '17 19:05 walaj

Ideally, it would be similar to whatever longranger basic provides, but I haven't figured out where the RX tags are stored in the FASTQ file generated.

Maybe something like this:

@ReadID BX:Z:AAACACCAGAAACCCG-1 RX:Z:AAACACCAGAAACCCG MI:i:22359430

Make sure you make it look at the flag to reverse it back it the alignment has reversed the read.

JustinChu avatar Jun 07 '17 18:06 JustinChu

You can use samtools fastq -TBX for this purpose.

sjackman avatar Nov 02 '18 04:11 sjackman