Skip to content

Commit

Permalink
add environments
Browse files Browse the repository at this point in the history
  • Loading branch information
endast committed Sep 23, 2024
1 parent 9a7d518 commit 294566e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 20 deletions.
38 changes: 19 additions & 19 deletions pipelines/annotations.snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}"]
Expand All @@ -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
Expand All @@ -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(
[
Expand All @@ -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} """

Expand All @@ -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(
[
Expand Down Expand Up @@ -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' "
Expand All @@ -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(
[
Expand Down Expand Up @@ -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(
[
Expand All @@ -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}'

Expand All @@ -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(
[
Expand Down Expand Up @@ -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(
[
Expand Down Expand Up @@ -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:
Expand All @@ -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}"

Expand All @@ -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}"

Expand All @@ -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}"

Expand All @@ -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(
[
Expand All @@ -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(
[
Expand All @@ -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}'


Expand All @@ -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(
[
Expand Down
2 changes: 2 additions & 0 deletions pipelines/annotations/absplice.snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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(
[
Expand Down
7 changes: 6 additions & 1 deletion pipelines/annotations/deepSEA.snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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'"

Expand All @@ -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(
[
Expand All @@ -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(
[
Expand Down
6 changes: 6 additions & 0 deletions pipelines/annotations/deepripe.snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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'"

Expand All @@ -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'"

Expand All @@ -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'"

0 comments on commit 294566e

Please sign in to comment.