1
2
3
4
5 """Command line wrapper for the multiple alignment program PRANK.
6
7 http://www.ebi.ac.uk/goldman-srv/prank/prank/
8
9 Citations:
10
11 Loytynoja, A. and Goldman, N. 2005. An algorithm for progressive multiple
12 alignment of sequences with insertions. Proceedings of the National Academy
13 of Sciences, 102: 10557--10562.
14
15 Loytynoja, A. and Goldman, N. 2008. Phylogeny-aware gap placement prevents
16 errors in sequence alignment and evolutionary analysis. Science, 320: 1632.
17
18 Last checked agains version: 081202
19 """
20 import types
21 from Bio.Application import _Option, _Switch, AbstractCommandline
22
24 """Command line wrapper for the multiple alignment program PRANK."""
25 - def __init__(self, cmd="prank", **kwargs):
26 OUTPUT_FORMAT_VALUES = range(1,18)
27 self.parameters = \
28 [
29
30
31 _Option(["-d", "d"], ["input", "file"],
32 None, 1, "Input filename"),
33
34 _Option(["-t", "t"], ["input", "file"],
35 None, 0, "Input guide tree filename"),
36
37 _Option(["-tree", "tree"], ["input"],
38 None, 0,
39 "Input guide tree as Newick string"),
40
41 _Option(["-m", "m"], ["input"],
42 None, 0,
43 "User-defined alignment model filename. Default: " + \
44 "HKY2/WAG"),
45
46 _Option(["-o", "o"], ["output"],
47 None, 0,
48 "Output filenames prefix. Default: 'output'\n " + \
49 "Will write: output.?.fas (depending on requested " + \
50 "format), output.?.xml and output.?.dnd"),
51
52 _Option(["-f", "f"], ["input"],
53 lambda x: x in OUTPUT_FORMAT_VALUES, 0,
54 "Output alignment format. Default: 8 FASTA\n" + \
55 "Option are:\n" + \
56 "1. IG/Stanford 8. Pearson/Fasta\n" + \
57 "2. GenBank/GB 11. Phylip3.2\n" + \
58 "3. NBRF 12. Phylip\n" + \
59 "4. EMBL 14. PIR/CODATA\n" + \
60 "6. DNAStrider 15. MSF\n" + \
61 "7. Fitch 17. PAUP/NEXUS"),
62 _Switch(["-noxml", "noxml"], ["input"],
63 "Do not output XML files"),
64 _Switch(["-notree", "notree"], ["input"],
65 "Do not output dnd tree files"),
66 _Switch(["-shortnames", "shortnames"], ["input"],
67 "Truncate names at first space"),
68 _Switch(["-quiet", "quiet"], ["input"],
69 "Reduce verbosity"),
70
71
72
73 _Switch(["-F", "+F", "F"], ["input"],
74 "Force insertions to be always skipped: same as +F"),
75
76 _Switch(["-dots", "dots"], ["input"],
77 "Show insertion gaps as dots"),
78
79 _Option(["-gaprate", "gaprate"], ["input"],
80 lambda x: isinstance(x, types.FloatType),
81 0,
82 "Gap opening rate. Default: dna 0.025 prot 0.0025"),
83
84 _Option(["-gapext", "gapext"], ["input"],
85 lambda x: isinstance(x, types.FloatType),
86 0,
87 "Gap extension probability. Default: dna 0.5 " + \
88 "/ prot 0.5"),
89
90 _Option(["-dnafreqs", "dnafreqs"], ["input"],
91 lambda x: isinstance(x, types.StringType),
92 0,
93 "DNA frequencies - 'A,C,G,T'. eg '25,25,25,25' as a quote " + \
94 "surrounded string value. Default: empirical"),
95
96 _Option(["-kappa", "kappa"], ["input"],
97 lambda x: isinstance(x, types.IntType),
98 0,
99 "Transition/transversion ratio. Default: 2"),
100
101 _Option(["-rho", "rho"], ["input"],
102 lambda x: isinstance(x, types.IntType),
103 0,
104 "Purine/pyrimidine ratio. Default: 1"),
105
106
107 _Option(["-codon", "codon"], ["input"],
108 None,
109 0,
110 "Codon model filename. Default: empirical codon model"),
111
112 _Option(["-termgap", "termgap"], ["input"],
113 lambda x: 0,
114 0,
115 "Penalise terminal gaps normally",
116 0),
117
118
119 _Option(["-nopost", "nopost"], ["input"],
120 lambda x: 0,
121 0,
122 "Do not compute posterior support. Default: compute",
123 0),
124
125
126 _Option(["-pwdist", "pwdist"], ["input"],
127 lambda x: isinstance(x, types.FloatType),
128 0,
129 "Expected pairwise distance for computing guidetree. " + \
130 "Default: dna 0.25 / prot 0.5"),
131 _Switch(["-once", "once"], ["input"],
132 "Run only once. Default: twice if no guidetree given"),
133 _Switch(["-twice", "twice"], ["input"],
134 "Always run twice"),
135 _Switch(["-skipins", "skipins"], ["input"],
136 "Skip insertions in posterior support"),
137 _Switch(["-uselogs", "uselogs"], ["input"],
138 "Slower but should work for a greater number of sequences"),
139 _Switch(["-writeanc", "writeanc"], ["input"],
140 "Output ancestral sequences"),
141 _Switch(["-printnodes", "printnodes"], ["input"],
142 "Output each node; mostly for debugging"),
143
144
145 _Option(["-matresize", "matresize"], ["input"],
146 lambda x: isinstance(x, types.FloatType) or isinstance(x,
147 types.IntType),
148 0,
149 "Matrix resizing multiplier"),
150
151
152 _Option(["-matinitsize", "matinitsize"], ["input"],
153 lambda x: isinstance(x, types.FloatType) or isinstance(x,
154 types.IntType),
155 0,
156 "Matrix initial size multiplier"),
157 _Switch(["-longseq", "longseq"], ["input"],
158 "Save space in pairwise alignments"),
159 _Switch(["-pwgenomic", "pwgenomic"], ["input"],
160 "Do pairwise alignment, no guidetree"),
161
162 _Option(["-pwgenomicdist", "pwgenomicdist"], ["input"],
163 lambda x: isinstance(x, types.FloatType),
164 0,
165 "Distance for pairwise alignment. Default: 0.3"),
166
167 _Option(["-scalebranches", "scalebranches"], ["input"],
168 lambda x: isinstance(x, types.IntType),
169 0,
170 "Scale branch lengths. Default: dna 1 / prot 2"),
171
172
173 _Option(["-fixedbranches", "fixedbranches"], ["input"],
174 lambda x: isinstance(x, types.FloatType),
175 0,
176 "Use fixed branch lengths of input value"),
177
178
179 _Option(["-maxbranches", "maxbranches"], ["input"],
180 lambda x: isinstance(x, types.FloatType),
181 0,
182 "Use maximum branch lengths of input value"),
183
184 _Switch(["-realbranches", "realbranches"], ["input"],
185 "Disable branch length truncation"),
186 _Switch(["-translate", "translate"], ["input"],
187 "Translate to protein"),
188 _Switch(["-mttranslate", "mttranslate"], ["input"],
189 "Translate to protein using mt table"),
190
191 _Switch(["-convert", "convert"], ["input"],
192 "Convert input alignment to new format. Do " + \
193 "not perform alignment")
194 ]
195 AbstractCommandline.__init__(self, cmd, **kwargs)
196