Skip to content

Commit

Permalink
refomatting completed: v1
Browse files Browse the repository at this point in the history
  • Loading branch information
janursa committed Feb 2, 2025
1 parent a7c0359 commit 065225d
Show file tree
Hide file tree
Showing 50 changed files with 2,099 additions and 710 deletions.
1,093 changes: 1,091 additions & 2 deletions runs.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions scripts/run_grn_evaluation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ grn_models_folder="${resources_dir}/grn_models/" #TODO: change this

reg_type="ridge"
num_workers=10
metric_ids="[regression_1, regression_2]"
metric_ids="[regression_1, regression_2, ws_distance]"

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

Expand Down Expand Up @@ -66,7 +66,7 @@ append_entry() {
regulators_consensus: ${resources_dir}/prior/regulators_consensus_${dataset}.json
ws_consensus: ${resources_dir}/prior/ws_consensus_${dataset}.json
ws_distance_background: ${resources_dir}/prior/ws_distance_background_${dataset}.json
prediction: ${grn_models_folder}/${dataset}/$1.csv
prediction: ${grn_models_folder}/${dataset}/$1.h5ad
layer: "X_norm"
HERE
}
Expand Down
12 changes: 11 additions & 1 deletion src/api/comp_method.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ arguments:
required: false
direction: input
- name: --prediction
__merge__: file_prediction.yaml
__merge__: file_prediction_h5ad.yaml
required: false
direction: output
- name: --tf_all
Expand All @@ -43,6 +43,16 @@ arguments:
type: boolean
direction: input
default: True
- name: --dataset_id
type: string
direction: input
required: false
default: op
- name: --method_id
type: string
direction: input
required: false
default: grnboost2

test_resources:
- type: python_script
Expand Down
37 changes: 0 additions & 37 deletions src/api/comp_method_r.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions src/api/comp_metric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ info:
A metric to evaluate the performance of the inferred GRN
arguments:
- name: --prediction
__merge__: file_prediction.yaml
__merge__: file_prediction_h5ad.yaml
required: true
direction: input
- name: --score
__merge__: file_score.yaml
__merge__: file_score_h5ad.yaml
required: true
direction: output
- name: --method_id
Expand Down
2 changes: 1 addition & 1 deletion src/api/comp_metric_regression.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ info:
arguments:
- name: --evaluation_data
__merge__: file_evaluation_h5ad.yaml
required: false
required: true
direction: input
- name: --tf_all
type: file
Expand Down
19 changes: 0 additions & 19 deletions src/api/file_prediction.yaml

This file was deleted.

22 changes: 22 additions & 0 deletions src/api/file_prediction_h5ad.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

type: file
example: 'resources/grn_models/op/collectri.h5ad'
info:
label: prediction
summary: "File indicating the inferred GRN."
file_type: h5ad
slots:
uns:
- type: string
name: dataset_id
description: "A unique identifier for the dataset"
required: true
- type: string
name: method_id
description: "A unique identifier for the inference method"
required: true
- type: DataFrame
name: prediction
description: "Inferred GRNs in the format of source, target, weight"
required: true

File renamed without changes.
29 changes: 16 additions & 13 deletions src/control_methods/negative_control/config.vsh.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
__merge__: ../../api/comp_method.yaml
functionality:
name: negative_control
namespace: control_methods
info:
label: Negative control
summary: Source-target links based on random assignment
description: |
Randomly assigns regulatory links to tf-target links with a given tf and target list. This is to perform near random.

resources:
- type: python_script
path: script.py
- path: main.py
platforms:
name: negative_control
namespace: control_methods
info:
label: Negative control
summary: Source-target links based on random assignment
description: |
Randomly assigns regulatory links to tf-target links with a given tf and target list. This is to perform near random.
resources:
- type: python_script
path: script.py
- path: main.py
engines:
- type: docker
image: ghcr.io/openproblems-bio/base_python:1.0.4
__merge__: /src/api/base_requirements.yaml
setup:
- type: python
packages: [ ]
runners:
- type: executable
- type: nextflow
directives:
label: [ midtime, highmem, highcpu ]
8 changes: 6 additions & 2 deletions src/control_methods/negative_control/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
}
sys.path.append(meta['resources_dir'])
from main import main
prediction = main(par)
prediction.to_csv(par["prediction"])
net = main(par)

print('Output GRN')
net['weight'] = net['weight'].astype(str)
output = ad.AnnData(X=None, uns={"method_id": par['method_id'], "dataset_id": par['dataset_id'], "prediction": net[["source", "target", "weight"]]})
output.write(par['prediction'])

37 changes: 20 additions & 17 deletions src/control_methods/pearson_corr/config.vsh.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
__merge__: ../../api/comp_method.yaml

functionality:
name: pearson_corr
namespace: control_methods
info:
label: pearson_corr
summary: "Baseline based on correlation"
arguments:
- name: --normalize
type: boolean
default: True
direction: input

resources:
- type: python_script
path: script.py
name: pearson_corr
namespace: control_methods
info:
label: pearson_corr
summary: "Baseline based on correlation"
arguments:
- name: --normalize
type: boolean
default: True
direction: input

- path: /src/utils/util.py
dest: util.py
platforms:
resources:
- type: python_script
path: script.py

- path: /src/utils/util.py
dest: util.py
engines:
- type: docker
image: ghcr.io/openproblems-bio/base_python:1.0.4
__merge__: /src/api/base_requirements.yaml
setup:
- type: python
# packages: [ magic-impute ]
packages: [ ]
- type: native
runners:
- type: executable
- type: nextflow
directives:
label: [midtime, midmem, midcpu]
4 changes: 3 additions & 1 deletion src/control_methods/pearson_corr/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,6 @@ def create_corr_net(par):
net = create_corr_net(par)

print('Output GRN')
net.to_csv(par['prediction'])
net['weight'] = net['weight'].astype(str)
output = ad.AnnData(X=None, uns={"method_id": par['method_id'], "dataset_id": par['dataset_id'], "prediction": net[["source", "target", "weight"]]})
output.write(par['prediction'])
27 changes: 15 additions & 12 deletions src/control_methods/positive_control/config.vsh.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
__merge__: ../../api/comp_method.yaml

functionality:
name: positive_control
namespace: control_methods
info:
label: positive_control
summary: "Baseline based on correlation"

resources:
- type: python_script
path: script.py
- path: /src/utils/util.py
dest: util.py
name: positive_control
namespace: control_methods
info:
label: positive_control
summary: "Baseline based on correlation"

platforms:
resources:
- type: python_script
path: script.py
- path: /src/utils/util.py
dest: util.py

engines:
- type: docker
image: ghcr.io/openproblems-bio/base_python:1.0.4
__merge__: /src/api/base_requirements.yaml
setup:
- type: python
# packages: [ magic-impute ]
packages: [ ]
- type: native
runners:
- type: executable
- type: nextflow
directives:
label: [midtime, midmem, midcpu]
5 changes: 4 additions & 1 deletion src/control_methods/positive_control/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,7 @@ def create_corr_net(par):

net = create_corr_net(par)

net.to_csv(par['prediction'])
print('Output GRN')
net['weight'] = net['weight'].astype(str)
output = ad.AnnData(X=None, uns={"method_id": par['method_id'], "dataset_id": par['dataset_id'], "prediction": net[["source", "target", "weight"]]})
output.write(par['prediction'])
31 changes: 0 additions & 31 deletions src/control_methods/test/config.vsh.yaml

This file was deleted.

Loading

0 comments on commit 065225d

Please sign in to comment.