When you convert a BAM back into a FastQ do you get the original Fastq?
2
0
Entering edit mode
7 weeks ago
louis-gil • 0

I've always had this question. When you convert a BAM back into a FastQ do you get the original Fastq? Does the BAM retain unannotated regions?

bam FastQ • 333 views
1
Entering edit mode
7 weeks ago
GenoMax 127k

If the aligner writes reads that do not align by default to output (or you as the user chooses the right option for aligner to do so) then you will be able to recover the original fastq data (by following samtools collate | samtools fastq and choosing primary alignments).

The order of the restored reads may or may not be identical to original file but all the data should be there.

Disclaimer: Assuming reads were directly mapped to get the BAM file (without any other pre- or post- processing, see Pierre Lindenbaum 's answer).

0
Entering edit mode
7 weeks ago

When you convert a BAM back into a FastQ do you get the original Fastq?

no, if tools like ApplyBQSR ( https://gatk.broadinstitute.org/hc/en-us/articles/360036856671-ApplyBQSR ), adapter trimmers , etc... were used...