Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rasusa wrapper #152

Merged
merged 5 commits into from
Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bio/rasusa/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
channels:
- bioconda
- conda-forge
dependencies:
- rasusa ==0.3.0
4 changes: 4 additions & 0 deletions bio/rasusa/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: rasusa
description: Randomly subsample sequencing reads to a specified coverage using `rasusa <https://github.com/mbhall88/rasusa>`_.
authors:
- Michael Hall
15 changes: 15 additions & 0 deletions bio/rasusa/test/Snakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
rule subsample:
input:
r1="{sample}.r1.fq",
r2="{sample}.r2.fq",
output:
r1="{sample}.subsampled.r1.fq",
r2="{sample}.subsampled.r2.fq",
params:
options="--seed 15",
genome_size="3mb", # required
coverage=20, # required
log:
"logs/subsample/{sample}.log",
wrapper:
"master/bio/rasusa"
4 changes: 4 additions & 0 deletions bio/rasusa/test/a.r1.fq
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@read1
ACGT
+
$$$$
4 changes: 4 additions & 0 deletions bio/rasusa/test/a.r2.fq
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@read1
ACGT
+
!!!!
17 changes: 17 additions & 0 deletions bio/rasusa/wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
__author__ = "Michael Hall"
__copyright__ = "Copyright 2020, Michael Hall"
__email__ = "[email protected]"
__license__ = "MIT"


from snakemake.shell import shell


options = snakemake.params.get("options", "")


shell(
"rasusa {options} -i {snakemake.input} -o {snakemake.output} "
"-c {snakemake.params.coverage} -g {snakemake.params.genome_size} "
"2> {snakemake.log}"
)
Loading