samtools icon indicating copy to clipboard operation
samtools copied to clipboard

convert bam to fastq for each read group in bam file

Open xinhuang420 opened this issue 6 years ago • 5 comments

Hi,

when I use samtools to convert bam to fastq, I could only got 2 fastq files.

l want to create pair of FASTQ files for each read group in my BAM file. Because samples are multiplexed across many different flowcells and lanes. I think it is probable that many FASTQ pairs will be generated for each sample.

Thank you very much!

xinhuang420 avatar Mar 27 '19 15:03 xinhuang420

We also need this to allow us to drop our dependency on biobambam2.

keiranmraine avatar Apr 04 '19 10:04 keiranmraine

pile samtools split -f %!

y9c avatar Apr 04 '19 19:04 y9c

@yech1990 that gives you an variable number of output files that still need to be converted to fastq (+/- compression). biobambam2 (now archived) has a bamtofastq program that generates all fastq files in a single pass/write.

keiranmraine avatar Apr 05 '19 15:04 keiranmraine

biobambam2 (now archived)

@keiranmraine: Moved, not archived. See https://twitter.com/jomarnz/status/1105509947083759617 and the not-very-prominent note at the top of the README in the GitHub repo.

jmarshall avatar Apr 05 '19 15:04 jmarshall