10XGenomics / bamtofastq

Convert 10x BAM files to the original FASTQs compatible with 10x pipelines
MIT License
59 stars 6 forks source link

Handle a BAM file of mixed single and paired reads #37

Closed sjackman closed 2 years ago

sjackman commented 2 years ago

Support a BAM file with a mixture of paired-end and single-end reads, such as paired-end 5' GEX and CMO multiplexing.

Use the same R1 formatter for single-end records as for paired-end, and replace R2 with a single N.

This fix assumes that a mixture of single-end and paired-end reads in the same BAM file use a largely compatible chemistry, which seems like a safe bet? If there are cases (mixtures of libraries) where this fix does not work, we can add a check and error out for those cases.

A more general solution of per-read-group 10x_bam_to_fastq headers as Pat suggested may be needed (if not now one day) to support mixtures of library types with different read structures.

sjackman commented 2 years ago

Superseded by