wwood / CoverM

Read coverage calculator for metagenomics
GNU General Public License v3.0
297 stars 30 forks source link

How to output bam file after trimmed_mean function? #206

Open Harper19 opened 6 months ago

Harper19 commented 6 months ago

Hello, I would like to check the coverage difference before and after trimmed_mean. Currently I am thinking to create depth table and plots using old vs new bamfiles to check.

However, cannot output the trimmed bam file. Is there anyway to do it? Or is there any suggestion to do it based on coverm?

Thanks for your attention and time!

Best, Harper

wwood commented 6 months ago

Hi,

I'm not sure this is possible because it isn't quite specified properly.

Trimmed mean is calculated by getting the coverage of each column, and then removing coverage numbers at the 10 and 90% values. So there might be multiple positions with the same coverage, where some are inside 10-90% and some are outside.

If you are interested, I'd suggest using the coverage_histogram output, manually calculating the 10th and 90th percentiles, and then interrogating your BAM file based on that.

HTH, ben

Harper19 commented 6 months ago

Thank you so much. I will try to do it. Best, Harper