SEQTK-SEQ

Common transformations of FASTA/Q using seqtk

URL: https://github.com/lh3/seqtk

Example

This wrapper can be used in the following way:

rule seqtk_seq_fastq_to_fasta:
    input:
        "{prefix}.fastq",
    output:
        "{prefix}.fasta",
    log:
        "{prefix}.log",
    params:
        extra="-A",
    wrapper:
        "v1.9.0/bio/seqtk/seq"

Note that input, output and log file paths can be chosen freely.

When running with

snakemake --use-conda

the software dependencies will be automatically deployed into an isolated environment before execution.

Software dependencies

  • seqtk==1.3

Input/Output

Input:

  • fastn file (can be gzip compressed)

Output:

  • fastn file (gzip compressed)

Authors

  • William Rowell

Code

"""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}")