Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [fix] (template): Missing code in wrappers' doc. Error #187 * bustools sort * memory and tempdir used * environment update * fix typo * Update bio/bustools/sort/environment.yaml * Update bio/bustools/sort/test/Snakefile 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>
- Loading branch information
1 parent
5360346
commit 1415748
Showing
6 changed files
with
80 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,7 @@ | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- nodefaults | ||
dependencies: | ||
- bustools =0.41 | ||
- snakemake-wrapper-utils =0.4 |
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,17 @@ | ||
name: bustools sort | ||
description: Sort raw BUS output from pseudoalignment programs | ||
url: https://github.com/BUStools/bustools#sort | ||
author: | ||
- Thibault Dayris | ||
input: | ||
- Path to bus file, or list of bus files | ||
output: | ||
- Path to bus file | ||
params: | ||
- extra: Optional parameters | ||
notes: | | ||
`--temp` is automatically defined through `resources.tmpdir` | ||
`--memory` is automatically defined through `resources.mem_mb` | ||
Multiple bus files in input will result in a single bus file in output. |
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,14 @@ | ||
rule test_bustools_sort: | ||
input: | ||
"file.bus", | ||
output: | ||
"sorted.bus", | ||
threads: 1 | ||
resources: | ||
mem_mb=765, | ||
params: | ||
extra="--umi", | ||
log: | ||
"bustools.log", | ||
wrapper: | ||
"master/bio/bustools/sort" |
Binary file not shown.
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,34 @@ | ||
#!/usr/bin/env python3 | ||
# coding: utf-8 | ||
|
||
"""Snakemake wrapper for bustools sort""" | ||
|
||
__author__ = "Thibault Dayris" | ||
__copyright__ = "Copyright 2022, Thibault Dayris" | ||
__email__ = "thibault.dayris@gustaveroussy.fr" | ||
__license__ = "MIT" | ||
|
||
from snakemake.shell import shell | ||
from tempfile import TemporaryDirectory | ||
from snakemake_wrapper_utils.snakemake import get_mem | ||
|
||
log = snakemake.log_fmt_shell(stdout=True, stderr=True) | ||
extra = snakemake.params.get("extra", "") | ||
|
||
bus_files = snakemake.input | ||
if isinstance(bus_files, list): | ||
bus_files = " ".join(bus_files) | ||
|
||
mem = get_mem(snakemake, "MiB") | ||
|
||
|
||
with TemporaryDirectory() as tempdir: | ||
shell( | ||
"bustools sort " | ||
"--memory {mem} " | ||
"--temp {tempdir} " | ||
"--threads {snakemake.threads} " | ||
"--output {snakemake.output[0]} " | ||
"{bus_files} " | ||
"{log}" | ||
) |
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