Repository 'scimap_mcmicro_to_anndata'
hg clone https://toolshed.g2.bx.psu.edu/repos/goeckslab/scimap_mcmicro_to_anndata

Changeset 4:49c178651194 (2024-07-30)
Previous changeset 3:8c55377d7f06 (2024-06-26)
Commit message:
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/scimap commit c39cea5ae2ebf61b3d51d687fd9d2930c907b72d
modified:
main_macros.xml
scimap_plotting.py
b
diff -r 8c55377d7f06 -r 49c178651194 main_macros.xml
--- a/main_macros.xml Wed Jun 26 15:27:13 2024 +0000
+++ b/main_macros.xml Tue Jul 30 18:20:49 2024 +0000
b
@@ -1,6 +1,6 @@
 <macros>
     <token name="@TOOL_VERSION@">2.1.0</token>
-    <token name="@VERSION_SUFFIX@">1</token>
+    <token name="@VERSION_SUFFIX@">2</token>
     <token name="@PROFILE@">20.01</token>
 
     <xml name="scimap_requirements">
b
diff -r 8c55377d7f06 -r 49c178651194 scimap_plotting.py
--- a/scimap_plotting.py Wed Jun 26 15:27:13 2024 +0000
+++ b/scimap_plotting.py Tue Jul 30 18:20:49 2024 +0000
[
@@ -3,7 +3,7 @@
 import os
 import warnings
 
-import matplotlib.pylab as plt
+import matplotlib.pyplot as plt
 import numpy as np
 import scimap as sm
 import seaborn as sns
@@ -37,9 +37,11 @@
 
         # parse list text arguments
         for o in options.copy():
-            opt_list = options.pop(o)
-            if opt_list:
-                options[o] = [x.strip() for x in opt_list.split(',')]
+            opt = options.pop(o)
+            if o == 'matplotlib_cmap':
+                matplotlib_cmap = opt
+            elif opt != "":
+                options[o] = [x.strip() for x in opt.split(',')]
 
         # add base args into options dict to pass to tool
         options['x_axis'] = params['analyses']['x_axis']
@@ -50,15 +52,6 @@
 
         df = sm.pl.stacked_barplot(adata, **options)
 
-        # Pick cmap to use
-        num_phenotypes = len(df.columns) - 1
-        if num_phenotypes <= 9:
-            matplotlib_cmap = "Set1"
-        elif num_phenotypes > 9 and num_phenotypes <= 20:
-            matplotlib_cmap = plt.cm.tab20
-        else:
-            matplotlib_cmap = plt.cm.gist_ncar
-
         # Plotting
         sns.set_theme(style="white")
         ax = df.plot.bar(stacked=True, cmap=matplotlib_cmap)