Skip to content

Commit

Permalink
comment global.yaml, add nodefaults and replace snakemake@source
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichl committed Dec 20, 2024
1 parent ce16f56 commit 6613f9f
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion workflow/Snakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

##### global workflow dependencies #####
conda: "envs/global.yaml"
# conda: "envs/global.yaml"

##### libraries #####
import os
Expand Down
2 changes: 1 addition & 1 deletion workflow/envs/seurat_lda.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
channels:
- conda-forge
- bioconda
- defaults
- nodefaults
dependencies:
- r-seurat=4.4.0
- r-irlba=2.3.5.1
Expand Down
2 changes: 1 addition & 1 deletion workflow/envs/seurat_mixscape.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
channels:
- conda-forge
- bioconda
- defaults
- nodefaults
dependencies:
- r-seurat=4.4.0
- r-matrix=1.6_5
Expand Down
4 changes: 4 additions & 0 deletions workflow/rules/mixscape.smk
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ rule mixscape:
"type": "Statistic",
"misc": "PNG",
}),
params:
utils_path = workflow.source_path("../scripts/utils.R"),
resources:
mem_mb=config.get("mem", "16000"),
threads: 8*config.get("threads", 1)
Expand Down Expand Up @@ -47,6 +49,8 @@ rule lda:
"type": "UMAP",
"misc": "PNG",
}),
params:
utils_path = workflow.source_path("../scripts/utils.R"),
resources:
mem_mb=config.get("mem", "16000"),
threads: config.get("threads", 1)
Expand Down
2 changes: 2 additions & 0 deletions workflow/rules/visualize.smk
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rule visualize:
"type": "Expression",
"misc": "Violin",
}) if config["Antibody_Capture"]!="" else [],
params:
utils_path = workflow.source_path("../scripts/utils.R"),
resources:
mem_mb=config.get("mem", "16000"),
threads: config.get("threads", 1)
Expand Down
3 changes: 2 additions & 1 deletion workflow/scripts/lda.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ library("scales")

# source utility functions
# source("workflow/scripts/utils.R")
snakemake@source("./utils.R")
# snakemake@source("./utils.R") # does not work when loaded as module (https://github.com/snakemake/snakemake/issues/2205)
source(snakemake@params[["utils_path"]])

# set expressions option to maximum to avoid "Error: protect(): protection stack overflow"
# from here: https://stackoverflow.com/questions/32826906/how-to-solve-protection-stack-overflow-issue-in-r-studio
Expand Down
3 changes: 2 additions & 1 deletion workflow/scripts/mixscape.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ library("ggplot2")

# source utility functions
# source("workflow/scripts/utils.R")
snakemake@source("./utils.R")
# snakemake@source("./utils.R") # does not work when loaded as module (https://github.com/snakemake/snakemake/issues/2205)
source(snakemake@params[["utils_path"]])

# inputs
filtered_object_path <- snakemake@input[[1]]
Expand Down
3 changes: 2 additions & 1 deletion workflow/scripts/visualize.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ library("patchwork")

# source utility functions
# source("workflow/scripts/utils.R")
snakemake@source("./utils.R")
# snakemake@source("./utils.R") # does not work when loaded as module (https://github.com/snakemake/snakemake/issues/2205)
source(snakemake@params[["utils_path"]])

# inputs
mixscape_object_path <- snakemake@input[["mixscape_object"]]
Expand Down

0 comments on commit 6613f9f

Please sign in to comment.