diff --git a/libcodonusage/__init__.py b/libcodonusage/__init__.py index fcfc26c8e6623c143dc39989e989dca01b4c9bc7..bcdaab8a7bd07f11e692a11570d5585337cc3302 100644 --- a/libcodonusage/__init__.py +++ b/libcodonusage/__init__.py @@ -1,6 +1,6 @@ __copyright__ = "Copyright (C) 2022-2023 Blaise Li" __licence__ = "GNU GPLv3" -__version__ = "0.27.3" +__version__ = "0.27.4" from .libcodonusage import ( aa2colour, aa_usage, diff --git a/libcodonusage/libcodonusage.py b/libcodonusage/libcodonusage.py index cf50fbf9ffe6ff79eadae0e6b4980a3a3287d0c1..2408e4a5282429240f3e83f776c118729e30bdcc 100644 --- a/libcodonusage/libcodonusage.py +++ b/libcodonusage/libcodonusage.py @@ -541,7 +541,7 @@ def check_aa_codon_columns(table): def compute_rscu(codon_proportions_by_aa): """ - Compute Relative Syninymous Codon Usage from proportions in genes. + Compute Relative Synonymous Codon Usage from proportions in genes. *codon_proportions_by_aa* should be a pandas DataFrame where rows correspond to genes, and columns to codons. It contains @@ -641,6 +641,12 @@ for that amino-acid. (This corresponds to R3 in {SUZUKI_LINK}) """) rscu = compute_rscu(codon_proportions) + render_md(f""" +We will also compute R4 ({SUZUKI_LINK}) by computing codon counts relative +to the maxium across synonymous codons of the counts for that amino-acid. +""") + r4_table = codon_counts.div( + codon_counts.T.groupby("aa").max().T) if ref_filter_dict is None: counts_for_global = codon_counts else: @@ -688,6 +694,7 @@ across genes) so that they are more comparable between codons. "biases": standardized_codon_usage_biases, "proportions": codon_proportions, "rscu": rscu, + "r4_table": r4_table, "global_proportions": global_proportions} return standardized_codon_usage_biases