Skip to content

Commit

Permalink
Add trimmomatic SE.
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneskoester committed Feb 19, 2017
1 parent 66d11e0 commit bb01f7b
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bio/trimmomatic/pe/test_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ def setup_module():
os.chdir(os.path.join(os.path.dirname(__file__), "test"))

def test():
subprocess.check_call(["snakemake", "mapped/a.bam", "--use-conda", "-F"])
subprocess.check_call(["snakemake", "trimmed/a.1.fastq.gz", "--use-conda", "-F"])
Empty file added bio/trimmomatic/se/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions bio/trimmomatic/se/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
channels:
- bioconda
- r
dependencies:
- trimmomatic ==0.36
4 changes: 4 additions & 0 deletions bio/trimmomatic/se/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: "trimmomatic se"
description: Trim single-end reads with trimmomatic.
authors:
- Johannes Köster
14 changes: 14 additions & 0 deletions bio/trimmomatic/se/test/Snakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
rule trimmomatic_pe:
input:
"reads/{sample}.fastq"
output:
"trimmed/{sample}.fastq.gz"
log:
"logs/trimmomatic/{sample}.log"
params:
# list of trimmers (see manual)
trimmer=["TRAILING:3"]
# optional parameters
extra=""
wrapper:
"master/bio/trimmomatic/se"
4 changes: 4 additions & 0 deletions bio/trimmomatic/se/test/reads/a.fastq
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@1
ACGGCAT
+
!!!!!!!
8 changes: 8 additions & 0 deletions bio/trimmomatic/se/test_wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import subprocess
import os

def setup_module():
os.chdir(os.path.join(os.path.dirname(__file__), "test"))

def test():
subprocess.check_call(["snakemake", "trimmed/a.fastq.gz", "--use-conda", "-F"])
16 changes: 16 additions & 0 deletions bio/trimmomatic/se/wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2016, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"


from snakemake.shell import shell

extra = snakemake.params.get("extra", "")
log = snakemake.log_fmt_shell(stdout=True, stderr=True)
trimmer = " ".join(snakemake.params.trimmer)

shell("trimmomatic SE {snakemake.params.extra} "
"{snakemake.input} {snakemake.output} "
"{trimmer} "
"{log}")

0 comments on commit bb01f7b

Please sign in to comment.