Skip to content

Commit

Permalink
normalize as non default for control models
Browse files Browse the repository at this point in the history
  • Loading branch information
janursa committed Sep 19, 2024
1 parent da9c8c4 commit 176065b
Show file tree
Hide file tree
Showing 29 changed files with 308 additions and 5,375 deletions.
2,970 changes: 0 additions & 2,970 deletions runs copy.ipynb

This file was deleted.

2,158 changes: 232 additions & 1,926 deletions runs.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# RUN_ID="run_$(date +%Y-%m-%d_%H-%M-%S)"
RUN_ID="benchmark_donor_0_default"
RUN_ID="benchmark_donor_0_baselines_specific"
# resources_dir="./resources_test/"
resources_dir="s3://openproblems-data/resources/grn"
publish_dir="${resources_dir}/results/${RUN_ID}"
Expand All @@ -11,9 +11,9 @@ subsample=-2
max_workers=10
layer='scgen_pearson'
metric_ids="[regression_1, regression_2]"
cell_type_specific=false #for controls
cell_type_specific=true #for controls
# method_ids="[tigress, ennet, scsgl, pidc]"
method_ids="[pearson_corr, pearson_causal, positive_control, portia, grnboost2]"
method_ids="[pearson_corr, pearson_causal, positive_control]"

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

Expand Down Expand Up @@ -45,21 +45,21 @@ HERE
# -c src/common/nextflow_helpers/labels_ci.config \
# -params-file ${param_file}

./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_benchmark/main.nf `
--workspace 53907369739130 `
--compute-env 6TeIFgV5OY4pJCk8I0bfOh `
--params-file ./params/benchmark_donor_0_default.yaml `
--config src/common/nextflow_helpers/labels_tw.config
# ./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_benchmark/main.nf `
# --workspace 53907369739130 `
# --compute-env 6TeIFgV5OY4pJCk8I0bfOh `
# --params-file ./params/benchmark_donor_0_default.yaml `
# --config src/common/nextflow_helpers/labels_tw.config

# ./tw launch https://github.com/openproblems-bio/task_grn_inference \
# --revision build/main \
# --pull-latest \
# --main-script target/nextflow/workflows/run_benchmark/main.nf \
# --workspace 53907369739130 \
# --compute-env 6TeIFgV5OY4pJCk8I0bfOh \
# --params-file ${param_file} \
# --config src/common/nextflow_helpers/labels_tw.config
./tw launch https://github.com/openproblems-bio/task_grn_inference \
--revision build/main \
--pull-latest \
--main-script target/nextflow/workflows/run_benchmark/main.nf \
--workspace 53907369739130 \
--compute-env 6TeIFgV5OY4pJCk8I0bfOh \
--params-file ${param_file} \
--config src/common/nextflow_helpers/labels_tw.config
11 changes: 0 additions & 11 deletions scripts/sbatch/batch_grnboost2.sh

This file was deleted.

7 changes: 5 additions & 2 deletions scripts/sbatch/batch_scenic.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#!/bin/bash
#SBATCH --time=12:00:00
#SBATCH --job-name=scenic
#SBATCH --job-name=genie3
#SBATCH --output=logs/%j.out
#SBATCH --error=logs/%j.err
#SBATCH --mail-type=END
#SBATCH [email protected]
#SBATCH --cpus-per-task=20
#SBATCH --mem=64G

singularity exec ../../images/scenic python src/methods/single_omics/scenic/script.py
# singularity exec ../../images/scenic python src/methods/single_omics/scenic/script.py
# singularity exec ../../images/scenic python src/methods/single_omics/grnboost2/script.py
singularity exec ../../images/scenic python src/methods/single_omics/genie3/script.py

4 changes: 4 additions & 0 deletions src/api/comp_method.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ functionality:
type: boolean
direction: input
default: true
- name: --normalize
type: boolean
direction: input
default: false



Expand Down
10 changes: 5 additions & 5 deletions src/control_methods/pearson/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ def create_corr_net(X, gene_names, groups, par):
tf_all = np.loadtxt(par['tf_all'], dtype=str)
groups = multiomics_rna.obs.cell_type
tf_all = np.intersect1d(tf_all, gene_names)

print('Noramlize data')
sc.pp.normalize_total(multiomics_rna)
sc.pp.log1p(multiomics_rna)
sc.pp.scale(multiomics_rna)
if par['normalize']:
print('Noramlize data')
sc.pp.normalize_total(multiomics_rna)
sc.pp.log1p(multiomics_rna)
sc.pp.scale(multiomics_rna)

print('Create corr net')
net = create_corr_net(multiomics_rna.X, multiomics_rna.var_names, groups, par)
Expand Down
9 changes: 5 additions & 4 deletions src/control_methods/pearson_causal/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ def create_corr_net(X, gene_names, groups, par):
groups = multiomics_rna.obs.cell_type
tf_all = np.intersect1d(tf_all, gene_names)

print('Noramlize data')
sc.pp.normalize_total(multiomics_rna)
sc.pp.log1p(multiomics_rna)
sc.pp.scale(multiomics_rna)
if par['normalize']:
print('Noramlize data')
sc.pp.normalize_total(multiomics_rna)
sc.pp.log1p(multiomics_rna)
sc.pp.scale(multiomics_rna)

print('Create corr net')
net = create_corr_net(multiomics_rna.X, multiomics_rna.var_names, groups, par)
Expand Down
7 changes: 6 additions & 1 deletion src/control_methods/positive_control/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,18 @@ def create_corr_net(X, gene_names, groups, par):
multiomics_rna = ad.read_h5ad(par["perturbation_data"])


if par['normalize']:
print('Noramlize data')
sc.pp.normalize_total(multiomics_rna)
sc.pp.log1p(multiomics_rna)
sc.pp.scale(multiomics_rna)

gene_names = multiomics_rna.var_names.to_numpy()
tf_all = np.loadtxt(par['tf_all'], dtype=str)
groups = multiomics_rna.obs.cell_type
tf_all = np.intersect1d(tf_all, gene_names)



print('Create corr net')
net = create_corr_net(multiomics_rna.X, multiomics_rna.var_names, groups, par)

Expand Down
13 changes: 7 additions & 6 deletions src/methods/multi_omics/celloracle/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@

## VIASH START
par = {
"multiomics_rna": "resources/grn-benchmark/multiomics_rna.h5ad",
"multiomics_atac": "resources/grn-benchmark/multiomics_atac.h5ad",
"multiomics_rna": "resources_test/grn-benchmark/multiomics_rna.h5ad",
"multiomics_atac": "resources_test/grn-benchmark/multiomics_atac.h5ad",
"base_grn": 'output/celloracle/base_grn.csv',
"temp_dir": 'output/celloracle/',
"num_workers": 4,
"prediction": "output/prediction.h5ad",
"prediction": "output/celloracle_test.h5ad",
}
## VIASH END
# meta = {
# "resources_dir":'resources'
# }
meta = {
"resources_dir":'src/methods/multi_omics/celloracle'
}
par['links'] = f"{par['temp_dir']}/links.celloracle.links"

sys.path.append(meta["resources_dir"])
Expand Down
29 changes: 0 additions & 29 deletions src/methods/multi_omics/celloracle_ns/config.novsh.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions src/methods/multi_omics/celloracle_ns/main.nf

This file was deleted.

61 changes: 0 additions & 61 deletions src/methods/multi_omics/celloracle_ns/run.sh

This file was deleted.

27 changes: 0 additions & 27 deletions src/methods/multi_omics/granie_ns/config.novsh.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions src/methods/multi_omics/granie_ns/main.nf

This file was deleted.

35 changes: 0 additions & 35 deletions src/methods/multi_omics/granie_ns/run.sh

This file was deleted.

Loading

0 comments on commit 176065b

Please sign in to comment.