Skip to content

Commit f625620

Browse files
Deploy for release 0.6.1 from f58cc1b
1 parent efd266b commit f625620

File tree

336 files changed

+1677
-1438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

336 files changed

+1677
-1438
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# openpipeline 0.6.1
2+
3+
## BUG FIXES
4+
5+
* `src/filter/filter_with_counts`: Fix an issue where mitochrondrial genes were being detected in .var_names, which contain ENSAMBL IDs instead of gene symbols in the pipelines. Solution was to create a `--var_gene_names` argument which allows selecting a .var column to check using a regex (`--mitochondrial_gene_regex`).
6+
17
# openpipeline 0.6.0
28

39
## NEW FUNCTIONALITY

src/filter/filter_with_counts/config.vsh.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,23 @@ functionality:
3232
example: "raw_counts"
3333
required: false
3434

35+
- name: "--var_gene_names"
36+
required: false
37+
example: "gene_symbol"
38+
type: string
39+
description: |
40+
.var column name to be used to detect mitochondrial genes instead of .var_names (default if not set).
41+
Gene names matching with the regex value from --mitochondrial_gene_regex will be identified
42+
as a mitochondrial gene.
43+
44+
- name: --mitochondrial_gene_regex
45+
type: string
46+
description: |
47+
Regex string that identifies mitochondrial genes from --var_gene_names.
48+
By default will detect human and mouse mitochondrial genes from a gene symbol.
49+
required: false
50+
default: "^[mM][tT]-"
51+
3552
- name: Outputs
3653
arguments:
3754
- name: "--output"

src/filter/filter_with_counts/run_test.py

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def test_filtering_a_little(run_component, input_path,
8383
"--min_cells_per_gene", "10",
8484
"--min_fraction_mito", "0",
8585
"--max_fraction_mito", "0.2",
86+
"--var_gene_names", "gene_symbol",
8687
"--do_subset"])
8788
assert Path("output-2.h5mu").is_file()
8889
mu_out = mu.read_h5mu("output-2.h5mu")
@@ -104,11 +105,76 @@ def test_filter_cells_without_counts(run_component, input_h5mu, tmp_path):
104105
run_component([
105106
"--input", temp_h5mu_path,
106107
"--output", "output-3.h5mu",
107-
"--min_cells_per_gene", "3"
108+
"--min_cells_per_gene", "0",
108109
])
109110
assert Path("output-3.h5mu").is_file()
110111
mu_out = mu.read_h5mu("output-3.h5mu")
111112
assert mu_out.mod['rna'].obs.at[obs_to_remove, 'filter_with_counts'] == False
112113

114+
def test_filter_mitochondrial(run_component, input_path,
115+
input_n_rna_obs, input_n_prot_obs,
116+
input_n_rna_vars, input_n_prot_vars):
117+
run_component([
118+
"--input", input_path,
119+
"--output", "output-4.h5mu",
120+
"--var_gene_names", "gene_symbol",
121+
"--max_fraction_mito", "0.2",
122+
"--do_subset"
123+
])
124+
assert Path("output-4.h5mu").is_file()
125+
mu_out = mu.read_h5mu("output-4.h5mu")
126+
new_obs = mu_out.mod['rna'].n_obs
127+
new_vars = mu_out.mod['rna'].n_vars
128+
assert new_obs < input_n_rna_obs
129+
assert new_vars == input_n_rna_vars
130+
assert mu_out.mod['prot'].n_obs == input_n_prot_obs
131+
assert mu_out.mod['prot'].n_vars == input_n_prot_vars
132+
assert list(mu_out.mod['rna'].var['feature_types'].cat.categories) == ["Gene Expression"]
133+
assert list(mu_out.mod['prot'].var['feature_types'].cat.categories) == ["Antibody Capture"]
134+
135+
def test_filter_mitochondrial_regex(run_component, input_path,
136+
input_n_rna_obs, input_n_prot_obs,
137+
input_n_rna_vars, input_n_prot_vars):
138+
run_component([
139+
"--input", input_path,
140+
"--output", "output-5.h5mu",
141+
"--var_gene_names", "gene_symbol",
142+
"--max_fraction_mito", "0.2",
143+
"--mitochondrial_gene_regex", "^[M][T]-",
144+
"--do_subset"
145+
])
146+
assert Path("output-5.h5mu").is_file()
147+
mu_out = mu.read_h5mu("output-5.h5mu")
148+
new_obs = mu_out.mod['rna'].n_obs
149+
new_vars = mu_out.mod['rna'].n_vars
150+
assert new_obs < input_n_rna_obs
151+
assert new_vars == input_n_rna_vars
152+
assert mu_out.mod['prot'].n_obs == input_n_prot_obs
153+
assert mu_out.mod['prot'].n_vars == input_n_prot_vars
154+
assert list(mu_out.mod['rna'].var['feature_types'].cat.categories) == ["Gene Expression"]
155+
assert list(mu_out.mod['prot'].var['feature_types'].cat.categories) == ["Antibody Capture"]
156+
157+
def test_filter_mitochondrial_column_not_set(run_component, input_path,
158+
input_n_rna_obs, input_n_prot_obs,
159+
input_n_rna_vars, input_n_prot_vars):
160+
run_component([
161+
"--input", input_path,
162+
"--output", "output-6.h5mu",
163+
"--max_fraction_mito", "0.2",
164+
"--mitochondrial_gene_regex", "^[mM][tT]-",
165+
"--do_subset"
166+
])
167+
assert Path("output-6.h5mu").is_file()
168+
mu_out = mu.read_h5mu("output-6.h5mu")
169+
new_obs = mu_out.mod['rna'].n_obs
170+
new_vars = mu_out.mod['rna'].n_vars
171+
assert new_obs == input_n_rna_obs # Stays the same because filtering on the wrong column
172+
assert new_vars == input_n_rna_vars
173+
assert mu_out.mod['prot'].n_obs == input_n_prot_obs
174+
assert mu_out.mod['prot'].n_vars == input_n_prot_vars
175+
assert list(mu_out.mod['rna'].var['feature_types'].cat.categories) == ["Gene Expression"]
176+
assert list(mu_out.mod['prot'].var['feature_types'].cat.categories) == ["Antibody Capture"]
177+
178+
113179
if __name__ == "__main__":
114180
exit(pytest.main([__file__], plugins=["viashpy"]))

src/filter/filter_with_counts/script.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
'max_genes_per_cell': int('1500000'),
2020
'min_cells_per_gene': int('3'),
2121
'min_fraction_mito': float('0.0'),
22-
'max_fraction_mito': float('0.2')
22+
'max_fraction_mito': float('0.2'),
23+
"var_gene_names": "gene_symbol",
24+
"mitochondrial_gene_regex": "^[mM][tT]-"
2325
}
2426
meta = {
2527
'functionality_name': 'filter_on_counts'
@@ -48,7 +50,8 @@
4850
n_counts_per_cell = np.ravel(np.sum(data.X, axis=1))
4951
n_cells_per_gene = np.sum(data.X > 0, axis=0)
5052
n_genes_per_cell = np.sum(data.X > 0, axis=1)
51-
mito_genes = data.var_names.str.contains("^[mM][tT]-")
53+
genes_column = data.var[par["var_gene_names"]] if par["var_gene_names"] else data.var_names
54+
mito_genes = genes_column.str.contains(par["mitochondrial_gene_regex"], regex=True)
5255
pct_mito = np.ravel(np.sum(data[:, mito_genes].X, axis=1) / np.sum(data.X, axis=1))
5356

5457
def apply_filter_to_mask(mask, base, filter, comparator):

target/docker/cluster/leiden/.config.vsh.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
functionality:
22
name: "leiden"
33
namespace: "cluster"
4-
version: "0.6.0"
4+
version: "0.6.1"
55
authors:
66
- name: "Dries De Maeyer"
77
@@ -182,5 +182,5 @@ info:
182182
output: "/home/runner/work/openpipeline/openpipeline/target/docker/cluster/leiden"
183183
executable: "/home/runner/work/openpipeline/openpipeline/target/docker/cluster/leiden/leiden"
184184
viash_version: "0.6.7"
185-
git_commit: "71f212309102f58d998411f4ddf76fcc5dc46401"
185+
git_commit: "f58cc1b1bc6ec4affe0e2283aca7f371c3e80d46"
186186
git_remote: "https://github.com/openpipelines-bio/openpipeline"

target/docker/cluster/leiden/leiden

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
# leiden 0.6.0
3+
# leiden 0.6.1
44
#
55
# This wrapper script is auto-generated by viash 0.6.7 and is thus a derivative
66
# work thereof. This software comes with ABSOLUTELY NO WARRANTY from Data
@@ -158,7 +158,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP"
158158

159159
# ViashHelp: Display helpful explanation about this executable
160160
function ViashHelp {
161-
echo "leiden 0.6.0"
161+
echo "leiden 0.6.1"
162162
echo ""
163163
echo "Cluster cells using the Leiden algorithm [Traag18] implemented in the Scanpy"
164164
echo "framework [Wolf18]."
@@ -433,10 +433,10 @@ RUN pip install --upgrade pip && \
433433
434434
LABEL org.opencontainers.image.authors="Dries De Maeyer"
435435
LABEL org.opencontainers.image.description="Companion container for running component cluster leiden"
436-
LABEL org.opencontainers.image.created="2022-12-21T14:39:54Z"
436+
LABEL org.opencontainers.image.created="2022-12-22T12:50:49Z"
437437
LABEL org.opencontainers.image.source="https://github.com/openpipelines-bio/openpipeline"
438-
LABEL org.opencontainers.image.revision="71f212309102f58d998411f4ddf76fcc5dc46401"
439-
LABEL org.opencontainers.image.version="0.6.0"
438+
LABEL org.opencontainers.image.revision="f58cc1b1bc6ec4affe0e2283aca7f371c3e80d46"
439+
LABEL org.opencontainers.image.version="0.6.1"
440440
VIASHDOCKER
441441
}
442442

@@ -585,7 +585,7 @@ while [[ $# -gt 0 ]]; do
585585
shift 1
586586
;;
587587
--version)
588-
echo "leiden 0.6.0"
588+
echo "leiden 0.6.1"
589589
exit
590590
;;
591591
--input)
@@ -730,14 +730,14 @@ eval set -- $VIASH_POSITIONAL_ARGS
730730
ViashDockerInstallationCheck
731731

732732
if [ $VIASH_MODE == "docker_setup" ]; then
733-
ViashDockerSetup 'ghcr.io/openpipelines-bio/cluster_leiden:0.6.0' "$VIASH_DOCKER_SETUP_STRATEGY"
733+
ViashDockerSetup 'ghcr.io/openpipelines-bio/cluster_leiden:0.6.1' "$VIASH_DOCKER_SETUP_STRATEGY"
734734
exit 0
735735
fi
736-
ViashDockerSetup 'ghcr.io/openpipelines-bio/cluster_leiden:0.6.0' ifneedbepullelsecachedbuild
736+
ViashDockerSetup 'ghcr.io/openpipelines-bio/cluster_leiden:0.6.1' ifneedbepullelsecachedbuild
737737

738738
if [ $VIASH_MODE == "docker_debug" ]; then
739-
ViashNotice "+ docker run --entrypoint=bash -i --rm -v "$(pwd)":/pwd --workdir /pwd -t 'ghcr.io/openpipelines-bio/cluster_leiden:0.6.0'"
740-
docker run --entrypoint=bash -i --rm -v "$(pwd)":/pwd --workdir /pwd -t 'ghcr.io/openpipelines-bio/cluster_leiden:0.6.0'
739+
ViashNotice "+ docker run --entrypoint=bash -i --rm -v "$(pwd)":/pwd --workdir /pwd -t 'ghcr.io/openpipelines-bio/cluster_leiden:0.6.1'"
740+
docker run --entrypoint=bash -i --rm -v "$(pwd)":/pwd --workdir /pwd -t 'ghcr.io/openpipelines-bio/cluster_leiden:0.6.1'
741741
exit 0
742742
fi
743743

@@ -923,7 +923,7 @@ VIASH_UNIQUE_MOUNTS=($(for val in "${VIASH_EXTRA_MOUNTS[@]}"; do echo "$val"; do
923923
function ViashPerformChown {
924924
if (( ${#VIASH_CHOWN_VARS[@]} )); then
925925
set +e
926-
eval docker run --entrypoint=chown -i --rm ${VIASH_UNIQUE_MOUNTS[@]} ghcr.io/openpipelines-bio/cluster_leiden:0.6.0 "$(id -u):$(id -g)" --silent --recursive ${VIASH_CHOWN_VARS[@]}
926+
eval docker run --entrypoint=chown -i --rm ${VIASH_UNIQUE_MOUNTS[@]} ghcr.io/openpipelines-bio/cluster_leiden:0.6.1 "$(id -u):$(id -g)" --silent --recursive ${VIASH_CHOWN_VARS[@]}
927927
set -e
928928
fi
929929
}
@@ -938,8 +938,8 @@ if [ ! -z "$VIASH_META_CPUS" ]; then
938938
VIASH_EXTRA_DOCKER_ARGS="$VIASH_EXTRA_DOCKER_ARGS --cpus=${VIASH_META_CPUS}"
939939
fi
940940

941-
ViashDebug "Running command: $(echo docker run --entrypoint=bash -i --rm ${VIASH_UNIQUE_MOUNTS[@]} $VIASH_EXTRA_DOCKER_ARGS ghcr.io/openpipelines-bio/cluster_leiden:0.6.0)"
942-
cat << VIASHEOF | eval docker run --entrypoint=bash -i --rm ${VIASH_UNIQUE_MOUNTS[@]} $VIASH_EXTRA_DOCKER_ARGS ghcr.io/openpipelines-bio/cluster_leiden:0.6.0
941+
ViashDebug "Running command: $(echo docker run --entrypoint=bash -i --rm ${VIASH_UNIQUE_MOUNTS[@]} $VIASH_EXTRA_DOCKER_ARGS ghcr.io/openpipelines-bio/cluster_leiden:0.6.1)"
942+
cat << VIASHEOF | eval docker run --entrypoint=bash -i --rm ${VIASH_UNIQUE_MOUNTS[@]} $VIASH_EXTRA_DOCKER_ARGS ghcr.io/openpipelines-bio/cluster_leiden:0.6.1
943943
set -e
944944
tempscript=\$(mktemp "$VIASH_META_TEMP_DIR/viash-run-leiden-XXXXXX").py
945945
function clean_up {

target/docker/compression/tar_extract/.config.vsh.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
functionality:
22
name: "tar_extract"
33
namespace: "compression"
4-
version: "0.6.0"
4+
version: "0.6.1"
55
authors: []
66
inputs: []
77
outputs: []
@@ -106,5 +106,5 @@ info:
106106
output: "/home/runner/work/openpipeline/openpipeline/target/docker/compression/tar_extract"
107107
executable: "/home/runner/work/openpipeline/openpipeline/target/docker/compression/tar_extract/tar_extract"
108108
viash_version: "0.6.7"
109-
git_commit: "71f212309102f58d998411f4ddf76fcc5dc46401"
109+
git_commit: "f58cc1b1bc6ec4affe0e2283aca7f371c3e80d46"
110110
git_remote: "https://github.com/openpipelines-bio/openpipeline"

target/docker/compression/tar_extract/tar_extract

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
# tar_extract 0.6.0
3+
# tar_extract 0.6.1
44
#
55
# This wrapper script is auto-generated by viash 0.6.7 and is thus a derivative
66
# work thereof. This software comes with ABSOLUTELY NO WARRANTY from Data
@@ -155,7 +155,7 @@ VIASH_META_TEMP_DIR="$VIASH_TEMP"
155155

156156
# ViashHelp: Display helpful explanation about this executable
157157
function ViashHelp {
158-
echo "tar_extract 0.6.0"
158+
echo "tar_extract 0.6.1"
159159
echo ""
160160
echo "Extract files from a tar archive"
161161
echo ""
@@ -403,10 +403,10 @@ FROM ubuntu:latest
403403
404404
RUN :
405405
LABEL org.opencontainers.image.description="Companion container for running component compression tar_extract"
406-
LABEL org.opencontainers.image.created="2022-12-21T14:39:51Z"
406+
LABEL org.opencontainers.image.created="2022-12-22T12:50:46Z"
407407
LABEL org.opencontainers.image.source="https://github.com/openpipelines-bio/openpipeline"
408-
LABEL org.opencontainers.image.revision="71f212309102f58d998411f4ddf76fcc5dc46401"
409-
LABEL org.opencontainers.image.version="0.6.0"
408+
LABEL org.opencontainers.image.revision="f58cc1b1bc6ec4affe0e2283aca7f371c3e80d46"
409+
LABEL org.opencontainers.image.version="0.6.1"
410410
VIASHDOCKER
411411
}
412412

@@ -555,7 +555,7 @@ while [[ $# -gt 0 ]]; do
555555
shift 1
556556
;;
557557
--version)
558-
echo "tar_extract 0.6.0"
558+
echo "tar_extract 0.6.1"
559559
exit
560560
;;
561561
--input)
@@ -690,14 +690,14 @@ eval set -- $VIASH_POSITIONAL_ARGS
690690
ViashDockerInstallationCheck
691691

692692
if [ $VIASH_MODE == "docker_setup" ]; then
693-
ViashDockerSetup 'ghcr.io/openpipelines-bio/compression_tar_extract:0.6.0' "$VIASH_DOCKER_SETUP_STRATEGY"
693+
ViashDockerSetup 'ghcr.io/openpipelines-bio/compression_tar_extract:0.6.1' "$VIASH_DOCKER_SETUP_STRATEGY"
694694
exit 0
695695
fi
696-
ViashDockerSetup 'ghcr.io/openpipelines-bio/compression_tar_extract:0.6.0' ifneedbepullelsecachedbuild
696+
ViashDockerSetup 'ghcr.io/openpipelines-bio/compression_tar_extract:0.6.1' ifneedbepullelsecachedbuild
697697

698698
if [ $VIASH_MODE == "docker_debug" ]; then
699-
ViashNotice "+ docker run --entrypoint=bash -i --rm -v "$(pwd)":/pwd --workdir /pwd -t 'ghcr.io/openpipelines-bio/compression_tar_extract:0.6.0'"
700-
docker run --entrypoint=bash -i --rm -v "$(pwd)":/pwd --workdir /pwd -t 'ghcr.io/openpipelines-bio/compression_tar_extract:0.6.0'
699+
ViashNotice "+ docker run --entrypoint=bash -i --rm -v "$(pwd)":/pwd --workdir /pwd -t 'ghcr.io/openpipelines-bio/compression_tar_extract:0.6.1'"
700+
docker run --entrypoint=bash -i --rm -v "$(pwd)":/pwd --workdir /pwd -t 'ghcr.io/openpipelines-bio/compression_tar_extract:0.6.1'
701701
exit 0
702702
fi
703703

@@ -869,7 +869,7 @@ VIASH_UNIQUE_MOUNTS=($(for val in "${VIASH_EXTRA_MOUNTS[@]}"; do echo "$val"; do
869869
function ViashPerformChown {
870870
if (( ${#VIASH_CHOWN_VARS[@]} )); then
871871
set +e
872-
eval docker run --entrypoint=chown -i --rm ${VIASH_UNIQUE_MOUNTS[@]} ghcr.io/openpipelines-bio/compression_tar_extract:0.6.0 "$(id -u):$(id -g)" --silent --recursive ${VIASH_CHOWN_VARS[@]}
872+
eval docker run --entrypoint=chown -i --rm ${VIASH_UNIQUE_MOUNTS[@]} ghcr.io/openpipelines-bio/compression_tar_extract:0.6.1 "$(id -u):$(id -g)" --silent --recursive ${VIASH_CHOWN_VARS[@]}
873873
set -e
874874
fi
875875
}
@@ -884,8 +884,8 @@ if [ ! -z "$VIASH_META_CPUS" ]; then
884884
VIASH_EXTRA_DOCKER_ARGS="$VIASH_EXTRA_DOCKER_ARGS --cpus=${VIASH_META_CPUS}"
885885
fi
886886

887-
ViashDebug "Running command: $(echo docker run --entrypoint=bash -i --rm ${VIASH_UNIQUE_MOUNTS[@]} $VIASH_EXTRA_DOCKER_ARGS ghcr.io/openpipelines-bio/compression_tar_extract:0.6.0)"
888-
cat << VIASHEOF | eval docker run --entrypoint=bash -i --rm ${VIASH_UNIQUE_MOUNTS[@]} $VIASH_EXTRA_DOCKER_ARGS ghcr.io/openpipelines-bio/compression_tar_extract:0.6.0
887+
ViashDebug "Running command: $(echo docker run --entrypoint=bash -i --rm ${VIASH_UNIQUE_MOUNTS[@]} $VIASH_EXTRA_DOCKER_ARGS ghcr.io/openpipelines-bio/compression_tar_extract:0.6.1)"
888+
cat << VIASHEOF | eval docker run --entrypoint=bash -i --rm ${VIASH_UNIQUE_MOUNTS[@]} $VIASH_EXTRA_DOCKER_ARGS ghcr.io/openpipelines-bio/compression_tar_extract:0.6.1
889889
set -e
890890
tempscript=\$(mktemp "$VIASH_META_TEMP_DIR/viash-run-tar_extract-XXXXXX").sh
891891
function clean_up {

target/docker/convert/from_10xh5_to_h5mu/.config.vsh.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
functionality:
22
name: "from_10xh5_to_h5mu"
33
namespace: "convert"
4-
version: "0.6.0"
4+
version: "0.6.1"
55
authors:
66
- name: "Robrecht Cannoodt"
77
@@ -231,5 +231,5 @@ info:
231231
output: "/home/runner/work/openpipeline/openpipeline/target/docker/convert/from_10xh5_to_h5mu"
232232
executable: "/home/runner/work/openpipeline/openpipeline/target/docker/convert/from_10xh5_to_h5mu/from_10xh5_to_h5mu"
233233
viash_version: "0.6.7"
234-
git_commit: "71f212309102f58d998411f4ddf76fcc5dc46401"
234+
git_commit: "f58cc1b1bc6ec4affe0e2283aca7f371c3e80d46"
235235
git_remote: "https://github.com/openpipelines-bio/openpipeline"

0 commit comments

Comments
 (0)