# HG changeset patch # User goeckslab # Date 1722363655 0 # Node ID 2983eb1d73626c93a791439ba50e3a7ad0c1a834 # Parent 472780baf150668959f078171855619ed4aefdf7 planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/scimap commit c39cea5ae2ebf61b3d51d687fd9d2930c907b72d diff -r 472780baf150 -r 2983eb1d7362 main_macros.xml --- a/main_macros.xml Wed Jun 26 15:26:49 2024 +0000 +++ b/main_macros.xml Tue Jul 30 18:20:55 2024 +0000 @@ -1,6 +1,6 @@ 2.1.0 - 1 + 2 20.01 diff -r 472780baf150 -r 2983eb1d7362 scimap_plotting.py --- a/scimap_plotting.py Wed Jun 26 15:26:49 2024 +0000 +++ b/scimap_plotting.py Tue Jul 30 18:20:55 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)