@@ -8,6 +8,83 @@ nextflow_process {
88 tag "modules_nfcore"
99 tag "scanpy"
1010 tag "scanpy/pca"
11+ tag "untar"
12+
13+ test("Should emit zarr output for zarr input - stub") {
14+
15+ options '-stub'
16+
17+ setup {
18+ run("UNTAR") {
19+ config "./nextflow.config"
20+ script "modules/nf-core/untar/main.nf"
21+ process {
22+ """
23+ input[0] = [
24+ [ id: 'test_zarr' ],
25+ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/scrnaseq/zarr/test_zarr.zarr.tar.gz', checkIfExists: true)
26+ ]
27+ """
28+ }
29+ }
30+ }
31+
32+ when {
33+ process {
34+ """
35+ input[0] = UNTAR.out.untar.map { meta, zarr -> [ meta, zarr ] }
36+ input[1] = "X_pca"
37+ """
38+ }
39+ }
40+
41+ then {
42+ assertAll(
43+ { assert process.success },
44+ { assert process.out.anndata },
45+ { assert file(process.out.anndata[0][1]).name == "test_zarr_pca.zarr" }
46+ )
47+ }
48+
49+ }
50+
51+ test("Should run with zarr input") {
52+
53+ setup {
54+ run("UNTAR") {
55+ config "./nextflow.config"
56+ script "modules/nf-core/untar/main.nf"
57+ process {
58+ """
59+ input[0] = [
60+ [ id: 'test_zarr' ],
61+ file(params.modules_testdata_base_path + 'genomics/homo_sapiens/scrnaseq/zarr/test_zarr.zarr.tar.gz', checkIfExists: true)
62+ ]
63+ """
64+ }
65+ }
66+ }
67+
68+ when {
69+ process {
70+ """
71+ input[0] = UNTAR.out.untar.map { meta, zarr -> [ meta, zarr ] }
72+ input[1] = "X_pca"
73+ """
74+ }
75+ }
76+
77+ then {
78+ assertAll(
79+ { assert process.success },
80+ { assert process.out.anndata },
81+ { assert file(process.out.anndata[0][1]).name == "test_zarr_pca.zarr" },
82+ { assert file(process.out.anndata[0][1] + "/obsm/X_pca/.zarray").exists() },
83+ { assert file(process.out.obsm[0][1]).name == "X_test_zarr_pca.pkl" }
84+ )
85+ }
86+
87+ }
1188
1289 test("Should run without failures") {
1390
@@ -27,8 +104,12 @@ nextflow_process {
27104 then {
28105 assertAll(
29106 { assert process.success },
30- { assert snapshot(process.out).match() },
31- { assert "X_pca" in anndata(process.out.h5ad[0][1]).obsm }
107+ { assert process.out.anndata },
108+ { assert file(process.out.anndata[0][1]).name == "test_pca.h5ad" },
109+ { assert process.out.obsm },
110+ { assert file(process.out.obsm[0][1]).name == "X_test_pca.pkl" },
111+ { assert process.out.versions },
112+ { assert "X_pca" in anndata(process.out.anndata[0][1]).obsm }
32113 )
33114 }
34115
0 commit comments