Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Ensure that the PR title follows conventional commit style (<type>: <description>)--> <!-- Possible types are here: https://github.com/commitizen/conventional-commit-types/blob/master/index.json --> ### Description This meta-wrapper simply aligns, filters and deduplicates reads. I've been helping co-workers with Snakemake basics and snakemake-wrappers, and I used this very short pipeline. ### QC <!-- Make sure that you can tick the boxes below. --> * [X] I confirm that: For all wrappers added by this PR, * there is a test case which covers any introduced changes, * `input:` and `output:` file paths in the resulting rule can be changed arbitrarily, * either the wrapper can only use a single core, or the example rule contains a `threads: x` statement with `x` being a reasonable default, * rule names in the test case are in [snake_case](https://en.wikipedia.org/wiki/Snake_case) and somehow tell what the rule is about or match the tools purpose or name (e.g., `map_reads` for a step that maps reads), * all `environment.yaml` specifications follow [the respective best practices](https://stackoverflow.com/a/64594513/2352071), * wherever possible, command line arguments are inferred and set automatically (e.g. based on file extensions in `input:` or `output:`), * all fields of the example rules in the `Snakefile`s and their entries are explained via comments (`input:`/`output:`/`params:` etc.), * `stderr` and/or `stdout` are logged correctly (`log:`), depending on the wrapped tool, * temporary files are either written to a unique hidden folder in the working directory, or (better) stored where the Python function `tempfile.gettempdir()` points to (see [here](https://docs.python.org/3/library/tempfile.html#tempfile.gettempdir); this also means that using any Python `tempfile` default behavior works), * the `meta.yaml` contains a link to the documentation of the respective tool or command, * `Snakefile`s pass the linting (`snakemake --lint`), * `Snakefile`s are formatted with [snakefmt](https://github.com/snakemake/snakefmt), * Python wrapper scripts are formatted with [black](https://black.readthedocs.io). * Conda environments use a minimal amount of channels, in recommended ordering. E.g. for bioconda, use (conda-forge, bioconda, nodefaults, as conda-forge should have highest priority and defaults channels are usually not needed because most packages are in conda-forge nowadays). --------- Co-authored-by: tdayris <tdayris@gustaveroussy.fr> Co-authored-by: tdayris <thibault.dayris@gustaveroussy.fr> Co-authored-by: Johannes Köster <johannes.koester@uni-due.de> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: snakedeploy-bot[bot] <115615832+snakedeploy-bot[bot]@users.noreply.github.com> Co-authored-by: Felix Mölder <felix.moelder@uni-due.de> Co-authored-by: Christopher Schröder <christopher.schroeder@tu-dortmund.de>
- Loading branch information
1 parent
8656035
commit d8edd7b
Showing
7 changed files
with
217 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Bowtie2 Sambamba | ||
url: http://lomereiter.github.io/sambamba/ | ||
description: > | ||
Map reads with Bowtie 2, and post-process alignments with Sambamba. | ||
+----------------+----------+----------------------------------------------------------------------------------------------+ | ||
| Step | Tool | Reason | | ||
+================+==========+==============================================================================================+ | ||
| Indexation | Bowtie 2 | Create genome sequence index | | ||
+----------------+----------+----------------------------------------------------------------------------------------------+ | ||
| Mapping | Bowtie 2 | Perform read mapping | | ||
+----------------+----------+----------------------------------------------------------------------------------------------+ | ||
| Sort | Sambamba | Perform sort based on mapping position | | ||
+----------------+----------+----------------------------------------------------------------------------------------------+ | ||
| Quality filter | Sambamba | Perform mapping quality filter | | ||
+----------------+----------+----------------------------------------------------------------------------------------------+ | ||
| Deduplication | Sambamba | Identify possible sequencing duplicates | | ||
+----------------+----------+----------------------------------------------------------------------------------------------+ | ||
| Indexation | Sambamba | Index deduplicated reads | | ||
+----------------+----------+----------------------------------------------------------------------------------------------+ | ||
authors: | ||
- Thibault Dayris |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@1 | ||
GCTGCTATGGCTATAGCTCTA | ||
+ | ||
IIIIIIIIIIIIIIIIIIIII | ||
@2 | ||
GCTGCTATGGCTATAGCTCTA | ||
+ | ||
IIIIIIIIIIIIIIIIIIIII | ||
@3 | ||
GCTGCTATGGCTATAGCTCTA | ||
+ | ||
IIIIIIIIIIIIIIIIIIIII | ||
@4 | ||
GCTGCTATGGCTATAGCTCTA | ||
+ | ||
IIIIIIIIIIIIIIIIIIIII | ||
@5 | ||
GCTGCTATGGCTATAGCTCTA | ||
+ | ||
IIIIIIIIIIIIIIIIIIIII | ||
@6 | ||
GCTGCTATGGCTATAGCTCTA | ||
+ | ||
IIIIIIIIIIIIIIIIIIIII | ||
@7 | ||
GCTGCTATGGCTATAGCTCTA | ||
+ | ||
IIIIIIIIIIIIIIIIIIIII | ||
@8 | ||
GTATCGATCCGATTA | ||
+ | ||
IIIIIIIIIIIIIII |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@1 | ||
CTCGATATCGCGCTACGATCC | ||
+ | ||
IIIIIIIIIIIIIIIIIIIII | ||
@2 | ||
CTCGATATCGCGCTACGATCC | ||
+ | ||
IIIIIIIIIIIIIIIIIIIII | ||
@3 | ||
CTCGATATCGCGCTACGATCC | ||
+ | ||
IIIIIIIIIIIIIIIIIIIII | ||
@4 | ||
CTCGATATCGCGCTACGATCC | ||
+ | ||
IIIIIIIIIIIIIIIIIIIII | ||
@5 | ||
CTCGATATCGCGCTACGATCC | ||
+ | ||
IIIIIIIIIIIIIIIIIIIII | ||
@6 | ||
CTCGATATCGCGCTACGATCC | ||
+ | ||
IIIIIIIIIIIIIIIIIIIII | ||
@7 | ||
CTCGATATCGCGCTACGATCC | ||
+ | ||
IIIIIIIIIIIIIIIIIIIII | ||
@8 | ||
ATATCGATCGACGAT | ||
+ | ||
IIIIIIIIIIIIIII |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
rule bowtie2_build: | ||
input: | ||
ref="genome.fasta", | ||
output: | ||
multiext( | ||
"genome", | ||
".1.bt2", | ||
".2.bt2", | ||
".3.bt2", | ||
".4.bt2", | ||
".rev.1.bt2", | ||
".rev.2.bt2", | ||
), | ||
log: | ||
"logs/bowtie2_build/build.log", | ||
params: | ||
extra="", | ||
threads: 8 | ||
wrapper: | ||
"master/bio/bowtie2/build" | ||
|
||
|
||
rule bowtie2_alignment: | ||
input: | ||
sample=["{sample}.R1.fastq", "{sample}.R2.fastq"], | ||
idx=multiext( | ||
"genome", | ||
".1.bt2", | ||
".2.bt2", | ||
".3.bt2", | ||
".4.bt2", | ||
".rev.1.bt2", | ||
".rev.2.bt2", | ||
), | ||
output: | ||
temp("mapped/{sample}.bam"), | ||
log: | ||
"logs/bowtie2/{sample}.log", | ||
params: | ||
extra=( | ||
" --rg-id {sample} " | ||
"--rg 'SM:{sample} LB:FakeLib PU:FakePU.1.{sample} PL:ILLUMINA' " | ||
), | ||
threads: 8 | ||
wrapper: | ||
"master/bio/bowtie2/align" | ||
|
||
|
||
rule sambamba_sort: | ||
input: | ||
"mapped/{sample}.bam", | ||
output: | ||
temp("mapped/{sample}.sorted.bam"), | ||
params: | ||
"", | ||
log: | ||
"logs/sambamba-sort/{sample}.log", | ||
threads: 8 | ||
wrapper: | ||
"master/bio/sambamba/sort" | ||
|
||
|
||
rule sambamba_view: | ||
input: | ||
"mapped/{sample}.sorted.bam", | ||
output: | ||
temp("mapped/{sample}.filtered.bam"), | ||
params: | ||
extra=( | ||
" --format 'bam' " | ||
"--filter 'mapping_quality >= 30 and not (unmapped or mate_is_unmapped)' " | ||
), | ||
log: | ||
"logs/sambamba-view/{sample}.log", | ||
threads: 8 | ||
wrapper: | ||
"master/bio/sambamba/view" | ||
|
||
|
||
rule sambamba_markdup: | ||
input: | ||
"mapped/{sample}.filtered.bam", | ||
output: | ||
"mapped/{sample}.rmdup.bam", | ||
params: | ||
extra=" --remove-duplicates ", # optional parameters | ||
log: | ||
"logs/sambamba-markdup/{sample}.log", | ||
threads: 8 | ||
wrapper: | ||
"master/bio/sambamba/markdup" | ||
|
||
|
||
rule sambamba_index: | ||
input: | ||
"mapped/{sample}.rmdup.bam", | ||
output: | ||
"mapped/{sample}.rmdup.bam.bai", | ||
params: | ||
extra="", | ||
log: | ||
"logs/sambamba-index/{sample}.log", | ||
threads: 8 | ||
wrapper: | ||
"master/bio/sambamba/index" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
>FakeChrom | ||
ATCGATGCTGCTATAGCTATAGCTCTAGATCTGATCTGCTAGTATCGATCCGATTATTAGCGCGATTATAGCGTAGTCA | ||
ATCGATCTCGATATCGCGCTACGATCCGCGCGCGCGCGCGCATTATATCGATCGACGATGCTGCTAGCTAGCTGCTAGC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
wrappers: | ||
- bio/bowtie2/build | ||
- bio/bowtie2/align | ||
- bio/sambamba/sort | ||
- bio/sambamba/view | ||
- bio/sambamba/markdup | ||
- bio/sambamba/index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters