From de3f8bfd551b4bd960648baed3e86cc87235b7fd Mon Sep 17 00:00:00 2001 From: jahn Date: Tue, 16 Jan 2024 13:19:12 +0100 Subject: [PATCH 1/2] feat: option to add padding between CDS and intergenic region, closes #25 --- .test/config/config.yml | 1 + README.md | 1 + config/README.md | 1 + config/config.yml | 1 + workflow/scripts/design_guides.R | 7 ++++++- 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.test/config/config.yml b/.test/config/config.yml index a2ef1c4..26c0a0f 100644 --- a/.test/config/config.yml +++ b/.test/config/config.yml @@ -10,6 +10,7 @@ design_guides: target_type: ["target", "intergenic", "ntc"] tss_window: [-100, 400] tiling_window: 1000 + tiling_min_dist: 0 circular: False canonical: True strands: "both" diff --git a/README.md b/README.md index 60238a6..bad97e8 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,7 @@ This table lists all parameters that can be used to run the workflow. | target_type | string | specify targets for guide design (see below) | `["target", "intergenic", "ntc"]` | | tss_window | numeric | upstream/downstream window around TSS | `[0, 500]` | | tiling_window | numeric | window size for intergenic regions | `1000` | +| tiling_min_dist | numeric | min distance between TSS and intergenic region | `0` | | circular | logical | is the genome circular? | `False` | | canonical | logical | only canonical PAM sites are included | `True` | | strands | string | target `coding`, `template` or `both` | `both` | diff --git a/config/README.md b/config/README.md index 79a4315..c63f23e 100644 --- a/config/README.md +++ b/config/README.md @@ -62,6 +62,7 @@ This table lists all parameters that can be used to run the workflow. | target_type | string | specify targets for guide design (see below) | `["target", "intergenic", "ntc"]` | | tss_window | numeric | upstream/downstream window around TSS | `[0, 500]` | | tiling_window | numeric | window size for intergenic regions | `1000` | +| tiling_min_dist | numeric | min distance between TSS and intergenic region | `0` | | circular | logical | is the genome circular? | `False` | | canonical | logical | only canonical PAM sites are included | `True` | | strands | string | target `coding`, `template` or `both` | `both` | diff --git a/config/config.yml b/config/config.yml index a2ef1c4..26c0a0f 100644 --- a/config/config.yml +++ b/config/config.yml @@ -10,6 +10,7 @@ design_guides: target_type: ["target", "intergenic", "ntc"] tss_window: [-100, 400] tiling_window: 1000 + tiling_min_dist: 0 circular: False canonical: True strands: "both" diff --git a/workflow/scripts/design_guides.R b/workflow/scripts/design_guides.R index 1c2b34d..ea09d9b 100644 --- a/workflow/scripts/design_guides.R +++ b/workflow/scripts/design_guides.R @@ -112,7 +112,12 @@ if ("target" %in% target_type) { genome(list_tx_window) <- "custom" # for intergenic regions: remove all guides that target within transcripts - index_intergenic <- findOverlaps(list_guides, list_tx_window, ignore.strand = TRUE) + list_total_window <- trim(resize( + list_tx_window, + width = width(list_tx_window) + (tiling_min_dist*2), + fix = "center" + )) + index_intergenic <- findOverlaps(list_guides, list_total_window, ignore.strand = TRUE) list_intergenic <- list_guides[-index_intergenic@from] # select only guides whose PAM overlaps with the TSS window From 9d4598ea1fb21ff262250d961da8efd23de96a46 Mon Sep 17 00:00:00 2001 From: jahn Date: Wed, 17 Jan 2024 18:45:08 +0100 Subject: [PATCH 2/2] feat: added possibility to run with singularity container --- .snakemake-workflow-catalog.yml | 2 +- README.md | 12 ++++++++++-- config/README.md | 8 +++++++- workflow/Snakefile | 6 +++++- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.snakemake-workflow-catalog.yml b/.snakemake-workflow-catalog.yml index 6150272..ac23d4c 100644 --- a/.snakemake-workflow-catalog.yml +++ b/.snakemake-workflow-catalog.yml @@ -2,5 +2,5 @@ usage: software-stack-deployment: conda: true singularity: false - singularity+conda: false + singularity+conda: true report: true diff --git a/README.md b/README.md index bad97e8..03edc64 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ # snakemake-crispr-guides ![Platform](https://img.shields.io/badge/platform-all-green) -[![Snakemake](https://img.shields.io/badge/snakemake-≥6.3.0-brightgreen.svg)](https://snakemake.github.io) +[![Snakemake](https://img.shields.io/badge/snakemake-≥6.3.0-green.svg)](https://snakemake.github.io) [![GitHub actions status](https://github.com/MPUSP/snakemake-crispr-guides/workflows/Tests/badge.svg?branch=main)](https://github.com/MPUSP/snakemake-crispr-guides/actions?query=branch%3Amain+workflow%3ATests) [![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/) +[![run with singularity](https://img.shields.io/badge/run%20with-singularity-1D355C.svg?labelColor=000000)](https://sylabs.io/docs/) +[![workflow catalog](https://img.shields.io/badge/Snakemake%20workflow%20catalog-darkgreen)](https://snakemake.github.io/snakemake-workflow-catalog) --- @@ -152,12 +154,18 @@ Before running the entire workflow, you can perform a dry run using: snakemake --dry-run ``` -To run the complete workflow with test files, execute the following command. The definition of the number of compute cores is mandatory. +To run the complete workflow with test files using **`conda`**, execute the following command. The definition of the number of compute cores is mandatory. ``` snakemake --cores 10 --use-conda ``` +To run the workflow with **`singularity`**, run: + +``` +snakemake --cores 10 --use-singularity --use-conda +``` + To supply a custom config file and/or use options that override the defaults, run the workflow like this: ``` diff --git a/config/README.md b/config/README.md index c63f23e..234709e 100644 --- a/config/README.md +++ b/config/README.md @@ -30,12 +30,18 @@ Before running the entire workflow, you can perform a dry run using: snakemake --dry-run ``` -To run the complete workflow with test files, execute the following command. The definition of the number of compute cores is mandatory. +To run the complete workflow with test files using **`conda`**, execute the following command. The definition of the number of compute cores is mandatory. ``` snakemake --cores 10 --use-conda ``` +To run the workflow with **`singularity`**, run: + +``` +snakemake --cores 10 --use-singularity --use-conda +``` + To supply a custom config file and/or use options that override the defaults, run the workflow like this: ``` diff --git a/workflow/Snakefile b/workflow/Snakefile index 3020a00..8c1c068 100644 --- a/workflow/Snakefile +++ b/workflow/Snakefile @@ -14,11 +14,15 @@ include: "rules/common.smk" -# load and print configuration +# load configuration # ----------------------------------------------------- configfile: "config/config.yml" +# container definition (optional) +container: "oras://ghcr.io/MPUSP/snakemake-crispr-guides:1.1.0" + + # target rule # ----------------------------------------------------- rule all: