MUSCLE

https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/muscle?label=version%20update%20pull%20requests

build multiple sequence alignments using MUSCLE.

URL: https://drive5.com/muscle5/manual/

Example

This wrapper can be used in the following way:

rule muscle_fasta:
    input:
        fasta="{sample}.fa",  # Input fasta file
    output:
        alignment="{sample}.fas",  # Output alignment file
    log:
        "logs/muscle/{sample}.log",
    params:
        extra="-refineiters 50",  # Additional arguments
    threads: 2
    wrapper:
        "v3.8.0/bio/muscle"


rule muscle_super5:
    input:
        fasta="{sample}.fa",
    output:
        alignment="{sample}.super5.fas",
    log:
        "logs/muscle/{sample}.super5.log",
    params:
        super5 = True,
        extra="-refineiters 50",
    threads: 2
    wrapper:
        "v3.8.0/bio/muscle"

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

  • muscle=5.1

Input/Output

Input:

  • FASTA file

Output:

  • Alignment file, with FASTA as default file format

Params

  • super5: specifies whether to use the Super5 algorithm to align sequences

Authors

  • Nikos Tsardakas Renhuldt

Code

__author__ = "Nikos Tsardakas Renhuldt"
__copyright__ = "Copyright 2021, Nikos Tsardakas Renhuldt"
__email__ = "nikos.tsardakas_renhuldt@tbiokem.lth.se"
__license__ = "MIT"


from snakemake.shell import shell

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

mode = "-align"
if snakemake.params.get("super5"):
    mode = "-super5"

shell(
    "muscle"
    " -threads {snakemake.threads}"
    " {mode} {snakemake.input.fasta}"
    " {extra}"
    " -output {snakemake.output.alignment}"
    " {log}"
)