diff --git a/config/sbatch.yml b/config/sbatch.yml index 7655b14..ed0bbdd 100644 --- a/config/sbatch.yml +++ b/config/sbatch.yml @@ -1,48 +1,58 @@ --- __default__: - time: "0-00:20" - threads: 1 - mem: 2G - queue: debug - error: "logs/%x_%j_%N.err" - output: "logs/%x_%j_%N.log" + time: "0-00:20:00" + threads: 1 + mem: 2G + queue: debug + error: "logs/%x_%j_%N.err" + output: "logs/%x_%j_%N.log" +regression_input_get_training: + time: "0-02:00" + threads: 1 + mem: 5G + queue: short +regression_input_get_test: + time: "0-02:00" + threads: 1 + mem: 5G + queue: short sequence_selection_negative_background_widnows: - time: "0-01:00" - threads: 1 - mem: 10G + time: "0-01:00:00" + threads: 1 + mem: 10G sequence_selection_negative_background_input: - time: "0-01:00" - threads: 1 - mem: 10G + time: "0-01:00" + threads: 1 + mem: 10G sequence_selection_negative_background_sampler: - time: "0-01:00" - threads: 1 - mem: 20G + time: "0-01:00" + threads: 1 + mem: 20G training_multitask: - time: "5-00:00" - mem: 30G - threads: 25 - queue: gpu --gres=gpu:tesla:4 + time: "5-00:00" + mem: 30G + threads: 25 + queue: gpu --gres=gpu:tesla:2 predict_fromFasta: - time: "0-02:00" - mem: 30G - threads: 1 - queue: gpu --gres=gpu:tesla:1 + time: "0-02:00" + mem: 30G + threads: 1 + queue: gpu --gres=gpu:tesla:1 training_regression: time: "0-08:00" - mem: 30G - threads: 25 - queue: gpu --gres=gpu:tesla:4 + mem: 10G + threads: 1 + queue: gpu --gres=gpu:tesla:1 predict_regression: time: "0-02:00" mem: 30G threads: 1 queue: gpu --gres=gpu:tesla:1 model_interpretation_runBackgroundSampler: - time: "0-10:00" - threads: 4 - mem: 80G - queue: medium + time: "0-10:00" + threads: 4 + mem: 80G + queue: medium model_interpretation_deepexplain: time: "1-00:00" mem: 30G @@ -72,4 +82,4 @@ plot_satmut_predict_region: time: "0-00:10" mem: 10G threads: 1 - queue: gpu --gres=gpu:tesla:1 \ No newline at end of file + queue: gpu --gres=gpu:tesla:1 diff --git a/workflow/envs/deepexplain_gpu.yml b/workflow/envs/deepexplain_gpu.yml index bc46536..713eecc 100644 --- a/workflow/envs/deepexplain_gpu.yml +++ b/workflow/envs/deepexplain_gpu.yml @@ -1,7 +1,6 @@ channels: - conda-forge - bioconda - - defaults channel_priority: true dependencies: - python diff --git a/workflow/envs/deeplift_gpu.yml b/workflow/envs/deeplift_gpu.yml index 5ab977f..3651a40 100644 --- a/workflow/envs/deeplift_gpu.yml +++ b/workflow/envs/deeplift_gpu.yml @@ -1,7 +1,6 @@ channels: - conda-forge - bioconda - - defaults dependencies: - click - kipoi diff --git a/workflow/envs/default.yml b/workflow/envs/default.yml index 2540237..68ee0cd 100644 --- a/workflow/envs/default.yml +++ b/workflow/envs/default.yml @@ -3,7 +3,6 @@ channels: - conda-forge - bioconda - - defaults dependencies: - bc - click diff --git a/workflow/envs/legnet.yml b/workflow/envs/legnet.yml index dda0f96..af3390f 100644 --- a/workflow/envs/legnet.yml +++ b/workflow/envs/legnet.yml @@ -3,7 +3,6 @@ name: legnet channels: - conda-forge - bioconda - - defaults dependencies: - _libgcc_mutex=0.1=conda_forge - _openmp_mutex=4.5=2_kmp_llvm diff --git a/workflow/envs/negative_training_sampler.yml b/workflow/envs/negative_training_sampler.yml index a27411a..06c12fa 100644 --- a/workflow/envs/negative_training_sampler.yml +++ b/workflow/envs/negative_training_sampler.yml @@ -3,6 +3,5 @@ channels: - conda-forge - bioconda - - defaults dependencies: - negative_training_sampler diff --git a/workflow/envs/plot_ism_regions.yaml b/workflow/envs/plot_ism_regions.yaml index 11dc806..0a679bb 100644 --- a/workflow/envs/plot_ism_regions.yaml +++ b/workflow/envs/plot_ism_regions.yaml @@ -2,7 +2,6 @@ channels: - conda-forge - bioconda - - defaults dependencies: - click - h5py diff --git a/workflow/envs/plot_satmut.yaml b/workflow/envs/plot_satmut.yaml index a7f719e..6b73048 100644 --- a/workflow/envs/plot_satmut.yaml +++ b/workflow/envs/plot_satmut.yaml @@ -2,7 +2,6 @@ channels: - conda-forge - bioconda - - defaults dependencies: - r-tidyverse - r-optparse diff --git a/workflow/envs/plot_satmut_regions.yaml b/workflow/envs/plot_satmut_regions.yaml index 70154fe..3a884f1 100644 --- a/workflow/envs/plot_satmut_regions.yaml +++ b/workflow/envs/plot_satmut_regions.yaml @@ -2,7 +2,6 @@ channels: - conda-forge - bioconda - - defaults dependencies: - click - h5py diff --git a/workflow/envs/samtools.yaml b/workflow/envs/samtools.yaml index 0e6a31e..c045f12 100644 --- a/workflow/envs/samtools.yaml +++ b/workflow/envs/samtools.yaml @@ -3,7 +3,6 @@ channels: - conda-forge - bioconda - - defaults dependencies: - samtools - bedtools diff --git a/workflow/envs/tensorflow.yml b/workflow/envs/tensorflow.yml index 66f570b..faed509 100644 --- a/workflow/envs/tensorflow.yml +++ b/workflow/envs/tensorflow.yml @@ -2,15 +2,18 @@ channels: - conda-forge - bioconda - - defaults + - anaconda dependencies: - - click - - kipoi - - kipoi-utils - - kipoiseq - - numpy - - pandas - - python + - click==8.1.8 + - kipoi==0.8.6 + - kipoi-utils==0.7.7 + - kipoiseq==0.7.1 + - numpy==1.23.4 + - pandas==1.3.5 + - python==3.9 - pybedtools - - tensorflow - - tensorflow-gpu + - tensorflow==2.6.2 + - tensorflow-gpu <2.14 + - cudatoolkit + - cudnn + - nccl diff --git a/workflow/envs/tfmodisco-lite.yml b/workflow/envs/tfmodisco-lite.yml index 153b66c..930dd8f 100644 --- a/workflow/envs/tfmodisco-lite.yml +++ b/workflow/envs/tfmodisco-lite.yml @@ -2,7 +2,6 @@ channels: - conda-forge - bioconda - - defaults dependencies: - click - h5py diff --git a/workflow/envs/tfmodisco.yml b/workflow/envs/tfmodisco.yml index c684321..34c2420 100644 --- a/workflow/envs/tfmodisco.yml +++ b/workflow/envs/tfmodisco.yml @@ -2,7 +2,6 @@ channels: - conda-forge - bioconda - - defaults dependencies: - click - h5py diff --git a/workflow/rules/common.smk b/workflow/rules/common.smk index a7f2076..7d14076 100644 --- a/workflow/rules/common.smk +++ b/workflow/rules/common.smk @@ -1,14 +1,12 @@ ################################ #### Global functions #### ################################ -from snakemake.workflow import srcdir - -SCRIPTS_DIR = srcdir("../scripts") -RESOURCES_DIR = srcdir("../../resources") - +import os +RESOURCES_DIR = os.path.abspath("../../resources") +SCRIPTS_DIR = "../scripts" def getScript(name): - return "%s/%s" % (SCRIPTS_DIR, name) + return os.path.join(os.path.dirname(workflow.main_snakefile), 'scripts', name) from snakemake.utils import validate @@ -56,7 +54,8 @@ def getWrapperPath(file): """ Get directory for snakemake wrappers. """ - return "%s/%s" % (config["wrapper_directory"], file) + abs_path = os.path.abspath(os.path.join(config["wrapper_directory"], file)) + return abs_path def isPretrained(): diff --git a/workflow/rules/model_interpretation.smk b/workflow/rules/model_interpretation.smk index 1a93676..4581977 100644 --- a/workflow/rules/model_interpretation.smk +++ b/workflow/rules/model_interpretation.smk @@ -216,7 +216,7 @@ rule model_interpretation_ism: ## tf-modisco-ism rule model_interpretation_ism_concat: conda: - "../envs/tfmodisco.yml" + "../envs/tfmodisco-lite.yml" input: scores=lambda wc: expand( "results/model_interpretation/ism/scores.{{test_fold}}.{validation_fold}.h5", @@ -237,26 +237,26 @@ rule model_interpretation_ism_concat: """ -rule model_interpretation_tfmodisco_ism: - conda: - "../envs/tfmodisco.yml" - input: - scores=expand( - "results/model_interpretation/ism/scores_concat.{test_fold}.h5", - test_fold=list(range(1, 11)), - ), - script=getScript("tfmodisco_single_task.py"), - output: - hdf5="results/model_interpretation/ism/tfmodisco/tfmodisco.hdf5", - log: - "logs/model_interpretation/tfmodisco_ism.log", - shell: - """ - scores=`for i in {input.scores}; do echo "--scores $i"; done`; - python {input.script} \ - `echo $scores` \ - --output {output.hdf5} &> {log} - """ +# rule model_interpretation_tfmodisco_ism: +# conda: +# "../envs/tfmodisco.yml" +# input: +# scores=expand( +# "results/model_interpretation/ism/scores_concat.{test_fold}.h5", +# test_fold=list(range(1, 11)), +# ), +# script=getScript("tfmodisco_single_task.py"), +# output: +# hdf5="results/model_interpretation/ism/tfmodisco/tfmodisco.hdf5", +# log: +# "logs/model_interpretation/tfmodisco_ism.log", +# shell: +# """ +# scores=`for i in {input.scores}; do echo "--scores $i"; done`; +# python {input.script} \ +# `echo $scores` \ +# --output {output.hdf5} &> {log} +# """ rule model_interpretation_tfmodisco_lite_ism: @@ -306,26 +306,26 @@ rule model_interpretation_tfmodisco_lite_report_ism: ## tf-modisco1 -rule model_interpretation_tfmodisco1: - conda: - "../envs/tfmodisco.yml" - input: - scores="results/model_interpretation/ism/scores.{test_fold}.{validation_fold}.h5", - script=getScript("tf_modisco.py"), - output: - hdf5="results/model_interpretation/ism/tfmodisco/tfModisco.{test_fold}.{validation_fold}.hdf5", - fig_dir=directory( - "results/model_interpretation/ism/tfmodisco/figures.{test_fold}.{validation_fold}/" - ), - log: - "logs/model_interpretation/tfmodisco1.{test_fold}.{validation_fold}.log", - shell: - """ - python {input.script} \ - --input {input.scores} \ - --output {output.hdf5} \ - --output-figures-dir {output.fig_dir} &> {log} - """ +# rule model_interpretation_tfmodisco1: +# conda: +# "../envs/tfmodisco.yml" +# input: +# scores="results/model_interpretation/ism/scores.{test_fold}.{validation_fold}.h5", +# script=getScript("tf_modisco.py"), +# output: +# hdf5="results/model_interpretation/ism/tfmodisco/tfModisco.{test_fold}.{validation_fold}.hdf5", +# fig_dir=directory( +# "results/model_interpretation/ism/tfmodisco/figures.{test_fold}.{validation_fold}/" +# ), +# log: +# "logs/model_interpretation/tfmodisco1.{test_fold}.{validation_fold}.log", +# shell: +# """ +# python {input.script} \ +# --input {input.scores} \ +# --output {output.hdf5} \ +# --output-figures-dir {output.fig_dir} &> {log} +# """ rule model_interpretation_tfmodisco2: diff --git a/workflow/rules/plot_ism.smk b/workflow/rules/plot_ism.smk index e948646..f178afc 100644 --- a/workflow/rules/plot_ism.smk +++ b/workflow/rules/plot_ism.smk @@ -1,7 +1,7 @@ wildcard_constraints: - region="[^/.]+", - sequence_length="\d+", - target="\d+", + region=r"[^/.]+", + sequence_length=r"\d+", + target=r"\d+", rule plot_ism_get_region: diff --git a/workflow/rules/training.smk b/workflow/rules/training.smk index 82aebbd..98a305f 100644 --- a/workflow/rules/training.smk +++ b/workflow/rules/training.smk @@ -75,7 +75,6 @@ else: else "", conda: "../envs/tensorflow.yml" - threads: 25 shell: """ python {input.script} \