Skip to content

Commit

Permalink
feat: add MUSCLE wrapper (#404)
Browse files Browse the repository at this point in the history
* Add muscle wrapper

* Comment and lint MUSCLE Snakefile

* Remove colon from MUSCLE meta.yaml

* Remove thread from muscle snakefile
  • Loading branch information
nikostr authored Jan 17, 2022
1 parent ad99f9e commit 564ada7
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bio/muscle/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
channels:
- bioconda
- conda-forge
dependencies:
- muscle ==3.8.1551
10 changes: 10 additions & 0 deletions bio/muscle/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: muscle
description: build multiple sequence alignments using MUSCLE. Documentation found at https://www.drive5.com/muscle/manual/index.html
authors:
- Nikos Tsardakas Renhuldt
input:
- FASTA file
output:
- Alignment file, with FASTA as default file format
notes: |
* MUSCLE is a single-core program. It cannot utilize more than 1 thread.
24 changes: 24 additions & 0 deletions bio/muscle/test/Snakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
rule muscle_fasta:
input:
fasta="{sample}.fa", # Input fasta file
output:
alignment="{sample}.afa", # Output alignment file
log:
"logs/muscle/{sample}.log",
params:
extra="", # Additional arguments
wrapper:
"master/bio/muscle"


rule muscle_clw:
input:
fasta="{sample}.fa",
output:
alignment="{sample}.clw",
log:
"logs/muscle/{sample}.log",
params:
extra="-clw",
wrapper:
"master/bio/muscle"
10 changes: 10 additions & 0 deletions bio/muscle/test/test-proteins.fa
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
>test_protein
MVKYSREPDNPTKSCKARGSDLRVHFKNTRETAHAIRKMQLGKAKSYLEDVLAHKQAIPF
RRFCRGVGRTAQAKNRQSNGQGRWPVKSANFILDLLKNAESNAEVKGLDVDSLYVSHIQV
NQAQKQRRRTYRAHGRINPYMSSPCHIELVLSEKEEPVKKEPETQLAPRKSRKGQALHSG
AS
>test_protein2
MVKSREPDNPTKSCKARGSDLRVHFKNTRETAHAIRKMQLGKAKSYLEDVLAHKQAIPFR
RFCRGVGRTAQAKNRQSNGQGRWPVKSANFILDLLKNAESNAEVKGLDVDSLYVSHIQVN
QAQKQRRRTYRAHGRINPYMSSPCHIELVLSEKEEPVKKEPETQLAPRKSRKGQALHSGA
S
18 changes: 18 additions & 0 deletions bio/muscle/wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
__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", "")

shell(
"muscle "
"{extra} "
"-in {snakemake.input.fasta} "
"-out {snakemake.output.alignment} "
"{log}"
)
16 changes: 16 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2029,6 +2029,22 @@ def test_multiqc():
)


@skip_if_not_modified
def test_muscle_clw():
run(
"bio/muscle",
["snakemake", "--cores", "1", "test-proteins.clw", "--use-conda", "-F"],
)


@skip_if_not_modified
def test_muscle_fa():
run(
"bio/muscle",
["snakemake", "--cores", "1", "test-proteins.afa", "--use-conda", "-F"],
)


@skip_if_not_modified
def test_nanosimh():
run(
Expand Down

0 comments on commit 564ada7

Please sign in to comment.