Skip to content

Commit

Permalink
multiomics workflows are added back
Browse files Browse the repository at this point in the history
  • Loading branch information
janursa committed Sep 24, 2024
1 parent eb67555 commit 87e46d5
Show file tree
Hide file tree
Showing 12 changed files with 387 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/methods/multi_omics/celloracle_ns/config.novsh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

__merge__: ../../../api/comp_method.yaml

functionality:
name: grn_inference_celloracle
namespace: "workflows"
info:
label: grn_inference_celloracle
summary: "Infers GRNs from multiomics data using celloracle."
arguments:
- name: --base_grn
type: file
direction: output
default: output/celloracle/base_grn.csv
- name: --links
type: file
direction: output
default: output/celloracle/links.celloracle.links
resources:
- type: nextflow_script
path: main.nf
entrypoint: run_wf
dependencies:
- name: grn_methods/celloracle

platforms:
- type: nextflow
directives:
label: [ midtime, midmem, lowcpu ]
21 changes: 21 additions & 0 deletions src/methods/multi_omics/celloracle_ns/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
workflow run_wf {
take:
input_ch

main:
output_ch = input_ch

| celloracle.run(
fromState: [multiomics_rna: "multiomics_rna",
multiomics_atac: "multiomics_atac",
temp_dir: "temp_dir",
num_workers: "num_workers"
],
toState: [prediction:"prediction", base_grn: "base_grn", links: "links"]
)

| setState(["prediction", "base_grn", "links"])

emit:
output_ch
}
61 changes: 61 additions & 0 deletions src/methods/multi_omics/celloracle_ns/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash

# RUN_ID="run_$(date +%Y-%m-%d_%H-%M-%S)"
RUN_ID="celloracle"
resources_dir="s3://openproblems-data/resources/grn"
publish_dir="s3://openproblems-data/resources/grn/results/${RUN_ID}"

# resources_dir="./resources_test"
# publish_dir="./output/${RUN_ID}"

num_workers=20

param_file="./params/${RUN_ID}.yaml"
# Start writing to the YAML file
cat > $param_file << HERE
param_list:
- id: ${RUN_ID}
multiomics_rna: ${resources_dir}/grn-benchmark/multiomics_rna.h5ad
multiomics_atac: ${resources_dir}/grn-benchmark/multiomics_atac.h5ad
num_workers: $num_workers
temp_dir: ./tmp/grn
output_state: "state.yaml"
publish_dir: "$publish_dir"
HERE

if [ "$submit" = true ]; then
nextflow run . \
-main-script target/nextflow/workflows/grn_inference_celloracle/main.nf \
-profile docker \
-with-trace \
-c src/common/nextflow_helpers/labels_ci.config \
-params-file params/${RUN_ID}.yaml


./tw-windows-x86_64.exe launch `
https://github.com/openproblems-bio/task_grn_inference.git `
--revision build/main `
--pull-latest `
--main-script target/nextflow/workflows/run_grn_inference/main.nf `
--workspace 53907369739130 `
--compute-env 6TeIFgV5OY4pJCk8I0bfOh `
--params-file ./params/celloracle_test.yaml `
--config src/common/nextflow_helpers/labels_tw.config
fi



if [ "$read_results" = true ]; then
aws s3 sync s3://openproblems-data/resources/grn/results/${RUN_ID} ./resources/results/${RUN_ID}
fi


./tw-windows-x86_64.exe launch `
https://github.com/openproblems-bio/task_grn_inference.git `
--revision build/main `
--pull-latest `
--main-script target/nextflow/workflows/grn_inference_celloracle/main.nf `
--workspace 53907369739130 `
--compute-env 6TeIFgV5OY4pJCk8I0bfOh `
--params-file ./params/celloracle.yaml `
--config src/common/nextflow_helpers/labels_tw.config
27 changes: 27 additions & 0 deletions src/methods/multi_omics/granie_ns/config.novsh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

__merge__: ../../../api/comp_method_r.yaml

functionality:
name: grn_inference_granie
namespace: "workflows"
info:
label: grn_inference_granie
summary: "Infers GRNs from multiomics data using granie."
arguments:
- name: --subset
type: boolean
required: false
default: false
direction: input

resources:
- type: nextflow_script
path: main.nf
entrypoint: run_wf
dependencies:
- name: grn_methods/granie

platforms:
- type: nextflow
directives:
label: [ hightime, midmem, highcpu ]
22 changes: 22 additions & 0 deletions src/methods/multi_omics/granie_ns/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
workflow run_wf {
take:
input_ch

main:
output_ch = input_ch

| granie.run(
fromState: [
multiomics_rna_r: "multiomics_rna_r",
multiomics_atac_r: "multiomics_atac_r",
num_workers: "num_workers",
subset: "subset"
],
toState: [prediction:"prediction"]
)

| setState(["prediction"])

emit:
output_ch
}
35 changes: 35 additions & 0 deletions src/methods/multi_omics/granie_ns/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# RUN_ID="run_$(date +%Y-%m-%d_%H-%M-%S)"
RUN_ID="scglue"
resources_dir="s3://openproblems-data/resources/grn"
publish_dir="s3://openproblems-data/resources/grn/results/${RUN_ID}"

num_workers=20

param_file="./params/${RUN_ID}.yaml"

cat > $param_file << HERE
param_list:
- id: ${RUN_ID}
multiomics_rna: ${resources_dir}/grn-benchmark/multiomics_rna.h5ad
multiomics_atac: ${resources_dir}/grn-benchmark/multiomics_atac.h5ad
annotation_file: ${resources_dir}/supplementary/gencode.v45.annotation.gtf.gz
motif_file: ${resources_dir}/supplementary/JASPAR2022-hg38.bed.gz
num_workers: $num_workers
temp_dir: ./tmp/grn
output_state: "state.yaml"
publish_dir: "$publish_dir"
HERE



./tw-windows-x86_64.exe launch `
https://github.com/openproblems-bio/task_grn_inference.git `
--revision build/main `
--pull-latest `
--main-script target/nextflow/workflows/grn_inference_scglue/main.nf `
--workspace 53907369739130 `
--compute-env 6TeIFgV5OY4pJCk8I0bfOh `
--params-file ./params/scglue.yaml `
--config src/common/nextflow_helpers/labels_tw.config
39 changes: 39 additions & 0 deletions src/methods/multi_omics/scenicplus_ns/config.novsh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

__merge__: ../../../api/comp_method.yaml

functionality:
name: grn_inference_scenicplus
namespace: "workflows"
info:
label: grn_inference_scenicplus
summary: "Infers GRNs from multiomics data using scenicplus."
arguments:
- name: --scplus_mdata
type: file
required: false
direction: output
description: "Main output object."
default: "scplus_mdata.h5mu"
- name: --qc
type: boolean
default: false
description: "Whether to perform quality control."
- name: --cell_topic
type: file
default: output/cell_topic.csv
required: false
direction: output
description: "Cell-topics prob scores"


resources:
- type: nextflow_script
path: main.nf
entrypoint: run_wf
dependencies:
- name: grn_methods/scenicplus

platforms:
- type: nextflow
directives:
label: [ midtime, highmem, highcpu ]
23 changes: 23 additions & 0 deletions src/methods/multi_omics/scenicplus_ns/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
workflow run_wf {
take:
input_ch

main:
output_ch = input_ch

| scenicplus.run(
fromState: [
multiomics_rna: "multiomics_rna",
multiomics_atac: "multiomics_atac",
temp_dir: "temp_dir",
num_workers: "num_workers"

],
toState: [prediction:"prediction", cell_topic:"cell_topic", scplus_mdata:"scplus_mdata"]
)

| setState(["prediction", "cell_topic", "scplus_mdata"])

emit:
output_ch
}
44 changes: 44 additions & 0 deletions src/methods/multi_omics/scenicplus_ns/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

RUN_ID="scenicplus"
resources_dir="s3://openproblems-data/resources_test/grn"
publish_dir="s3://openproblems-data/resources_test/grn/results/${RUN_ID}"

# resources_dir="./resources_test"
# publish_dir="./output/${RUN_ID}"

num_workers=10

param_file="./params/${RUN_ID}.yaml"
# Start writing to the YAML file
cat > $param_file << HERE
param_list:
- id: ${RUN_ID}
multiomics_rna: ${resources_dir}/grn-benchmark/multiomics_rna.h5ad
multiomics_atac: ${resources_dir}/grn-benchmark/multiomics_atac.h5ad
num_workers: $num_workers
temp_dir: tmp/grn
output_state: "state.yaml"
publish_dir: "$publish_dir"
HERE


nextflow run . \
-main-script target/nextflow/workflows/grn_inference_scenicplus/main.nf \
-profile docker \
-with-trace \
-c src/common/nextflow_helpers/labels_ci.config \
-params-file params/${RUN_ID}.yaml


# ./tw-windows-x86_64.exe launch `
# https://github.com/openproblems-bio/task_grn_inference.git `
# --revision build/main `
# --pull-latest `
# --main-script target/nextflow/workflows/grn_inference_scenicplus/main.nf `
# --workspace 53907369739130 `
# --compute-env 6TeIFgV5OY4pJCk8I0bfOh `
# --params-file ./params/scenicplus.yaml `
# --config src/common/nextflow_helpers/labels_tw.config


29 changes: 29 additions & 0 deletions src/methods/multi_omics/scglue_ns/config.novsh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

__merge__: ../../../api/comp_method.yaml

functionality:
name: grn_inference_scglue
namespace: "workflows"
info:
label: grn_inference_scglue
summary: "Infers GRNs from multiomics data using scglue."
arguments:
- name: --annotation_file
type: file
required: true
direction: input
- name: --motif_file
type: file
required: true
direction: input
resources:
- type: nextflow_script
path: main.nf
entrypoint: run_wf
dependencies:
- name: grn_methods/scglue

platforms:
- type: nextflow
directives:
label: [oneweektime,midmem,highcpu]
23 changes: 23 additions & 0 deletions src/methods/multi_omics/scglue_ns/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
workflow run_wf {
take:
input_ch

main:
output_ch = input_ch

| scglue.run(
fromState: [multiomics_rna: "multiomics_rna",
multiomics_atac: "multiomics_atac",
temp_dir: "temp_dir",
num_workers: "num_workers",
annotation_file: "annotation_file",
motif_file: "motif_file"
],
toState: [prediction:"prediction"]
)

| setState(["prediction"])

emit:
output_ch
}
Loading

0 comments on commit 87e46d5

Please sign in to comment.