Skip to content

Commit

Permalink
Merge pull request #26 from MPUSP/dev
Browse files Browse the repository at this point in the history
feat: enable workflow to run with singularity
  • Loading branch information
m-jahn authored Jan 18, 2024
2 parents 78f621d + 9d4598e commit d41f5e4
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .snakemake-workflow-catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ usage:
software-stack-deployment:
conda: true
singularity: false
singularity+conda: false
singularity+conda: true
report: true
1 change: 1 addition & 0 deletions .test/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

---

Expand Down Expand Up @@ -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:

```
Expand All @@ -184,6 +192,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` |
Expand Down
9 changes: 8 additions & 1 deletion config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

```
Expand All @@ -62,6 +68,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` |
Expand Down
1 change: 1 addition & 0 deletions config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 5 additions & 1 deletion workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 6 additions & 1 deletion workflow/scripts/design_guides.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d41f5e4

Please sign in to comment.