Skip to content

Commit

Permalink
restructuring viash configs
Browse files Browse the repository at this point in the history
  • Loading branch information
janursa committed Sep 13, 2024
1 parent 4514482 commit 85c6435
Show file tree
Hide file tree
Showing 33 changed files with 468 additions and 755 deletions.
606 changes: 272 additions & 334 deletions runs.ipynb

Large diffs are not rendered by default.

23 changes: 9 additions & 14 deletions scripts/run_grn_evaluation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ grn_models_folder="${resources_dir}/grn_models"
subsample=-2
max_workers=10
layer=scgen_pearson
metric_ids="[regression_1, regression_2]"
metric_ids="[regression_1]"

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

Expand Down Expand Up @@ -67,19 +67,14 @@ append_entry_control() {
causal: ${2}
corr_method: ${3}
prediction: ${resources_dir}/grn_models/collectri.csv
cell_type_specific: ${4}
metacell: ${5}
impute: ${6}
HERE
if [ -n "$4" ]; then
echo " cell_type_specific: ${4}" >> $param_file
fi
if [ -n "$5" ]; then
echo " metacell: ${5}" >> $param_file
fi
if [ -n "$6" ]; then
echo " impute: ${6}" >> $param_file
fi

}

# #Loop through grn_names and layers
#Loop through grn_names and layers
# for grn_name in "${grn_names[@]}"; do
# append_entry "$grn_name"
# done
Expand All @@ -88,12 +83,12 @@ HERE
# append_entry_control "negative_control" "False" ""
# append_entry_control "positive_control" "False" ""
# append_entry_control "baseline_pearson" "False" "pearson"
# append_entry_control "baseline_dotproduct" "False" "dotproduct"
append_entry_control "baseline_dotproduct" "False" "dotproduct" "false" "false" "false"
# append_entry_control "baseline_pearson_causal" "True" "pearson"
append_entry_control "baseline_dotproduct_causal" "True" "dotproduct"
append_entry_control "baseline_dotproduct_causal" "True" "dotproduct" "false" "false" "false"
# append_entry_control "baseline_dotproduct_causal_cell_type" "True" "dotproduct" "true"
# append_entry_control "baseline_dotproduct_causal_metacell" "True" "dotproduct" "false" "true"
append_entry_control "baseline_dotproduct_causal_impute" "True" "dotproduct" "false" "false" "true"
# append_entry_control "baseline_dotproduct_causal_impute" "True" "dotproduct" "false" "false" "true"
# append_entry_control "baseline_corr_causal_spearman" "True" "spearman"


Expand Down
36 changes: 0 additions & 36 deletions src/api/comp_control_method.yaml

This file was deleted.

43 changes: 22 additions & 21 deletions src/api/comp_method.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,38 @@ functionality:
arguments:
- name: --multiomics_rna
__merge__: file_multiomics_rna_h5ad.yaml
required: false
required: true
direction: input
default: resources/grn-benchmark/multiomics_rna.h5ad
- name: --multiomics_atac
__merge__: file_multiomics_atac_h5ad.yaml
required: false
direction: input
must_exist: false
default: resources/grn-benchmark/multiomics_atac.h5ad
example: resources_test/grn-benchmark/multiomics_rna.h5ad
- name: --prediction
__merge__: file_prediction.yaml
required: false
required: true
direction: output
example: output/prediction.csv
default: output/prediction.csv
- name: --temp_dir
type: string
example: resources_test/grn_models/collectri.csv
- name: --tf_all
type: file
required: true
direction: input
default: output/temdir
example: resources_test/prior/tf_all.csv
- name: --max_n_links
type: integer
default: 50000
- name: --num_workers
type: integer
direction: input
default: 4
- name: --tf_all
type: file
example: resources/prior/tf_all.csv
default: resources/prior/tf_all.csv
required: false
- name: --max_n_links
- name: --temp_dir
type: string
direction: input
default: output/temdir
- name: --seed
type: integer
default: 50000
direction: input
default: 32





test_resources:
- type: python_script
Expand Down
17 changes: 17 additions & 0 deletions src/api/comp_method_mo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
__merge__: comp_method.yaml

functionality:
info:
type: methods
type_info:
label: Method
summary: A GRN inference method for multiomics grn
description: |
A method for inferring GRN from atac and rna data.
arguments:
- name: --multiomics_atac
__merge__: file_multiomics_atac_h5ad.yaml
required: true
direction: input
must_exist: false
example: resources_test/grn-benchmark/multiomics_atac.h5ad
2 changes: 1 addition & 1 deletion src/api/comp_method_r.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
functionality:
namespace: "methods_r"
namespace: "methods"
info:
type: methods_r
type_info:
Expand Down
18 changes: 10 additions & 8 deletions src/api/comp_metric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@ functionality:
__merge__: file_perturbation_h5ad.yaml
required: false
direction: input
default: resources/grn-benchmark/perturbation_data.h5ad
- name: --prediction
__merge__: file_prediction.yaml
required: true
direction: input

- name: --score
__merge__: file_score.yaml
required: false
direction: output
default: output/score.h5ad
- name: --tf_all
type: file
direction: input
required: true
example: resources_test/prior/tf_all.csv
- name: --reg_type
type: string
direction: input
Expand All @@ -43,11 +45,6 @@ functionality:
direction: input
required: false
example: collectri
- name: --tf_all
type: file
direction: input
example: resources_test/prior/tf_all.csv
default: resources/prior/tf_all.csv
- name: --apply_tf
type: boolean
required: false
Expand All @@ -57,6 +54,11 @@ functionality:
required: false
default: true
description: clips the r2 scores for each gene to make them within [0, 1]
- name: --layer
type: string
direction: input
required: false
default: scgen_pearson



Expand Down
16 changes: 5 additions & 11 deletions src/control_methods/baseline_corr/config.vsh.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
__merge__: ../../api/comp_control_method.yaml
__merge__: ../../api/comp_method.yaml

functionality:
name: baseline_corr
namespace: control_methods
info:
label: baseline_corr
summary: "Baseline based on Pearson corr"
summary: "Baseline based on correlation"
arguments:

- name: --causal
type: boolean
direction: input
default: false
- name: --seed
type: integer
direction: input
- name: --multiomics_rna
type: file
required: true
direction: input
example: resources_test/grn-benchmark/multiomics_rna.h5ad
- name: --corr_method
type: string
required: false
Expand Down Expand Up @@ -50,7 +43,8 @@ platforms:
image: ghcr.io/openproblems-bio/base_python:1.0.4
setup:
- type: python
packages: [ magic-impute ]
# packages: [ magic-impute ]
packages: [ ]
- type: native
- type: nextflow
directives:
Expand Down
2 changes: 1 addition & 1 deletion src/control_methods/baseline_corr/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def create_corr_net(X: np.ndarray, groups: np.ndarray, method="pearson"):
return grn
print('Read data')
multiomics_rna = ad.read_h5ad(par["multiomics_rna"])
# multiomics_rna = multiomics_rna[:,:2000] #TODO: togo
multiomics_rna = multiomics_rna[:,:2000] #TODO: togo

if par['metacell']:
print('metacell')
Expand Down
7 changes: 4 additions & 3 deletions src/control_methods/negative_control/config.vsh.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
__merge__: ../../api/comp_control_method.yaml
__merge__: ../../api/comp_method.yaml
functionality:
name: negative_control
namespace: control_methods
info:
label: Negative control
summary: Source-target links based on random assignment
Expand All @@ -9,9 +10,9 @@ functionality:
arguments:
- name: --perturbation_data
type: file
required: false
required: true
direction: input
default: resources/grn-benchmark/perturbation_data.h5ad
example: resources_test/grn-benchmark/perturbation_data.h5ad

resources:
- type: python_script
Expand Down
7 changes: 4 additions & 3 deletions src/control_methods/positive_control/config.vsh.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
__merge__: ../../api/comp_control_method.yaml
__merge__: ../../api/comp_method.yaml
functionality:
name: positive_control
namespace: control_methods
info:
label: Positive control
summary: Source-target links based on perturbation data
Expand All @@ -9,9 +10,9 @@ functionality:
arguments:
- name: --perturbation_data
type: file
required: false
required: true
direction: input
default: resources/grn-benchmark/perturbation_data.h5ad
example: resources_test/grn-benchmark/perturbation_data.h5ad

resources:
- type: python_script
Expand Down
39 changes: 0 additions & 39 deletions src/methods/dummy/config.vsh.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions src/methods/dummy/run.sh

This file was deleted.

36 changes: 0 additions & 36 deletions src/methods/dummy/script.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__merge__: ../../../api/comp_method.yaml
__merge__: ../../../api/comp_method_mo.yaml

functionality:
name: celloracle
Expand Down
Loading

0 comments on commit 85c6435

Please sign in to comment.