Skip to content

Commit

Permalink
Merged in mbhall88/snakemake-wrappers/pyfastaq-replace_bases (pull re…
Browse files Browse the repository at this point in the history
…quest snakemake#92)

add pyfastaq replace_bases wrapper
  • Loading branch information
mbhall88 authored and johanneskoester committed Jul 24, 2019
2 parents 3b14cc0 + 0589cee commit 88ab051
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bio/pyfastaq/replace_bases/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
channels:
- bioconda
dependencies:
- pyfastaq ==3.17.0
4 changes: 4 additions & 0 deletions bio/pyfastaq/replace_bases/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: pyfastaq replace_bases
description: Replaces all occurrences of one letter with another.
authors:
- Michael Hall
12 changes: 12 additions & 0 deletions bio/pyfastaq/replace_bases/test/Snakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
rule replace_bases:
input:
"{sample}.rna.fa"
output:
"{sample}.dna.fa",
params:
old_base = "U",
new_base = "T",
log:
"logs/fastaq/replace_bases/test/{sample}.log"
wrapper:
"master/bio/pyfastaq/replace_bases"
2 changes: 2 additions & 0 deletions bio/pyfastaq/replace_bases/test/sample1.rna.fa
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>sample1
ACGU
19 changes: 19 additions & 0 deletions bio/pyfastaq/replace_bases/wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
__author__ = "Michael Hall"
__copyright__ = "Copyright 2019, Michael Hall"
__email__ = "[email protected]"
__license__ = "MIT"


from snakemake.shell import shell


log = snakemake.log_fmt_shell(stdout=False, stderr=True)

shell(
"fastaq replace_bases"
" {snakemake.input[0]}"
" {snakemake.output[0]}"
" {snakemake.params.old_base}"
" {snakemake.params.new_base}"
" {log}"
)
3 changes: 3 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ def test_pindel_pindel2vcf_multi_input():
run("bio/pindel/pindel2vcf",
["snakemake", "pindel/all.vcf", "--use-conda", "-F"])

def test_pyfastaq_replace_bases():
run("bio/pyfastaq/replace_bases",
["snakemake", "sample1.dna.fa", "--use-conda", "-F"])

def test_samtools_mpileup():
run("bio/samtools/mpileup",
Expand Down

0 comments on commit 88ab051

Please sign in to comment.