From 294566ed3a3ffb9889ead1a94aa5a96fc0d6985f Mon Sep 17 00:00:00 2001 From: Magnus Wahlberg Date: Mon, 23 Sep 2024 14:58:25 +0200 Subject: [PATCH] add environments --- pipelines/annotations.snakefile | 38 ++++++++++++------------ pipelines/annotations/absplice.snakefile | 2 ++ pipelines/annotations/deepSEA.snakefile | 7 ++++- pipelines/annotations/deepripe.snakefile | 6 ++++ 4 files changed, 33 insertions(+), 20 deletions(-) diff --git a/pipelines/annotations.snakefile b/pipelines/annotations.snakefile index aafe0589..2c4a0c4e 100644 --- a/pipelines/annotations.snakefile +++ b/pipelines/annotations.snakefile @@ -204,7 +204,7 @@ if not gene_id_file: resources: mem_mb=lambda wildcards, attempt: 15_000 * (attempt + 1), conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: " ".join( [f"deeprvat_annotations", "create-gene-id-file", "{input}", "{output}"] @@ -216,7 +216,7 @@ rule extract_with_header: output: anno_tmp_dir / "{file_stem}_variants_header.vcf.gz", conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: ( load_bfc @@ -231,7 +231,7 @@ rule extract_variants: output: anno_tmp_dir / "{file_stem}_variants.vcf", conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: " ".join( [ @@ -248,7 +248,7 @@ rule strip_chr_name: output: anno_tmp_dir / "{file_stem}_stripped.vcf.gz", conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: load_hts + """ cut -c 4- {input} | awk -F'\\t' 'BEGIN {{OFS = FS}} {{$3 = "chr"$1"_"$2"_"$4"_"$5; print}}' |bgzip > {output} """ @@ -268,7 +268,7 @@ rule vep: resources: mem_mb=lambda wildcards, attempt: 5_000 * (attempt + 1), conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: " ".join( [ @@ -331,7 +331,7 @@ rule merge_annotations: resources: mem_mb=lambda wildcards, attempt: 5_000 * (attempt + 1), conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: ( "HEADER=$(grep -n '#Uploaded_variation' " @@ -356,7 +356,7 @@ rule concat_annotations: resources: mem_mb=lambda wildcards, attempt: 15_000 * (attempt + 1), conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: " ".join( [ @@ -384,7 +384,7 @@ if(include_deepSEA): annotations_in = anno_dir / "annotations.parquet", annotations_out = anno_dir / "annotations.parquet", conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: " ".join( [ @@ -403,7 +403,7 @@ else: output: chckpt = anno_dir / 'chckpts' / 'merge_deepsea_pcas.chckpt' conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: 'touch {output.chckpt}' @@ -422,7 +422,7 @@ if (include_absplice): resources: mem_mb=lambda wildcards, attempt: 19_000 * (attempt + 1), conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: " ".join( [ @@ -454,7 +454,7 @@ if af_mode is None: resources: mem_mb=lambda wildcards, attempt: 15_000 * (attempt + 1), conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: " ".join( [ @@ -483,7 +483,7 @@ if af_mode is None: resources: mem_mb=lambda wildcards, attempt: 15_000 * (attempt + 1), conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: @@ -508,7 +508,7 @@ if af_mode is None: resources: mem_mb=lambda wildcards, attempt: 15_000 * (attempt + 1), conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: " ".join([f"deeprvat_annotations", "calculate-maf", "{params.annotations_in}", "{params.annotations_out}"])+ " && touch {output.chckpt}" @@ -526,7 +526,7 @@ elif(af_mode == 'af_gnomade'): resources: mem_mb=lambda wildcards, attempt: 15_000 * (attempt + 1), conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: " ".join([f"deeprvat_annotations", "calculate-maf","--af-column-name gnomADe_AF" , "{params.annotations_in}", "{params.annotations_out}"])+ " && touch {output.chckpt}" @@ -544,7 +544,7 @@ elif(af_mode == 'af_gnomadg'): resources: mem_mb=lambda wildcards, attempt: 15_000 * (attempt + 1), conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: " ".join([f"deeprvat_annotations", "calculate-maf", "--af-column-name gnomADg_AF", "{params.annotations_in}", "{params.annotations_out}" ])+ " && touch {output.chckpt}" @@ -563,7 +563,7 @@ rule add_gene_ids: resources: mem_mb=lambda wildcards, attempt: 19_000 * (attempt + 1), conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: " ".join( [ @@ -589,7 +589,7 @@ rule filter_by_exon_distance: resources: mem_mb=lambda wildcards, attempt: 25_000 * (attempt + 1), conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: " ".join( [ @@ -612,7 +612,7 @@ rule compute_plof_column: annotations_out = anno_dir / "annotations.parquet", resources: mem_mb=lambda wildcards, attempt: 15_000 * (attempt + 1), conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: 'deeprvat_annotations compute-plof {params.annotations_in} {params.annotations_out} && touch {output.chckpt}' @@ -630,7 +630,7 @@ rule select_rename_fill_columns: resources: mem_mb=lambda wildcards, attempt: 15_000 * (attempt + 1), conda: - "../deeprvat_annotations.yml" + "../docker/deeprvat_annotations.yml" shell: " ".join( [ diff --git a/pipelines/annotations/absplice.snakefile b/pipelines/annotations/absplice.snakefile index 55f499cc..a9a65029 100644 --- a/pipelines/annotations/absplice.snakefile +++ b/pipelines/annotations/absplice.snakefile @@ -16,6 +16,8 @@ rule aggregate_absplice_scores: threads: ncores_agg_absplice resources: mem_mb=lambda wildcards, attempt: 15_000 * (attempt + 1), + conda: + "../../docker/absplice_env.yml" shell: " ".join( [ diff --git a/pipelines/annotations/deepSEA.snakefile b/pipelines/annotations/deepSEA.snakefile index ece157be..7a7704d1 100644 --- a/pipelines/annotations/deepSEA.snakefile +++ b/pipelines/annotations/deepSEA.snakefile @@ -9,7 +9,8 @@ rule deepSea: resources: mem_mb=lambda wildcards, attempt: 5_000 * (attempt + 1), conda: - "kipoi-veff2" + "../../docker/kipoi-veff2_env.yml" +# "kipoi-veff2" shell: "kipoi_veff2_predict {input.variants} {input.fasta} {output} -l 1000 -m 'DeepSEA/predict' -s 'diff'" @@ -24,6 +25,8 @@ rule concat_deepSea: mem_mb=lambda wildcards, attempt: 50_000 * (attempt + 1), output: anno_dir / "all_variants.deepSea.parquet", + conda: + "../../docker/deeprvat_annotations.yml" shell: " ".join( [ @@ -43,6 +46,8 @@ rule deepSea_PCA: deepSEA_tmp_dir / "deepsea_pca.parquet", resources: mem_mb=lambda wildcards, attempt: 50_000 * (attempt + 1), + conda: + "../../docker/deeprvat_annotations.yml" shell: " ".join( [ diff --git a/pipelines/annotations/deepripe.snakefile b/pipelines/annotations/deepripe.snakefile index 0e441a7b..aaa4d466 100644 --- a/pipelines/annotations/deepripe.snakefile +++ b/pipelines/annotations/deepripe.snakefile @@ -7,6 +7,8 @@ rule deepRiPe_parclip: threads: n_jobs_deepripe resources: mem_mb=lambda wildcards, attempt: 5_000 * (attempt + 1), + conda: + "../../docker/deeprvat_annotations.yml" shell: f"mkdir -p {pybedtools_tmp_path/ 'parclip'} && deeprvat_annotations scorevariants-deepripe {{input.variants}} {anno_dir} {{input.fasta}} {pybedtools_tmp_path/ 'parclip'} {saved_deepripe_models_path} {{threads}} 'parclip'" @@ -20,6 +22,8 @@ rule deepRiPe_eclip_hg2: threads: lambda wildcards, attempt: n_jobs_deepripe * attempt resources: mem_mb=lambda wildcards, attempt: 5_000 * (attempt + 1), + conda: + "../../docker/deeprvat_annotations.yml" shell: f"mkdir -p {pybedtools_tmp_path/ 'hg2'} && deeprvat_annotations scorevariants-deepripe {{input.variants}} {anno_dir} {{input.fasta}} {pybedtools_tmp_path/ 'hg2'} {saved_deepripe_models_path} {{threads}} 'eclip_hg2'" @@ -33,6 +37,8 @@ rule deepRiPe_eclip_k5: threads: lambda wildcards, attempt: n_jobs_deepripe * attempt resources: mem_mb=lambda wildcards, attempt: 5_000 * (attempt + 1), + conda: + "../../docker/deeprvat_annotations.yml" shell: f"mkdir -p {pybedtools_tmp_path/ 'k5'} && deeprvat_annotations scorevariants-deepripe {{input.variants}} {anno_dir} {{input.fasta}} {pybedtools_tmp_path/ 'k5'} {saved_deepripe_models_path} {{threads}} 'eclip_k5'"