Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qualimap: BamQC: add percentage on target #2020

Merged
merged 9 commits into from
Sep 14, 2023
12 changes: 11 additions & 1 deletion multiqc/modules/qualimap/QM_BamQC.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ def parse_genome_results(self, f):
self.general_stats_data[s_name]["mean_coverage"] = d["mean_coverage"]
self.general_stats_data[s_name]["regions_size"] = d["regions_size"]
self.general_stats_data[s_name]["regions_mapped_reads"] = d["regions_mapped_reads"]
d["percentage_aligned_on_target"] = (d["regions_mapped_reads"] / d["mapped_reads"]) * 100
FerriolCalvet marked this conversation as resolved.
Show resolved Hide resolved
self.general_stats_data[s_name]["percentage_aligned_on_target"] = d["percentage_aligned_on_target"]
FerriolCalvet marked this conversation as resolved.
Show resolved Hide resolved
except KeyError:
pass

Expand Down Expand Up @@ -622,12 +624,20 @@ def general_stats_headers(self):
"hidden": True,
}
self.general_stats_headers["regions_mapped_reads"] = {
"title": "{} Aligned".format(config.read_count_prefix),
"title": "{} On target".format(config.read_count_prefix),
"description": "Number of mapped reads on target region ({})".format(config.read_count_desc),
"scale": "RdYlGn",
"shared_key": "read_count",
"hidden": True,
}
self.general_stats_headers["percentage_aligned_on_target"] = {
FerriolCalvet marked this conversation as resolved.
Show resolved Hide resolved
"title": "% On target",
"description": "% mapped reads on target region",
"max": 100,
"min": 0,
"suffix": "%",
"scale": "YlGn",
}


def _calculate_bases_within_thresholds(bases_by_depth, total_size, depth_thresholds):
Expand Down