From 8159ba49069475e507517d7b1cca48323041f39a Mon Sep 17 00:00:00 2001 From: SarahOuologuem Date: Tue, 13 Feb 2024 09:46:56 +0000 Subject: [PATCH 01/11] change matplotlib version --- panpipes/funcs/plotting.py | 5 ++--- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/panpipes/funcs/plotting.py b/panpipes/funcs/plotting.py index b5931be3..985832d8 100644 --- a/panpipes/funcs/plotting.py +++ b/panpipes/funcs/plotting.py @@ -310,9 +310,8 @@ def ridgeplot(adata, features, layer=None, splitplot=3, bandwidth=0.1): ax.yaxis.set_tick_params(labelleft=True) ax.set_yticks(np.arange(len(features_sub))) ax.set_yticklabels(features_sub) - for tick in ax.yaxis.get_major_ticks(): - tick.label.set_fontsize(10) - tick.label.set_verticalalignment("bottom") + ax.tick_params(axis='y', which='major', labelsize=10) + # tick.label.set_verticalalignment("bottom") fig.tight_layout() return fig, ax diff --git a/pyproject.toml b/pyproject.toml index e539d40b..bc902ee5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ dependencies = [ "jaxlib<=0.4.23", "leidenalg", "louvain", - "matplotlib<=3.7.3", + "matplotlib", "mofapy2", "mudata>=0.2.1", "muon", From ff15ac781bf2562a562b7750b6c4856085a36d12 Mon Sep 17 00:00:00 2001 From: SarahOuologuem Date: Tue, 13 Feb 2024 09:49:19 +0000 Subject: [PATCH 02/11] remove colons --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7488ce37..8c05b4c0 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ Panpipes is a set of computational workflows designed to automate multimodal single-cell and spatial transcriptomic analyses by incorporating widely-used Python-based tools to perform quality control, preprocessing, integration, clustering, and reference mapping at scale. Panpipes allows reliable and customisable analysis and evaluation of individual and integrated modalities, thereby empowering decision-making before downstream investigations. -**See our [documentation](https://panpipes-pipelines.readthedocs.io/en/latest/) and our [preprint](https://www.biorxiv.org/content/10.1101/2023.03.11.532085v2)**: +**See our [documentation](https://panpipes-pipelines.readthedocs.io/en/latest/) and our [preprint](https://www.biorxiv.org/content/10.1101/2023.03.11.532085v2)** -These workflows make use of [cgat-core](https://github.com/cgat-developers/cgat-core): +These workflows make use of [cgat-core](https://github.com/cgat-developers/cgat-core) Available workflows: From 24140cf1609618fc87990e9f3f524359c3ad0b5b Mon Sep 17 00:00:00 2001 From: SarahOuologuem Date: Tue, 13 Feb 2024 12:23:56 +0000 Subject: [PATCH 03/11] bug fix --- panpipes/panpipes/pipeline_preprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panpipes/panpipes/pipeline_preprocess.py b/panpipes/panpipes/pipeline_preprocess.py index 5f84cc5e..44bd9311 100644 --- a/panpipes/panpipes/pipeline_preprocess.py +++ b/panpipes/panpipes/pipeline_preprocess.py @@ -204,7 +204,7 @@ def prot_preprocess( log_file, scaled_file, ): if PARAMS['prot_solver'] == "default": cmd += " --pca_solver arpack" else: - cmd += " --pca_solver %(pca_solver)s" + cmd += " --pca_solver %(prot_solver)s" cmd += """ --run_pca True --n_pcs %(prot_n_pcs)s From d739487484621aa4ff336e0ae4c80a4401266604 Mon Sep 17 00:00:00 2001 From: SarahOuologuem Date: Thu, 15 Feb 2024 10:42:13 +0000 Subject: [PATCH 04/11] add cowplot install --- docs/install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install.md b/docs/install.md index e7366f05..49fed9c9 100644 --- a/docs/install.md +++ b/docs/install.md @@ -28,7 +28,7 @@ conda activate pipeline_env Let's first install the R packages ```bash -conda install -c conda-forge r-tidyverse r-optparse r-ggforce r-ggraph r-xtable r-hdf5r r-clustree +conda install -c conda-forge r-tidyverse r-optparse r-ggforce r-ggraph r-xtable r-hdf5r r-clustree r-cowplot ``` Then we can install panpipes: From 3bf1f778df98dd9e2c64fb65b69a7c15fbb8e8f5 Mon Sep 17 00:00:00 2001 From: SarahOuologuem Date: Thu, 15 Feb 2024 10:42:44 +0000 Subject: [PATCH 05/11] create figdir if not existing --- panpipes/python_scripts/plot_features_scatter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/panpipes/python_scripts/plot_features_scatter.py b/panpipes/python_scripts/plot_features_scatter.py index 9b70c46f..83a77246 100644 --- a/panpipes/python_scripts/plot_features_scatter.py +++ b/panpipes/python_scripts/plot_features_scatter.py @@ -41,7 +41,11 @@ L.info(args) -sc.settings.figdir = "./scatters/" +figdir = "./scatters/" +if not os.path.exists(figdir): + os.mkdir(figdir) + +sc.settings.figdir = figdir sc.set_figure_params(fontsize=12) @@ -49,7 +53,6 @@ layers = read_yaml(args.layers_dict) - df = pd.read_csv(args.scatters_csv) L.debug(df) From a10e2f5213c0d6b78c46214cc284bd50938e86ce Mon Sep 17 00:00:00 2001 From: SarahOuologuem Date: Mon, 26 Feb 2024 09:39:37 +0000 Subject: [PATCH 06/11] code fix --- panpipes/panpipes/pipeline_clustering.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panpipes/panpipes/pipeline_clustering.py b/panpipes/panpipes/pipeline_clustering.py index 99837875..690e7a28 100644 --- a/panpipes/panpipes/pipeline_clustering.py +++ b/panpipes/panpipes/pipeline_clustering.py @@ -338,8 +338,8 @@ def plot_marker_dotplots(marker_file, log_file, outfile, """ data_obj=PARAMS['sample_prefix'] + "_clustered.h5mu" # check there is a figures directory - if not os.path.exists(fig_path): - os.makedirs(fig_path) + #if not os.path.exists(fig_path): + # os.makedirs(fig_path) cmd = """ python %(py_path)s/plot_scanpy_markers.py \ --infile %(data_obj)s \ From 9ba83b745febc0ebaae479fc9abaee76bab29bff Mon Sep 17 00:00:00 2001 From: SarahOuologuem Date: Mon, 26 Feb 2024 09:53:08 +0000 Subject: [PATCH 07/11] update python version --- docs/install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install.md b/docs/install.md index 49fed9c9..38145f18 100644 --- a/docs/install.md +++ b/docs/install.md @@ -16,7 +16,7 @@ conda config --add channels conda-forge conda config --set channel_priority strict # you should remove the strict priority afterwards! conda search r-base -conda create --name pipeline_env python=3.9 r-base=4.3.0 +conda create --name pipeline_env python=3.11 r-base=4.3.0 ``` now we activate the environment From 8ec715a924f16caeb0e97f71bdc5d860b891d342 Mon Sep 17 00:00:00 2001 From: SarahOuologuem Date: Mon, 26 Feb 2024 12:11:38 +0000 Subject: [PATCH 08/11] add check --- panpipes/python_scripts/run_scanpyQC_spatial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panpipes/python_scripts/run_scanpyQC_spatial.py b/panpipes/python_scripts/run_scanpyQC_spatial.py index f12a85f4..a7067d54 100644 --- a/panpipes/python_scripts/run_scanpyQC_spatial.py +++ b/panpipes/python_scripts/run_scanpyQC_spatial.py @@ -129,7 +129,7 @@ percent_top = [x for x in percent_top if x <= spatial.n_vars] sc.pp.calculate_qc_metrics(spatial, qc_vars=qc_vars, percent_top=percent_top, inplace=True) -if args.spatial_filetype == "vizgen": +if (args.spatial_filetype == "vizgen") and ("blank_genes" in spatial.obsm): spatial.obsm["blank_genes"].to_numpy().sum() / spatial.var["total_counts"].sum() * 100 # Calculate cc scores From 7f48c37ec29be3ab480de192029b6c2538fdb0a2 Mon Sep 17 00:00:00 2001 From: SarahOuologuem Date: Sat, 2 Mar 2024 12:15:54 +0000 Subject: [PATCH 09/11] python 3.10 --- docs/install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install.md b/docs/install.md index 38145f18..e2b1664c 100644 --- a/docs/install.md +++ b/docs/install.md @@ -16,7 +16,7 @@ conda config --add channels conda-forge conda config --set channel_priority strict # you should remove the strict priority afterwards! conda search r-base -conda create --name pipeline_env python=3.11 r-base=4.3.0 +conda create --name pipeline_env python=3.10 r-base=4.3.0 ``` now we activate the environment From 405f40ff96081214b6be59d295158441eb34d268 Mon Sep 17 00:00:00 2001 From: SarahOuologuem Date: Sat, 2 Mar 2024 12:31:46 +0000 Subject: [PATCH 10/11] add cowplot --- pipeline_env.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/pipeline_env.yaml b/pipeline_env.yaml index fcea02c4..a3b57072 100644 --- a/pipeline_env.yaml +++ b/pipeline_env.yaml @@ -12,6 +12,7 @@ dependencies: - r-optparse - r-tidyverse - r-xtable + - r-cowplot - pip - pip: - pytest From 6437200ce630a2dbceb37a861e8d6291325d7e26 Mon Sep 17 00:00:00 2001 From: SarahOuologuem Date: Tue, 5 Mar 2024 09:27:51 +0000 Subject: [PATCH 11/11] re-add check --- panpipes/panpipes/pipeline_clustering.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panpipes/panpipes/pipeline_clustering.py b/panpipes/panpipes/pipeline_clustering.py index 690e7a28..99837875 100644 --- a/panpipes/panpipes/pipeline_clustering.py +++ b/panpipes/panpipes/pipeline_clustering.py @@ -338,8 +338,8 @@ def plot_marker_dotplots(marker_file, log_file, outfile, """ data_obj=PARAMS['sample_prefix'] + "_clustered.h5mu" # check there is a figures directory - #if not os.path.exists(fig_path): - # os.makedirs(fig_path) + if not os.path.exists(fig_path): + os.makedirs(fig_path) cmd = """ python %(py_path)s/plot_scanpy_markers.py \ --infile %(data_obj)s \