From caaa9498c123b15761d181ec3dc10e52fe5c64e5 Mon Sep 17 00:00:00 2001
From: Marie Anselmet <marie.anselmet@pasteur.fr>
Date: Thu, 19 Oct 2023 17:05:13 +0200
Subject: [PATCH] Plot more components in PCA

---
 build/lib/libcodonusage/libcodonusage.py | 8 ++++++--
 libcodonusage/libcodonusage.py           | 4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/build/lib/libcodonusage/libcodonusage.py b/build/lib/libcodonusage/libcodonusage.py
index 430c57e..706b30e 100644
--- a/build/lib/libcodonusage/libcodonusage.py
+++ b/build/lib/libcodonusage/libcodonusage.py
@@ -470,10 +470,14 @@ To compute codon proportions, we can divide each line by its sum,
 or, equivalently (and hopefully more efficiently), normalize the data
 using the "l1" norm (which, for positive-only values amounts to the sum).
 """)
+    print("codon_proportions1")
+    print(codon_counts)
     codon_proportions = pd.DataFrame(
         normalize(codon_counts, norm="l1"),
         index=codon_counts.index,
         columns=codon_counts.columns)
+    print("codon_proportions2")
+    print(codon_proportions)
     # Doesn't seem to be working:
     # codon_proportions.style.hide(axis="index")
     if verbose:
@@ -953,10 +957,10 @@ def codon_usage_pca(
         (fig, axes) = plt.subplots(1, 2, figsize=(16, 8))
         sns.scatterplot(
             data=transformed_data,
-            x=0, y=1, hue=hue, marker=".", ax=axes[0,0])
+            x=0, y=1, hue=hue, marker=".", ax=axes[0])
         sns.scatterplot(
             data=transformed_data,
-            x=2, y=3, hue=hue, marker=".", ax=axes[0,1])
+            x=2, y=3, hue=hue, marker=".", ax=axes[1])
 
     if figs_dir is not None and formats is not None:
         for ext in formats:
diff --git a/libcodonusage/libcodonusage.py b/libcodonusage/libcodonusage.py
index 430c57e..c82cea3 100644
--- a/libcodonusage/libcodonusage.py
+++ b/libcodonusage/libcodonusage.py
@@ -953,10 +953,10 @@ def codon_usage_pca(
         (fig, axes) = plt.subplots(1, 2, figsize=(16, 8))
         sns.scatterplot(
             data=transformed_data,
-            x=0, y=1, hue=hue, marker=".", ax=axes[0,0])
+            x=0, y=1, hue=hue, marker=".", ax=axes[0])
         sns.scatterplot(
             data=transformed_data,
-            x=2, y=3, hue=hue, marker=".", ax=axes[0,1])
+            x=2, y=3, hue=hue, marker=".", ax=axes[1])
 
     if figs_dir is not None and formats is not None:
         for ext in formats:
-- 
GitLab