Skip to content

Commit 682b426

Browse files
committed
deploy: 33a2752
0 parents  commit 682b426

425 files changed

Lines changed: 209955 additions & 0 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
resources
2+
work
3+
.nextflow*
4+
.idea
5+
.vscode
6+
.DS_Store
7+
output
8+
trace-*
9+
.ipynb_checkpoints

.nojekyll

Whitespace-only changes.

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# task_perturbation_prediction 1.0.0
2+
3+
Initial release of the Perturbation Prediction task. Initial components:
4+
5+
* `src/process_dataset`: Compute the DGE data from the raw single-cell counts using Limma.
6+
* `src/control_methods`: Baseline control methods: sample, ground_truth, zeros, mean_across_celltypes, mean_across_compounds, mean_outcome.
7+
* `src/methods`: Perturbation prediction methods: jn_ap_op2, lgc_ensemble, nn_retraining_with_pseudolabels, pyboost, scape, transformer_ensemble.
8+
* `src/metrics`: Evaluation metrics: mean_rowwise_error, mean_rowwise_correlation.
9+
10+

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Open Problems in Single-Cell Analysis
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 500 additions & 0 deletions
Large diffs are not rendered by default.

_viash.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
viash_version: 0.8.6
2+
3+
source: src
4+
target: target
5+
6+
config_mods: |
7+
.functionality.version := 'dev'
8+
.functionality.arguments[.multiple == true].multiple_sep := ';'
9+
.platforms[.type == 'docker'].target_registry := 'ghcr.io'
10+
.platforms[.type == 'docker'].target_organization := 'openproblems-bio/task_perturbation_prediction'
11+
.platforms[.type == 'docker'].target_image_source := 'https://github.com/openproblems-bio/task_perturbation_prediction'
12+
.platforms[.type == "nextflow"].directives.tag := "$id"
13+
.platforms[.type == "nextflow"].auto.simplifyOutput := false
14+
.platforms[.type == "nextflow"].config.labels := { lowmem : "memory = 20.Gb", midmem : "memory = 50.Gb", highmem : "memory = 100.Gb", lowcpu : "cpus = 5", midcpu : "cpus = 15", highcpu : "cpus = 30", lowtime : "time = 1.h", midtime : "time = 4.h", hightime : "time = 8.h", veryhightime : "time = 24.h" }
15+
.platforms[.type == "nextflow"].config.script := "process.errorStrategy = 'ignore'"

main.nf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
workflow {
2+
print("This is a dummy placeholder for pipeline execution. Please use the corresponding nf files for running pipelines.")
3+
}

nextflow.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
process.container = 'nextflow/bash:latest'

scripts/add_a_method.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
echo "This script is not supposed to be run directly."
4+
echo "Please run the script step-by-step."
5+
exit 1
6+
7+
# sync resources
8+
scripts/download_resources.sh
9+
10+
# create a new component
11+
method_id="my_method"
12+
method_lang="python" # change this to "r" if need be
13+
14+
viash run src/common/create_component/config.vsh.yaml -- \
15+
--language "$method_lang" \
16+
--name "$method_id"
17+
18+
# TODO: fill in required fields in src/methods/foo/config.vsh.yaml
19+
# TODO: edit src/methods/foo/script.py/R
20+
21+
# test the component
22+
viash test src/methods/$method_id/config.vsh.yaml
23+
24+
# rebuild the container (only if you change something to the docker platform)
25+
# You can reduce the memory and cpu allotted to jobs in _viash.yaml by modifying .platforms[.type == "nextflow"].config.labels
26+
viash run src/methods/$method_id/config.vsh.yaml -- \
27+
---setup cachedbuild ---verbose
28+
29+
# run the method (using h5ad as input)
30+
viash run src/methods/$method_id/config.vsh.yaml -- \
31+
--de_train_h5ad "resources/neurips-2023-kaggle/2023-09-12_de_by_cell_type_train.h5ad" \
32+
--id_map "resources/neurips-2023-kaggle/id_map.csv" \
33+
--output "output/prediction.h5ad"
34+
35+
# run evaluation metric
36+
viash run src/metrics/mean_rowwise_error/config.vsh.yaml -- \
37+
--de_test_h5ad "resources/neurips-2023-kaggle/de_test.h5ad" \
38+
--prediction "output/prediction.h5ad" \
39+
--output "output/score.h5ad"
40+
41+
# print score on kaggle test dataset
42+
python -c 'import anndata; print(anndata.read_h5ad("output/score.h5ad").uns)'

scripts/build_components.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
viash ns build --parallel --setup cachedbuild

0 commit comments

Comments
 (0)