diff --git a/modules/local/adata/extend/templates/extend.py b/modules/local/adata/extend/templates/extend.py index d01ec0f1..4ebb339f 100644 --- a/modules/local/adata/extend/templates/extend.py +++ b/modules/local/adata/extend/templates/extend.py @@ -38,6 +38,10 @@ def load_pickle_or_csv(path): df = load_pickle_or_csv(path).reindex(adata.var_names) adata.var = pd.concat([adata.var, df], axis=1) +# Ensure 'highly_variable' is boolean if present +if "highly_variable" in adata.var: + adata.var["highly_variable"] = adata.var["highly_variable"].astype(bool) + for path in obsm_paths: df = pd.read_pickle(path).reindex(adata.obs_names) adata.obsm[simple_name(path)] = np.float32(df.to_numpy()) diff --git a/modules/local/adata/readrds/environment.yml b/modules/local/adata/readrds/environment.yml index d2e3a91e..e3b873c8 100644 --- a/modules/local/adata/readrds/environment.yml +++ b/modules/local/adata/readrds/environment.yml @@ -6,3 +6,5 @@ dependencies: - bioconda::anndata2ri=1.3.2 - conda-forge::anndata=0.11.1 - conda-forge::r-seurat=5.1.0 + - bioconda::bioconductor-singlecellexperiment=1.24.0 + - conda-forge::rpy2=3.5.11 diff --git a/modules/local/adata/readrds/main.nf b/modules/local/adata/readrds/main.nf index 12b6f740..9c2a9fbe 100644 --- a/modules/local/adata/readrds/main.nf +++ b/modules/local/adata/readrds/main.nf @@ -4,8 +4,8 @@ process ADATA_READRDS { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'oras://community.wave.seqera.io/library/anndata2ri_bioconductor-singlecellexperiment_anndata_r-seurat:c4b75a61a89ec006': - 'community.wave.seqera.io/library/anndata2ri_bioconductor-singlecellexperiment_anndata_r-seurat:5fae42aabf7a1c5f' }" + 'oras://community.wave.seqera.io/library/anndata2ri_bioconductor-singlecellexperiment_anndata_r-seurat_rpy2:5e5acc8a27b2f90a': + 'community.wave.seqera.io/library/anndata2ri_bioconductor-singlecellexperiment_anndata_r-seurat_rpy2:5e785d9c16504ed6' }" input: tuple val(meta), path(rds) diff --git a/modules/local/adata/readrds/templates/readrds.py b/modules/local/adata/readrds/templates/readrds.py index 04180471..47344c26 100644 --- a/modules/local/adata/readrds/templates/readrds.py +++ b/modules/local/adata/readrds/templates/readrds.py @@ -4,6 +4,8 @@ os.environ["TMPDIR"] = "." +import importlib.metadata + import anndata as ad import anndata2ri import rpy2 @@ -53,10 +55,10 @@ def format_yaml_like(data: dict, indent: int = 0) -> str: adata.write_h5ad("${prefix}.h5ad") versions = { - "${task.process}": { + "NFCORE_SCDOWNSTREAM:SCDOWNSTREAM:LOAD_H5AD:ADATA_READRDS": { "anndata": ad.__version__, "anndata2ri": anndata2ri.__version__, - "rpy2": rpy2.__version__, + "rpy2": importlib.metadata.version("rpy2"), "pandas": pd.__version__, "seurat": seurat.__version__ } diff --git a/modules/local/adata/upsetgenes/templates/upsetplot.py b/modules/local/adata/upsetgenes/templates/upsetplot.py index 5528e68d..8e2524e2 100644 --- a/modules/local/adata/upsetgenes/templates/upsetplot.py +++ b/modules/local/adata/upsetgenes/templates/upsetplot.py @@ -1,4 +1,4 @@ -#!/opt/conda/bin/python +#!/usr/bin/env python import os import platform diff --git a/modules/local/doublet_detection/doublet_removal/environment.yml b/modules/local/doublet_detection/doublet_removal/environment.yml index 193d2281..2abbc38c 100644 --- a/modules/local/doublet_detection/doublet_removal/environment.yml +++ b/modules/local/doublet_detection/doublet_removal/environment.yml @@ -3,5 +3,10 @@ channels: - conda-forge - bioconda dependencies: - - conda-forge::anndata=0.11.1 - - conda-forge::upsetplot=0.9.0 + - python=3.11.9 + - numpy=2.0.2 + - scipy=1.14.1 + - pandas=2.2.2 + - matplotlib=3.8.4 + - anndata=0.11.1 + - upsetplot=0.9.0 diff --git a/modules/local/doublet_detection/doublet_removal/main.nf b/modules/local/doublet_detection/doublet_removal/main.nf index c02fa190..23912fed 100644 --- a/modules/local/doublet_detection/doublet_removal/main.nf +++ b/modules/local/doublet_detection/doublet_removal/main.nf @@ -4,8 +4,8 @@ process DOUBLET_REMOVAL { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'oras://community.wave.seqera.io/library/anndata_upsetplot:922f36ea0326a629': - 'community.wave.seqera.io/library/anndata_upsetplot:784e0f450da10178' }" + 'oras://community.wave.seqera.io/library/anndata_matplotlib_numpy_pandas_pruned:a603920d55ea7f32': + 'community.wave.seqera.io/library/anndata_matplotlib_numpy_pandas_pruned:9674070abcd72c6f' }" input: tuple val(meta), path(h5ad), path(predictions) diff --git a/modules/local/doublet_detection/doublet_removal/templates/doublet_removal.py b/modules/local/doublet_detection/doublet_removal/templates/doublet_removal.py index cbcfc2df..157d2a0f 100644 --- a/modules/local/doublet_detection/doublet_removal/templates/doublet_removal.py +++ b/modules/local/doublet_detection/doublet_removal/templates/doublet_removal.py @@ -1,4 +1,4 @@ -#!/opt/conda/bin/python +#!/usr/bin/env python3 import os import platform