Skip to content

Commit

Permalink
test runs
Browse files Browse the repository at this point in the history
  • Loading branch information
janursa committed Sep 4, 2024
1 parent 8f28f56 commit 36b0fb4
Show file tree
Hide file tree
Showing 11 changed files with 266 additions and 1,432 deletions.
1,629 changes: 233 additions & 1,396 deletions runs.ipynb

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions scripts/run_benchmark_single_omics.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash

# RUN_ID="run_$(date +%Y-%m-%d_%H-%M-%S)"
RUN_ID="single_omics"
resources_dir="s3://openproblems-data/resources_test/grn"
publish_dir="s3://openproblems-data/resources_test/grn/results/${RUN_ID}"
RUN_ID="single_omics_test"
# 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}"
resources_dir="./resources_test/"
publish_dir="output/${RUN_ID}"

reg_type=ridge
subsample=-2
Expand Down
24 changes: 11 additions & 13 deletions scripts/run_pc_vs_nc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@

subsamples=(-2 -3 -4)

RUN_ID="robust_analy_$1"
resources_dir="resources"
publish_dir="output/${RUN_ID}"
RUN_ID="robust_analy_reg2_$1"
# resources_dir="resources"
resources_dir="s3://openproblems-data/resources/grn"

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

grn_models_folder="${resources_dir}/grn_models"


reg_type=ridge
max_workers=10
layer=pearson
layer=scgen_pearson

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

Expand All @@ -30,7 +29,6 @@ grn_names=(
)



# Start writing to the YAML file
cat > $param_file << HERE
param_list:
Expand Down Expand Up @@ -66,12 +64,12 @@ output_state: "state.yaml"
publish_dir: "$publish_dir"
HERE

nextflow run . \
-main-script target/nextflow/workflows/run_robustness_analysis/main.nf \
-profile docker \
-with-trace \
-c src/common/nextflow_helpers/labels_ci.config \
-params-file ${param_file}
# nextflow run . \
# -main-script target/nextflow/workflows/run_robustness_analysis/main.nf \
# -profile docker \
# -with-trace \
# -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_benchmark.git `
Expand Down
8 changes: 4 additions & 4 deletions scripts/run_robust_analys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# RUN_ID="run_$(date +%Y-%m-%d_%H-%M-%S)"

degrees=(0 10 20 50 100)
noise_type="$1" #"net"
noise_type="$1" #"net", "weight", "sign"
echo $noise_type

RUN_ID="robust_analy_$1"
resources_dir="resources"
# resources_dir="s3://openproblems-data/resources/grn"
RUN_ID="robust_analy_reg2_$1"
# resources_dir="resources"
resources_dir="s3://openproblems-data/resources/grn"

publish_dir="${resources_dir}/results/${RUN_ID}"

Expand Down
2 changes: 1 addition & 1 deletion src/api/comp_method.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ functionality:
__merge__: file_prediction.yaml
required: false
direction: output
default: output/grn.csv
example: output/grn.csv
- name: --temp_dir
type: string
direction: input
Expand Down
2 changes: 1 addition & 1 deletion src/methods/multi_omics/scenicplus/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ functionality:

platforms:
- type: docker
image: apassemi/scenicplus:1.0.0
image: apassemi/scenicplus:1.0.1
setup:
- type: python
packages: [ flatbuffers ]
Expand Down
2 changes: 1 addition & 1 deletion src/methods/multi_omics/scenicplus/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@
os.path.join(out_dir, 'cistarget-db', 'v10nr_clust_public.zip')
)
with zipfile.ZipFile(os.path.join(out_dir, 'cistarget-db', 'v10nr_clust_public.zip'), 'r') as zip_ref:
zip_ref.extractall(os.path.join(out_dir))
zip_ref.extractall(os.path.join(out_dir, 'cistarget-db'))

# Download chromosome sizes
if not os.path.exists(os.path.join(out_dir, 'cistarget-db', 'hg38.chrom.sizes')):
Expand Down
3 changes: 0 additions & 3 deletions src/methods/multi_omics/scglue/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ def cis_inference(par):
if attr["qval"] < 0.05
)


scglue.genomics.Bed(atac.var).write_bed(f"{par['temp_dir']}/peaks.bed", ncols=3)
scglue.genomics.write_links(
gene2peak,
Expand All @@ -150,8 +149,6 @@ def cis_inference(par):
f"{par['temp_dir']}/gene2peak.links", keep_attrs=["score"]
)



motif_bed = scglue.genomics.read_bed(par['motif_file']) ## http://download.gao-lab.org/GLUE/cisreg/JASPAR2022-hg38.bed.gz
tfs = pd.Index(motif_bed["name"]).intersection(rna.var_names)
rna[:, np.union1d(genes, tfs)].write_loom(f"{par['temp_dir']}/rna.loom")
Expand Down
1 change: 1 addition & 0 deletions src/metrics/regression_1/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def main(par):
tf_all = np.loadtxt(par['tf_all'], dtype=str)
gene_names = perturbation_data.var.index.to_numpy()
net = pd.read_csv(par['prediction'])
# net['weight'] = net.weight.abs()
# subset to keep only those links with source as tf
if par['apply_tf']:
net = net[net.source.isin(tf_all)]
Expand Down
2 changes: 1 addition & 1 deletion src/robustness_analysis/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
assert 'weight' in prediction.columns
print('Add noise to weight')
std_dev = prediction['weight'].std()
noise = np.random.normal(0, degree * std_dev, size=prediction['weight'].shape)
noise = np.random.normal(loc=0, scale=degree * std_dev, size=prediction['weight'].shape)
prediction['weight'] += noise

elif type == 'links': # shuffle source-target-weight
Expand Down
15 changes: 8 additions & 7 deletions src/workflows/run_benchmark_single_omics/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ workflow run_wf {
// ]

methods = [
ennet,
grnboost2,
scsgl,
tigress
portia,
// ennet
grnboost2
// scsgl,
// tigress
]

// construct list of metrics
metrics = [
regression_1,
regression_2
regression_1
]

/****************************
Expand Down Expand Up @@ -87,7 +87,8 @@ workflow run_wf {
method_id: comp.config.functionality.name,
prediction: output.prediction
]
}
},
auto: [publish: "state"]
)

// run all metrics
Expand Down

0 comments on commit 36b0fb4

Please sign in to comment.