Package Bio :: Package Align :: Package Applications :: Module _MSAProbs
[hide private]
[frames] | no frames]

Source Code for Module Bio.Align.Applications._MSAProbs

 1  # Copyright 2013 by Christian Brueffer. All rights reserved. 
 2  # 
 3  # This code is part of the Biopython distribution and governed by its 
 4  # license.  Please see the LICENSE file that should have been included 
 5  # as part of this package. 
 6  """Command line wrapper for the multiple sequence alignment program MSAProbs. 
 7  """ 
 8   
 9  from __future__ import print_function 
10   
11  __docformat__ = "epytext en"  # Don't just use plain text in epydoc API pages! 
12   
13  from Bio.Application import _Argument, _Option, _Switch, AbstractCommandline 
14   
15   
16 -class MSAProbsCommandline(AbstractCommandline):
17 """Command line wrapper for MSAProbs. 18 19 http://msaprobs.sourceforge.net 20 21 Example: 22 23 >>> from Bio.Align.Applications import MSAProbsCommandline 24 >>> in_file = "unaligned.fasta" 25 >>> out_file = "aligned.cla" 26 >>> cline = MSAProbsCommandline(infile=in_file, outfile=out_file, clustalw=True) 27 >>> print(cline) 28 msaprobs -o aligned.cla -clustalw unaligned.fasta 29 30 You would typically run the command line with cline() or via 31 the Python subprocess module, as described in the Biopython tutorial. 32 33 Citation: 34 35 Yongchao Liu, Bertil Schmidt, Douglas L. Maskell: "MSAProbs: multiple 36 sequence alignment based on pair hidden Markov models and partition 37 function posterior probabilities". Bioinformatics, 2010, 26(16): 1958 -1964 38 39 Last checked against version: 0.9.7 40 """ 41
42 - def __init__(self, cmd="msaprobs", **kwargs):
43 # order of parameters is the same as in msaprobs -help 44 self.parameters = \ 45 [ 46 _Option(["-o", "--outfile", "outfile"], 47 "specify the output file name (STDOUT by default)", 48 filename=True, 49 equate=False), 50 _Option(["-num_threads", "numthreads"], 51 "specify the number of threads used, and otherwise detect automatically", 52 checker_function=lambda x: isinstance(x, int)), 53 _Switch(["-clustalw", "clustalw"], 54 "use CLUSTALW output format instead of FASTA format"), 55 _Option(["-c", "consistency"], 56 "use 0 <= REPS <= 5 (default: 2) passes of consistency transformation", 57 checker_function=lambda x: isinstance(x, int) and 0 <= x <= 5), 58 _Option(["-ir", "--iterative-refinement", "iterative_refinement"], 59 "use 0 <= REPS <= 1000 (default: 10) passes of iterative-refinement", 60 checker_function=lambda x: isinstance(x, int) and 0 <= x <= 1000), 61 _Switch(["-v", "verbose"], 62 "report progress while aligning (default: off)"), 63 _Option(["-annot", "annot"], 64 "write annotation for multiple alignment to FILENAME", 65 filename=True), 66 _Switch(["-a", "--alignment-order", "alignment_order"], 67 "print sequences in alignment order rather than input order (default: off)"), 68 _Option(["-version", "version"], 69 "print out version of MSAPROBS"), 70 _Argument(["infile"], 71 "Multiple sequence input file", 72 filename=True), 73 ] 74 AbstractCommandline.__init__(self, cmd, **kwargs)
75 76
77 -def _test():
78 """Run the module's doctests (PRIVATE).""" 79 print("Running MSAProbs doctests...") 80 import doctest 81 doctest.testmod() 82 print("Done")
83 84 85 if __name__ == "__main__": 86 _test() 87