Skip to content

Commit

Permalink
portia max link added
Browse files Browse the repository at this point in the history
  • Loading branch information
janursa committed Sep 18, 2024
1 parent f95029d commit 51aba97
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 50 deletions.
49 changes: 24 additions & 25 deletions scripts/run_benchmark_single_omics.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
#!/bin/bash

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


reg_type=ridge
subsample=-2
max_workers=10
layer='scgen_pearson'
metric_ids="[regression_1]"
cell_type_specific=true #for controls
metric_ids="[regression_1, regression_2]"
cell_type_specific=false #for controls
# method_ids="[tigress, ennet, scsgl, pidc]"
method_ids="[pearson_corr, pearson_causal, positive_control]"
method_ids="[pearson_corr, pearson_causal, positive_control, portia, grnboost2]"

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

Expand All @@ -25,8 +24,8 @@ param_list:
metric_ids: $metric_ids
method_ids: $method_ids
perturbation_data: ${resources_dir}/grn-benchmark/perturbation_data.h5ad
multiomics_rna: ${resources_dir}/grn-benchmark/multiomics_rna.h5ad
multiomics_atac: ${resources_dir}/grn-benchmark/multiomics_atac.h5ad
multiomics_rna: ${resources_dir}/grn-benchmark/multiomics_rna_0.h5ad
multiomics_atac: ${resources_dir}/grn-benchmark/multiomics_atac_0.h5ad
reg_type: $reg_type
subsample: $subsample
max_workers: $max_workers
Expand All @@ -39,27 +38,27 @@ output_state: "state.yaml"
publish_dir: "$publish_dir"
HERE

nextflow run . \
-main-script target/nextflow/workflows/run_benchmark_single_omics/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_benchmark/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_inference.git `
# --revision build/main `
# --pull-latest `
# --main-script target/nextflow/workflows/run_benchmark_single_omics/main.nf `
# --workspace 53907369739130 `
# --compute-env 6TeIFgV5OY4pJCk8I0bfOh `
# --params-file ./params/single_omics_inference.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_single_omics/main.nf \
# --main-script target/nextflow/workflows/run_benchmark/main.nf \
# --workspace 53907369739130 \
# --compute-env 6TeIFgV5OY4pJCk8I0bfOh \
# --params-file ${param_file} \
Expand Down
12 changes: 7 additions & 5 deletions src/methods/multi_omics/scenicplus/config.vsh.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__merge__: ../../../api/comp_method_mo.yaml
__merge__: ../../../api/comp_method.yaml


functionality:
Expand Down Expand Up @@ -39,10 +39,12 @@ functionality:

platforms:
- type: docker
image: apassemi/scenicplus:1.0.1
setup:
- type: python
packages: [ flatbuffers ]
# image: apassemi/scenicplus:1.0.1
# image: vanallenlab/scenicplus_x86_64:initial
image: aertslab/pyscenic:0.12.1
# setup:
# - type: python
# packages: [ flatbuffers ]
- type: native
- type: nextflow
directives:
Expand Down
32 changes: 17 additions & 15 deletions src/methods/multi_omics/scenicplus/script.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import os
import sys
import yaml
import pickle
import tempfile
import contextlib
import hashlib
import shutil
import requests
import traceback
import subprocess
import gc
import gzip
import tarfile
# import sys
# import yaml
# import pickle
# import tempfile
# import contextlib
# import hashlib
# import shutil
# import requests
# import traceback
# import subprocess
# import gc
# import gzip
# import tarfile
# from urllib.request import urlretrieve

# import numpy as np
Expand Down Expand Up @@ -59,8 +59,10 @@
# setattr(pycisTopic.loom, 'TSNE', TSNE)
# os.environ['MALLET_MEMORY'] = '200G'

atac_dir = f"output/scenicplus/atac/"
os.makedirs(atac_dir)
atac_dir = f"output/gulack/"
print(atac_dir)
os.makedirs(atac_dir, exist_ok=True)
os.makedirs(f'{atac_dir}/atac', exist_ok=True)
raise ValueError('here')

# Get list of samples (e.g., donors)
Expand Down
5 changes: 3 additions & 2 deletions src/methods/single_omics/portia/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ def infer_grn(X, gene_names):
dataset = pt.GeneExpressionDataset()
for exp_id, data in enumerate(X):
dataset.add(pt.Experiment(exp_id, data))

M_bar = pt.run(dataset, method='no-transform')

ranked_scores = pt.rank_scores(M_bar, gene_names)
limit = min([10000000, X.size])
ranked_scores = pt.rank_scores(M_bar, gene_names, limit=limit)
sources, targets, weights = zip(*[(gene_a, gene_b, score) for gene_a, gene_b, score in ranked_scores])

grn = pd.DataFrame({'source':sources, 'target':targets, 'weight':weights})
Expand Down
5 changes: 4 additions & 1 deletion src/methods/single_omics/portia/test.sh
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
viash run src/methods/single_omics/portia/config.vsh.yaml -- --multiomics_rna resources/grn-benchmark/multiomics_rna_0.h5ad --tf_all resources/prior/tf_all.csv --prediction output/portia/prediction.csv
viash run src/methods/single_omics/portia/config.vsh.yaml -- --multiomics_rna resources_test/grn-benchmark/multiomics_rna.h5ad \
--tf_all resources/prior/tf_all.csv \
--prediction output/portia/prediction.csv \
--cell_type_specific false
3 changes: 1 addition & 2 deletions src/methods/single_omics/scenic/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ functionality:

platforms:
- type: docker
# image: aertslab/pyscenic:0.12.1
image: janursa/scenicplus:19-08-2024
image: aertslab/pyscenic:0.12.1
setup:
# - type: docker
# run: |
Expand Down

0 comments on commit 51aba97

Please sign in to comment.