Skip to content

Commit

Permalink
feat: added wrapper for seqtk seq subcommand (#202)
Browse files Browse the repository at this point in the history
* added wrapper for seqtk seq subcommand

* added test and linted
  • Loading branch information
williamrowell authored Jan 26, 2022
1 parent d88fe18 commit 599f370
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bio/seqtk/seq/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
channels:
- bioconda
- conda-forge
dependencies:
- seqtk ==1.3
10 changes: 10 additions & 0 deletions bio/seqtk/seq/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: seqtk-seq
description: |
Common transformations of FASTA/Q using seqtk
url: https://github.com/lh3/seqtk
authors:
- William Rowell
input:
- fastn file (can be gzip compressed)
output:
- fastn file (gzip compressed)
11 changes: 11 additions & 0 deletions bio/seqtk/seq/test/Snakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
rule seqtk_seq_fastq_to_fasta:
input:
"{prefix}.fastq",
output:
"{prefix}.fasta",
log:
"{prefix}.log",
params:
extra="-A",
wrapper:
"master/bio/seqtk/seq"
4 changes: 4 additions & 0 deletions bio/seqtk/seq/test/a.fastq
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@1
ACGGCAT
+
!!!!!!!
15 changes: 15 additions & 0 deletions bio/seqtk/seq/wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Snakemake wrapper seqtk seq subcommand"""

__author__ = "William Rowell"
__copyright__ = "Copyright 2020, William Rowell"
__email__ = "wrowell@pacb.com"
__license__ = "MIT"


from snakemake.shell import shell


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

shell("(seqtk seq {extra} {snakemake.input} > {snakemake.output}) {log}")
8 changes: 8 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,14 @@ def test_shovill():
)


@skip_if_not_modified
def test_seqtk_seq():
run(
"bio/seqtk/seq",
["snakemake", "--cores", "1", "--use-conda", "-F", "a.fasta"],
)


@skip_if_not_modified
def test_seqtk_mergepe():
run(
Expand Down

0 comments on commit 599f370

Please sign in to comment.