jgi_summarize_bam_contig_depths to calculate the genome-wide average coverage

Issue #111 resolved
Former user created an issue

Dear Rob,

May I consult you one question?

I would like to use jgi_summarize_bam_contig_depths to calculate the average coverage of my metagenome-assembled genomes (MAGs).

There are multiple contigs for each MAG; when I used jgi_summarize_bam_contig_depths, I obtained the values for each contig separately. I attached the output file here -- there are six contigs in this MAG, so I got six coverage estimates.

However, my purpose is to obtain the average coverage for the whole MAG (combine all six contigs), and use this value to represent its relative abundance. Is there a way that jgi_summarize_bam_contig_depths could generate this value for me directly?

Many thanks for your help! Sincerely appreciate it in advance!

With best regards, Nathan

Comments (2)

  1. Rob Egan

    You can take the weighted average of the set of contigs for each MAG. Maybe Import the depths.txt to a spreadsheet and sum (length*avg_coverage) / sum(length)

    Alternatively you can make MAG quasi-scaffolds, by joining each sequence of a MAG with 1000 or more N’s in the fasta file, aligning the reads to this and then calculating the coverage to the MAG that way.

  2. Log in to comment