-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend integration tests for integration workflows (#801)
- Loading branch information
1 parent
a6588da
commit 6e4dece
Showing
17 changed files
with
437 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/workflows/test_workflows/ingestion/bd_rhapsody/config.vsh.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
functionality: | ||
name: "bd_rhapsody_test" | ||
namespace: "test_workflows/ingestion" | ||
description: "This component test the output of the integration test of the bd_rhapsody workflow." | ||
authors: | ||
- __merge__: /src/authors/jakub_majercik.yaml | ||
argument_groups: | ||
- name: Inputs | ||
arguments: | ||
- name: "--input" | ||
type: file | ||
required: true | ||
description: Path to h5mu output. | ||
example: foo.final.h5mu | ||
resources: | ||
- type: python_script | ||
path: script.py | ||
- path: /src/utils/setup_logger.py | ||
- path: /src/base/openpipelinetestutils | ||
dest: openpipelinetestutils | ||
platforms: | ||
- type: docker | ||
image: python:3.12-slim | ||
setup: | ||
- type: docker | ||
copy: ["openpipelinetestutils /opt/openpipelinetestutils"] | ||
- type: apt | ||
packages: | ||
- procps | ||
- type: python | ||
packages: /opt/openpipelinetestutils | ||
pypi: | ||
- mudata | ||
__merge__: /src/base/requirements/viashpy.yaml | ||
- type: nextflow |
35 changes: 35 additions & 0 deletions
35
src/workflows/test_workflows/ingestion/bd_rhapsody/script.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from mudata import read_h5mu | ||
import numpy as np | ||
import shutil | ||
import os | ||
import sys | ||
from pathlib import Path | ||
import pytest | ||
|
||
##VIASH START | ||
par = { | ||
"input": "input.h5mu" | ||
} | ||
|
||
meta = { | ||
"resources_dir": "resources_test" | ||
} | ||
##VIASH END | ||
|
||
def test_run(): | ||
input_mudata = read_h5mu(par["input"]) | ||
expected_var = ['gene_name', 'feature_types', 'reference_file'] | ||
expected_obs = ['run_id', 'library_id', 'sample_id'] | ||
|
||
assert list(input_mudata.mod.keys()) == ["rna"], "Input should contain rna modality." | ||
assert list(input_mudata.var.columns) == expected_var, f"Input var columns should be: {expected_var}." | ||
assert list(input_mudata.mod["rna"].var.columns) == expected_var, f"Input mod['rna'] var columns should be: {expected_var}." | ||
assert list(input_mudata.mod["rna"].obs.columns) == expected_obs, f"Input obs columns should be: {expected_obs}." | ||
|
||
assert np.array_equal(input_mudata.var["feature_types"].unique(), ["Gene Expression"]), "Output X should only contain Gene Expression vars." | ||
|
||
if __name__ == "__main__": | ||
HERE_DIR = Path(__file__).resolve().parent | ||
shutil.copyfile(os.path.join(meta['resources_dir'], "openpipelinetestutils", "conftest.py"), | ||
os.path.join(HERE_DIR, "conftest.py")) | ||
sys.exit(pytest.main(["--import-mode=importlib"])) |
36 changes: 36 additions & 0 deletions
36
src/workflows/test_workflows/ingestion/cellranger_mapping/config.vsh.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
functionality: | ||
name: "cellranger_mapping_test" | ||
namespace: "test_workflows/ingestion" | ||
description: "This component test the output of the integration test of the cellranger mapping workflow." | ||
authors: | ||
- __merge__: /src/authors/jakub_majercik.yaml | ||
argument_groups: | ||
- name: Inputs | ||
arguments: | ||
- name: "--input" | ||
type: file | ||
required: true | ||
description: Path to h5mu output. | ||
example: foo.final.h5mu | ||
resources: | ||
- type: python_script | ||
path: script.py | ||
- path: /src/utils/setup_logger.py | ||
- path: /src/base/openpipelinetestutils | ||
dest: openpipelinetestutils | ||
platforms: | ||
- type: docker | ||
image: python:3.12-slim | ||
setup: | ||
- type: docker | ||
copy: ["openpipelinetestutils /opt/openpipelinetestutils"] | ||
- type: apt | ||
packages: | ||
- procps | ||
- type: python | ||
packages: /opt/openpipelinetestutils | ||
- type: python | ||
pypi: | ||
- mudata | ||
__merge__: /src/base/requirements/viashpy.yaml | ||
- type: nextflow |
30 changes: 30 additions & 0 deletions
30
src/workflows/test_workflows/ingestion/cellranger_mapping/script.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from mudata import read_h5mu | ||
from pathlib import Path | ||
import shutil | ||
import os | ||
import sys | ||
import pytest | ||
|
||
##VIASH START | ||
par = { | ||
"input": "input.h5mu" | ||
} | ||
|
||
meta = { | ||
"resources_dir": "resources_test" | ||
} | ||
##VIASH END | ||
|
||
def test_run(): | ||
input_mudata = read_h5mu(par["input"]) | ||
expected_colnames = ['gene_symbol', 'feature_types', 'genome'] | ||
|
||
assert list(input_mudata.mod.keys()) == ["rna"], "Input should contain rna modality." | ||
assert list(input_mudata.var.columns) == expected_colnames, f"Input var columns should be: {expected_colnames}." | ||
assert list(input_mudata.mod["rna"].var.columns) == expected_colnames, f"Input mod['rna'] var columns should be: {expected_colnames}." | ||
|
||
if __name__ == "__main__": | ||
HERE_DIR = Path(__file__).resolve().parent | ||
shutil.copyfile(os.path.join(meta['resources_dir'], "openpipelinetestutils", "conftest.py"), | ||
os.path.join(HERE_DIR, "conftest.py")) | ||
sys.exit(pytest.main(["--import-mode=importlib"])) |
37 changes: 37 additions & 0 deletions
37
src/workflows/test_workflows/ingestion/cellranger_multi/config.vsh.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
functionality: | ||
name: "cellranger_multi_test" | ||
namespace: "test_workflows/ingestion" | ||
description: "This component test the output of the integration test of the cellranger multi workflow." | ||
authors: | ||
- __merge__: /src/authors/jakub_majercik.yaml | ||
argument_groups: | ||
- name: Inputs | ||
arguments: | ||
- name: "--input" | ||
type: file | ||
required: true | ||
multiple: true | ||
description: Path to h5mu output. | ||
example: foo.final.h5mu | ||
resources: | ||
- type: python_script | ||
path: script.py | ||
- path: /src/utils/setup_logger.py | ||
- path: /src/base/openpipelinetestutils | ||
dest: openpipelinetestutils | ||
platforms: | ||
- type: docker | ||
image: python:3.12-slim | ||
setup: | ||
- type: docker | ||
copy: ["openpipelinetestutils /opt/openpipelinetestutils"] | ||
- type: apt | ||
packages: | ||
- procps | ||
- type: python | ||
packages: /opt/openpipelinetestutils | ||
- type: python | ||
pypi: | ||
- mudata | ||
__merge__: /src/base/requirements/viashpy.yaml | ||
- type: nextflow |
Oops, something went wrong.