From 435488cc1bd1a83f1ac4499bc91c4b972929fd17 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Wed, 4 Sep 2024 16:43:32 +0200 Subject: [PATCH] revert changes to the mnnpy component since it requires python:3.8 --- .../methods/mnnpy/config.vsh.yaml | 4 +--- .../batch_integration/methods/mnnpy/script.py | 16 ++++------------ 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/tasks/batch_integration/methods/mnnpy/config.vsh.yaml b/src/tasks/batch_integration/methods/mnnpy/config.vsh.yaml index 649672dac1..2c5075534b 100644 --- a/src/tasks/batch_integration/methods/mnnpy/config.vsh.yaml +++ b/src/tasks/batch_integration/methods/mnnpy/config.vsh.yaml @@ -30,8 +30,6 @@ functionality: resources: - type: python_script path: script.py - - type: python_script - path: /src/common/helper_functions/read_anndata_partial.py platforms: # Due to a [ gcc-8 ] dependency in the mnnpy package, we need to use a python:3.8 image - type: docker @@ -51,4 +49,4 @@ platforms: - chriscainx/mnnpy - type: nextflow directives: - label: [midtime, lowcpu, lowmem] + label: [ midtime, lowcpu, lowmem ] diff --git a/src/tasks/batch_integration/methods/mnnpy/script.py b/src/tasks/batch_integration/methods/mnnpy/script.py index 56d5cce3a2..1551573650 100644 --- a/src/tasks/batch_integration/methods/mnnpy/script.py +++ b/src/tasks/batch_integration/methods/mnnpy/script.py @@ -1,4 +1,3 @@ -import sys import anndata as ad import mnnpy @@ -14,18 +13,11 @@ } ## VIASH END -sys.path.append(meta["resources_dir"]) -from read_anndata_partial import read_anndata - - print('Read input', flush=True) -adata = read_anndata( - par['input'], - X='layers/normalized', - obs='obs', - var='var', - uns='uns' -) +adata = ad.read_h5ad(par['input']) +adata.X = adata.layers['normalized'] +del adata.layers['normalized'] +del adata.layers['counts'] if par['n_hvg']: print(f"Select top {par['n_hvg']} high variable genes", flush=True)