josiegleeson / BamSlam

Summarise and plot data from long-read ONT (direct RNA/cDNA) BAM files
MIT License
11 stars 4 forks source link

metric definitions request #4

Closed RichardCorbett closed 1 year ago

RichardCorbett commented 1 year ago

Hi folks, I was looking for a way to test some metrics for ONT RNA reads and found your tool. Bamslam is super useful, and I enjoy how easy it is to run.

I am reviewing results I got for my samples and before I share them with anyone I want to make sure I understand the meanings for some metrics.

In particular, I'm looking for the difference between "Median coverage fraction of transcripts (primary alignments)" and "Median coverage fraction of all unique transcripts". I suspect the former is just the median fraction any primary alignment captures of its matching cDNA. Across the protocols we are testing we see that some have higher values this than others (values from 0.2 to 0.6), and this aligns with our expectation. The "Median coverage fraction of all unique transcripts" however, seems to yield a similar value for each of our samples (values from 0.2 to 0.24) . Can you help me understand this latter metric?

thanks Richard

josiegleeson commented 1 year ago

Hi Richard,

Apologies for the delay in replying, I was on leave.

Yes, you're right in the understanding of the median coverage fraction of all transcripts. The second instance is sort of like taking the median of the medians per transcript.

So we calculate the coverage fractions for every read to its assigned transcript. I've then calculated the median coverage fraction for every transcript identified in a sample, so we get one value per transcript (written into the transcript_level_data.csv file). The reported value for the "median coverage fraction of all unique transcripts" is then the median of all of these median values. So it will be more similar between each sample likely because it smoothes the results in some way.

Hope this helps, feel free to let me know if you have some more questions.

Thanks, Josie.

RichardCorbett commented 1 year ago

This is great. Thanks @josiegleeson !