File: _MSAProbs.py

package info (click to toggle)
python-biopython 1.68%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 46,860 kB
  • ctags: 13,237
  • sloc: python: 160,306; xml: 93,216; ansic: 9,118; sql: 1,208; makefile: 155; sh: 63
file content (80 lines) | stat: -rw-r--r-- 3,292 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Copyright 2013 by Christian Brueffer. All rights reserved.
#
# This code is part of the Biopython distribution and governed by its
# license.  Please see the LICENSE file that should have been included
# as part of this package.
"""Command line wrapper for the multiple sequence alignment program MSAProbs.
"""

from __future__ import print_function


from Bio.Application import _Argument, _Option, _Switch, AbstractCommandline


class MSAProbsCommandline(AbstractCommandline):
    """Command line wrapper for MSAProbs.

    http://msaprobs.sourceforge.net

    Example:
    --------

    >>> from Bio.Align.Applications import MSAProbsCommandline
    >>> in_file = "unaligned.fasta"
    >>> out_file = "aligned.cla"
    >>> cline = MSAProbsCommandline(infile=in_file, outfile=out_file, clustalw=True)
    >>> print(cline)
    msaprobs -o aligned.cla -clustalw unaligned.fasta

    You would typically run the command line with cline() or via
    the Python subprocess module, as described in the Biopython tutorial.

    Citation:
    ---------

    Yongchao Liu, Bertil Schmidt, Douglas L. Maskell: "MSAProbs: multiple
    sequence alignment based on pair hidden Markov models and partition
    function posterior probabilities". Bioinformatics, 2010, 26(16): 1958 -1964

    Last checked against version: 0.9.7
    """

    def __init__(self, cmd="msaprobs", **kwargs):
        # order of parameters is the same as in msaprobs -help
        self.parameters = \
            [
            _Option(["-o", "--outfile", "outfile"],
                    "specify the output file name (STDOUT by default)",
                    filename=True,
                    equate=False),
            _Option(["-num_threads", "numthreads"],
                    "specify the number of threads used, and otherwise detect automatically",
                    checker_function=lambda x: isinstance(x, int)),
            _Switch(["-clustalw", "clustalw"],
                    "use CLUSTALW output format instead of FASTA format"),
            _Option(["-c", "consistency"],
                    "use 0 <= REPS <= 5 (default: 2) passes of consistency transformation",
                    checker_function=lambda x: isinstance(x, int) and 0 <= x <= 5),
            _Option(["-ir", "--iterative-refinement", "iterative_refinement"],
                    "use 0 <= REPS <= 1000 (default: 10) passes of iterative-refinement",
                    checker_function=lambda x: isinstance(x, int) and 0 <= x <= 1000),
            _Switch(["-v", "verbose"],
                    "report progress while aligning (default: off)"),
            _Option(["-annot", "annot"],
                    "write annotation for multiple alignment to FILENAME",
                    filename=True),
            _Switch(["-a", "--alignment-order", "alignment_order"],
                    "print sequences in alignment order rather than input order (default: off)"),
            _Option(["-version", "version"],
                    "print out version of MSAPROBS"),
            _Argument(["infile"],
                    "Multiple sequence input file",
                    filename=True),
            ]
        AbstractCommandline.__init__(self, cmd, **kwargs)


if __name__ == "__main__":
    from Bio._utils import run_doctest
    run_doctest()