From 975e0f7f1a44ebb870b0a37532d20ad7730571fa Mon Sep 17 00:00:00 2001 From: farchaab Date: Wed, 9 Oct 2024 15:25:40 +0200 Subject: [PATCH] fixed coverage values in tax_abundance --- mess/workflow/scripts/calculate_cov.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mess/workflow/scripts/calculate_cov.py b/mess/workflow/scripts/calculate_cov.py index 44bd867..31e3209 100644 --- a/mess/workflow/scripts/calculate_cov.py +++ b/mess/workflow/scripts/calculate_cov.py @@ -93,7 +93,7 @@ def get_even_dist(table): df["tax_abundance"] = df["proportion"] / df["count"] df["genome_bases"] = df["total_sequence_length"] * df["tax_abundance"] df["sum_genome_bases"] = df.groupby("samplename")["genome_bases"].transform("sum") - df["cov_obtained"] = bases / (df["sum_genome_bases"] * p) + df["cov_obtained"] = bases / df["sum_genome_bases"] df["cov_sim"] = df["tax_abundance"] * df["cov_obtained"] df["sum_cov"] = df.groupby("samplename")["cov_sim"].transform("sum") df["bases"] = df["cov_sim"] * df["total_sequence_length"] @@ -117,7 +117,7 @@ def get_even_dist(table): df["sum_genome_bases"] = df.groupby("samplename")["genome_bases"].transform( "sum" ) - df["cov_obtained"] = bases / (df["sum_genome_bases"] * p) + df["cov_obtained"] = bases / df["sum_genome_bases"] df["cov_sim"] = df["tax_abundance"] * df["cov_obtained"] df["sum_cov"] = df.groupby("samplename")["cov_sim"].transform("sum") df["bases"] = df["cov_sim"] * df["total_sequence_length"] @@ -133,7 +133,7 @@ def get_even_dist(table): df["tax_abundance"] = df["cov_sim"] / df["sum_cov"] if "reads" in entry_df.columns: - df["bases"] = df["reads"] * (snakemake.params.read_len * p) + df["bases"] = df["reads"] * snakemake.params.read_len * p df["sum_bases"] = df.groupby("samplename")["bases"].transform("sum") df["seq_abundance"] = df["bases"] / df["sum_bases"] df["cov_sim"] = df["bases"] / df["total_sequence_length"]