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?
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?
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).
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...
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.