This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to include original base quality (OQ) from FASTQ file into existing bam file

Hello,

I need to append the base quality of fastq file into my existing bam file which does not contain OQ.

One option I see making bam to sam and flattening the fastq 4 lines as one-liner to get the matching quality for the aligned reads, is there any parameters in samtools or any other tools readily available to do this?

The bam is generated by Parabricks germline pipeline. Ultimately I need to convert the bam to cram with OQ.

Thanks in advance.

alignment

Has the BAM file been produced from this fastq file? If so the base quality should be in there, in column 11 of the SAM file. Can you show an example of that file like samtools view your.bam | head?

1 answer

It's bqsr bam, the original quality in the bam overwritten by bqsr. I'm planning to rerun the piepline in two steps. first, generate the bam and duplicate the quality column one with OQ flag then apply bqsr, in that way I could preserve the OQ also get the bqsr quality. Thanks

Log in to answer this question.