Hi all! Given a BAM, I want to plot the insert size of a read pair vs average base quality of bases in a read I've actually got the insert size data point by filtering my BAM using:
samtools view -f66 mybam.bam | cut -f9 | awk '{print sqrt($0^2)}' > isizes.txt # To prevent negatives
But now I have doubts in how to fetch the mean of quality of all bases in both reads of a read pair. Could yo please give me a clue or something? Thank you very much!
Other tools/scripts are also welcomed!
See FASTQ Phred33 average base quality score for some clarification on
average base quality
.Average base quality does not make a lot of sense in real world.