Skip to content

Commit cf6d929

Browse files
DriesSchaumontrcannood
authored andcommitted
Re-enable from_h5mu_to_seurat component (#616)
* Re-enable from_h5mu_to_seurat component * Add PR number * update test * add print statements * change input file --------- Co-authored-by: Robrecht Cannoodt <rcannood@gmail.com>
1 parent 5cc62bf commit cf6d929

File tree

6 files changed

+25
-13
lines changed

6 files changed

+25
-13
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
* `rna_multisample` workflow: added `--modality` argument (PR #607).
2020

21+
* Re-enable `convert/from_h5mu_to_seurat` component (PR #616).
22+
2123
## MINOR CHANGES
2224

2325
* Refactored `rna_multisample` pipeline to use `fromState` and `toState` functionality (PR #607).

src/base/requirements/anndata.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
packages:
3+
- anndata~=0.9.1
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
1+
__merge__: [/src/base/requirements/anndata.yaml, .]
22
packages:
33
- mudata~=0.2.3
4-
- anndata~=0.9.1
54
- pandas!=2.1.2

src/convert/from_h5mu_to_seurat/config.vsh.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
functionality:
22
name: "from_h5mu_to_seurat"
3-
# MuDataSeurat is currently broken -- https://github.com/PMBio/MuDataSeurat/issues/9
4-
status: disabled
53
namespace: "convert"
64
description: |
75
Converts an h5mu file into a Seurat file.
@@ -51,9 +49,7 @@ platforms:
5149
- python3-pip
5250
- python-is-python3
5351
- type: python
54-
__merge__: [/src/base/requirements/scanpy.yaml, .]
55-
packages:
56-
- anndata~=0.9.1
52+
__merge__: [/src/base/requirements/scanpy.yaml, /src/base/requirements/anndata.yaml, .]
5753
- type: r
5854
cran: [ anndata, hdf5r, testthat ]
5955
- type: r

src/convert/from_h5mu_to_seurat/run_test.R

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
11
library(testthat, warn.conflicts = FALSE)
22

3-
cat("Checking whether output is correct\n")
3+
## VIASH START
4+
meta <- list(
5+
executable = "target/docker/convert/from_h5mu_to_seurat/from_h5mu_to_seurat",
6+
resources_dir = "resources_test",
7+
functionality_name = "from_h5mu_to_seurat"
8+
)
9+
## VIASH END
10+
11+
cat("> Checking whether output is correct\n")
412

5-
# TODO: this should also work for ums and mms, but it doesn't.
6-
in_h5mu <- paste0(meta[["resources_dir"]], "/pbmc_1k_protein_v3/pbmc_1k_protein_v3_uss.h5mu")
13+
in_h5mu <- paste0(meta[["resources_dir"]], "/pbmc_1k_protein_v3/pbmc_1k_protein_v3_mms.h5mu")
714
out_rds <- "output.rds"
815

916
cat("> Running ", meta[["functionality_name"]], "\n", sep = "")
1017
out <- processx::run(
11-
paste0("./", meta[["functionality_name"]]),
12-
c("--input", in_h5mu, "--output", out_rds)
18+
meta[["executable"]],
19+
c(
20+
"--input", in_h5mu,
21+
"--output", out_rds
22+
)
1323
)
1424

1525
cat("> Checking whether output file exists\n")
1626
expect_equal(out$status, 0)
1727
expect_true(file.exists(out_rds))
18-
28+
1929
cat("> Reading output file\n")
2030
obj <- readRDS(file = out_rds)
2131

src/convert/from_h5mu_to_seurat/script.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ par <- list(
77
)
88
## VIASH END
99

10+
cat("Reading input file\n")
1011
obj <- ReadH5MU(par$input)
1112

13+
cat("Writing output file\n")
1214
saveRDS(obj, file = par$output, compress = TRUE)

0 commit comments

Comments
 (0)