Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MAFFT PresetProgram #38

Merged
merged 4 commits into from
Dec 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* .write_paths_to_file, .copy_files_to_dir(), .link_files_to_dir() [ ]
* Add logger calls when saving to JSON and uploading to PyPI [ ]
* Add Muscle PresetProgram [x]
* Add MAFFT PresetProgram [x]

### v0.1.19
* Debug API endpoint (#23) [x]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### BioProv - W3C-PROV provenance documents for bioinformatics


Package | [![License](https://img.shields.io/github/license/vinisalazar/bioprov)](https://img.shields.io/github/license/vinisalazar/bioprov) | [![PyPI Version](https://img.shields.io/pypi/v/bioprov)](https://pypi.org/project/bioprov/) | [![Requirements Status](https://requires.io/github/vinisalazar/BioProv/requirements.svg?branch=master)](https://requires.io/github/vinisalazar/BioProv/requirements/?branch=master)
Package | [![License](https://img.shields.io/github/license/vinisalazar/bioprov)](https://github.com/vinisalazar/BioProv/blob/master/LICENSE) | [![PyPI Version](https://img.shields.io/pypi/v/bioprov)](https://pypi.org/project/bioprov/) | [![Requirements Status](https://requires.io/github/vinisalazar/BioProv/requirements.svg?branch=master)](https://requires.io/github/vinisalazar/BioProv/requirements/?branch=master)
---------------|--|--|--
Tests | [![Build Status](https://travis-ci.org/vinisalazar/BioProv.svg?branch=master)](https://travis-ci.org/vinisalazar/BioProv) | [![tests](https://github.com/vinisalazar/bioprov/workflows/tests/badge.svg?branch=master)](https://github.com/vinisalazar/bioprov/actions?query=workflow%3Atests) | [![Coverage Status](https://coveralls.io/repos/github/vinisalazar/BioProv/badge.svg?branch=master&service=github)](https://coveralls.io/github/vinisalazar/BioProv?branch=master&service=github)
Code | [![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) | [![lint](https://github.com/vinisalazar/BioProv/workflows/lint/badge.svg?branch=master)](https://github.com/vinisalazar/BioProv/actions?query=workflow%3Alint)
Expand Down
1 change: 1 addition & 0 deletions bioprov/programs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
blastn,
blastp,
muscle,
mafft,
prokka,
kaiju,
kaiju2table,
Expand Down
18 changes: 18 additions & 0 deletions bioprov/programs/programs.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,24 @@ def muscle(sample, input_tag="input", msf=False):
return _muscle


def mafft(sample, input_tag="input"):
"""
:param Sample sample: Instance of BioProv.Sample.
:param str input_tag: A tag for the input fasta file.
:return: Instance of PresetProgram containing MAFFT.
:rtype: BioProv.PresetProgram.
"""
_mafft = PresetProgram(
name="mafft",
sample=sample,
input_files={"": input_tag},
output_files={">": ("aligned", "_aligned.afa")},
preffix_tag=input_tag,
)

return _mafft


def prokka_():
"""
:return: Instance of PresetProgram containing Prokka.
Expand Down
13 changes: 13 additions & 0 deletions bioprov/tests/test_bioprov_programs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
blastn,
blastp,
muscle,
mafft,
diamond,
kaiju,
kaiju2table,
Expand Down Expand Up @@ -90,6 +91,18 @@ def test_muscle():
assert list(muscle_params.keys()) == expected


def test_mafft():

s = Sample("Synechococcus", files={"input": synechococcus_genome})

mafft_prog = mafft(s)
mafft_params = mafft_prog.serializer()["params"]

expected = ["", ">"]

assert list(mafft_params.keys()) == expected


def test_prodigal():
"""
Testing the 'prodigal' program.
Expand Down