1
2
3
4
5
6
7
8 """Code to interact with and run various EMBOSS programs.
9
10 These classes follow the AbstractCommandline interfaces for running
11 programs.
12 """
13
14 from Bio.Application import _Option, _Switch, AbstractCommandline
15
17 """Base Commandline object for EMBOSS wrappers (PRIVATE).
18
19 This is provided for subclassing, it deals with shared options
20 common to all the EMBOSS tools:
21
22 - auto Turn off prompts
23 - stdout Write standard output
24 - filter Read standard input, write standard output
25 - options Prompt for standard and additional values
26 - debug Write debug output to program.dbg
27 - verbose Report some/full command line options
28 - help Report command line options. More
29 information on associated and general
30 qualifiers can be found with -help -verbose
31 - warning Report warnings
32 - error Report errors
33 - fatal Report fatal errors
34 - die Report dying program messages
35 """
37 assert cmd is not None
38 extra_parameters = [\
39 _Switch(["-auto","auto"], [],
40 """Turn off prompts.
41
42 Automatic mode disables prompting, so we recommend you set
43 this argument all the time when calling an EMBOSS tool from
44 Biopython.
45 """),
46 _Switch(["-stdout","stdout"], [],
47 "Write standard output."),
48 _Switch(["-filter","filter"], [],
49 "Read standard input, write standard output."),
50 _Switch(["-options","options"], [],
51 """Prompt for standard and additional values.
52
53 If you are calling an EMBOSS tool from within Biopython,
54 we DO NOT recommend using this option.
55 """),
56 _Switch(["-debug","debug"], [],
57 "Write debug output to program.dbg."),
58 _Switch(["-verbose","verbose"], [],
59 "Report some/full command line options"),
60 _Switch(["-help","help"], [],
61 """Report command line options.
62
63 More information on associated and general qualifiers can
64 be found with -help -verbose
65 """),
66 _Switch(["-warning","warning"], [],
67 "Report warnings."),
68 _Switch(["-error","error"], [],
69 "Report errors."),
70 _Switch(["-die","die"], [],
71 "Report dying program messages."),
72 ]
73 try :
74
75
76 self.parameters = extra_parameters + self.parameters
77 except AttributeError:
78
79 self.parameters = extra_parameters
80 AbstractCommandline.__init__(self, cmd, **kwargs)
81
83 """Base Commandline object for EMBOSS wrappers (PRIVATE).
84
85 This is provided for subclassing, it deals with shared options
86 common to all the EMBOSS tools plus:
87
88 - outfile Output filename
89
90 """
105
107
108
109
110 if not (self.outfile or self.filter or self.stdout) :
111 raise ValueError("You must either set outfile (output filename), "
112 "or enable filter or stdout (output to stdout).")
113 return _EmbossMinimalCommandLine._validate(self)
114
115
117 """Commandline object for the Primer3 interface from EMBOSS.
118 """
119 - def __init__(self, cmd="eprimer3", **kwargs):
120 self.parameters = \
121 [_Option(["-sequence","sequence"], ["input"], None, 1,
122 "Sequence to choose primers from"),
123 _Option(["-task","task"], ["input"], None, 0),
124 _Option(["-numreturn","numreturn"], ["input"], None, 0),
125 _Option(["-includedregion","includedregion"], ["input"], None, 0),
126 _Option(["-target","target"], ["input"], None, 0),
127 _Option(["-excludedregion","excludedregion"], ["input"], None, 0),
128 _Option(["-forwardinput","forwardinput"], ["input"], None, 0),
129 _Option(["-reverseinput","reverseinput"], ["input"], None, 0),
130 _Option(["-gcclamp","gcclamp"], ["input"], None, 0),
131 _Option(["-osize","osize"], ["input"], None, 0),
132 _Option(["-minsize","minsize"], ["input"], None, 0),
133 _Option(["-maxsize","maxsize"], ["input"], None, 0),
134 _Option(["-otm","otm"], ["input"], None, 0),
135 _Option(["-mintm","mintm"], ["input"], None, 0),
136 _Option(["-maxtm","maxtm"], ["input"], None, 0),
137 _Option(["-maxdifftm","maxdifftm"], ["input"], None, 0),
138 _Option(["-ogcpercent","ogcpercent"], ["input"], None, 0),
139 _Option(["-mingc","mingc"], ["input"], None, 0),
140 _Option(["-maxgc","maxgc"], ["input"], None, 0),
141 _Option(["-saltconc","saltconc"], ["input"], None, 0),
142 _Option(["-dnaconc","dnaconc"], ["input"], None, 0),
143 _Option(["-maxployx","maxployx"], ["input"], None, 0),
144 _Option(["-productosize","productosize"], ["input"], None, 0),
145 _Option(["-productsizerange","productsizerange"], ["input"], None, 0),
146 _Option(["-productotm","productotm"], ["input"], None, 0),
147 _Option(["-productmintm","productmintm"], ["input"], None, 0),
148 _Option(["-productmaxtm","productmaxtm"], ["input"], None, 0),
149 _Option(["-oligoexcluderegion","oligoexcluderegion"], ["input"], None, 0),
150 _Option(["-oligoinput","oligoinput"], ["input"], None, 0),
151 _Option(["-oligosize","oligosize"], ["input"], None, 0),
152 _Option(["-oligominsize","oligominsize"], ["input"], None, 0),
153 _Option(["-oligomaxsize","oligomaxsize"], ["input"], None, 0),
154 _Option(["-oligotm","oligotm"], ["input"], None, 0),
155 _Option(["-oligomintm","oligomintm"], ["input"], None, 0),
156 _Option(["-oligomaxtm","oligomaxtm"], ["input"], None, 0),
157 _Option(["-oligoogcpercent","oligoogcpercent"], ["input"], None, 0),
158 _Option(["-oligomingc","oligomingc"], ["input"], None, 0),
159 _Option(["-oligomaxgc","oligomaxgc"], ["input"], None, 0),
160 _Option(["-oligosaltconc","oligosaltconc"], ["input"], None, 0),
161 _Option(["-oligodnaconc","oligodnaconc"], ["input"], None, 0),
162 _Option(["-oligoselfany","oligoselfany"], ["input"], None, 0),
163 _Option(["-oligoselfend","oligoselfend"], ["input"], None, 0),
164 _Option(["-oligomaxpolyx","oligomaxpolyx"], ["input"], None, 0),
165 _Option(["-mispriminglibraryfile","mispriminglibraryfile"], ["input"], None, 0),
166 _Option(["-maxmispriming","maxmispriming"], ["input"], None, 0),
167 _Option(["-oligomishyblibraryfile","oligomishyblibraryfile"], ["input"], None, 0),
168 _Option(["-oligomaxmishyb","oligomaxmishyb"], ["input"], None, 0),
169 _Option(["-explainflag","explainflag"], ["input"], None, 0),
170 ]
171 _EmbossCommandLine.__init__(self, cmd, **kwargs)
172
173
175 """Commandline object for the primersearch program from EMBOSS.
176 """
177 - def __init__(self, cmd="primersearch", **kwargs):
178 self.parameters = \
179 [_Option(["-sequences","sequences"], ["input"], None, 1,
180 "Sequence to look for the primer pairs in."),
181 _Option(["-primers","primers"], ["input", "file"], None, 1,
182 "File containing the primer pairs to search for."),
183
184
185
186 _Option(["-mismatchpercent","mismatchpercent"], ["input"], None, 1,
187 "Allowed percentage mismatch.")]
188 _EmbossCommandLine.__init__(self, cmd, **kwargs)
189
191
192
193
194
195
196 if name in ["out", "-out"] :
197 import warnings
198 warnings.warn('Aliases "-out" and "out" are deprecated, please use '
199 'either "-outfile" or "outfile" with set_parameter '
200 'instead, or use the outfile property.',
201 DeprecationWarning)
202 name = "outfile"
203 _EmbossCommandLine.set_parameter(self, name, value)
204
205
207 """Commandline object for the eprotdist program from EMBOSS (OBSOLETE).
208
209 This is an EMBOSS wrapper around protdist from PHYLIP.
210
211 It has been replaced by "fprotdist", see FProtDistCommandline.
212 """
213 - def __init__(self, cmd="eprotdist", **kwargs):
214 self.parameters = \
215 [_Option(["-msf","msf"], ["input"], None, 1,
216 "File containing sequences"),
217 _Option(["-method","method"], ["input"], None, 1,
218 "Choose the method to use"),
219 _Option(["-categ","categ"], ["input"], None, 0,
220 "Choose the category to use"),
221 _Option(["-gencode","gencode"], ["input"], None, 0,
222 "Which genetic code"),
223 _Option(["-prob","prob"], ["input"], None, 0,
224 "Prob change category (1.0=easy)"),
225 _Option(["-tranrate","tranrate"], ["input"], None, 0,
226 "Transition/transversion ratio"),
227 _Option(["-freqa","freqa"], ["input"], None, 0,
228 "Frequency for A"),
229 _Option(["-freqc","freqc"], ["input"], None, 0,
230 "Frequency for C"),
231 _Option(["-freqg","freqg"], ["input"], None, 0,
232 "Frequency for G"),
233 _Option(["-freqt","freqt"], ["input"], None, 0,
234 "Frequency for T"),
235 _Option(["-printdata","printdata"], ["input"], None, 0,
236 "Print out the data at start of run"),
237 _Option(["-progress","progress"], ["input"], None, 0,
238 "Print indications of progress of run"),
239 _Option(["-basefrequency","basefrequency"], ["input"], None, 0,
240 "Use empirical base frequencies")]
241 _EmbossCommandLine.__init__(self, cmd, **kwargs)
242
243
245 """Commandline object for the eneighbor program from EMBOSS (OBSOLETE).
246
247 This is an EMBOSS wrapper around neighbor from PHYLIP.
248
249 It has been replaced by "fneighbor", see FNeighborCommandline.
250 """
251 - def __init__(self, cmd="eneighbor", **kwargs):
252 self.parameters = \
253 [_Option(["-infile","infile"], ["input"], None, 1,
254 "infile value"),
255 _Option(["-trout","trout"], ["input"], None, 1,
256 "Create a tree file"),
257 _Option(["-treefile","treefile"], ["input"], None, 1,
258 "Tree file name"),
259 _Option(["-nj","nj"], ["input"], None, 1,
260 "Neighbor-joining"),
261 _Option(["-noog","noog"], ["input"], None, 1,
262 "Outgroup root"),
263 _Option(["-outgnum","outgnum"], ["input"], None, 0,
264 "number of the outgroup"),
265 _Option(["-randseed","randseed"], ["input"], None, 0,
266 "Random number seed (must be odd)"),
267 _Option(["-datasets","datasets"], ["input"], None, 0,
268 "How many data sets"),
269 _Option(["-drawtree","drawtree"], ["input"], None, 0,
270 "Draw tree"),
271 _Option(["-lt","lt"], ["input"], None, 0,
272 "Lower-triangular data matrix"),
273 _Option(["-ut","ut"], ["input"], None, 0,
274 "Upper-triangular data matrix"),
275 _Option(["-sr","sr"], ["input"], None, 0,
276 "Subreplicates"),
277 _Option(["-random","random"], ["input"], None, 0,
278 "Randomize input order of species"),
279 _Option(["-multsets","multsets"], ["input"], None, 0,
280 "Analyze multiple data sets"),
281 _Option(["-printdata","printdata"], ["input"], None, 0,
282 "Print out the data at start of run"),
283 _Option(["-progress","progress"], ["input"], None, 0,
284 "Print indications of progress of run")]
285 _EmbossCommandLine.__init__(self, cmd, **kwargs)
286
287
289 """Commandline object for the eprotpars program from EMBOSS (OBSOLETE).
290
291 This is an EMBOSS wrapper around protpars from PHYLIP.
292
293 It has been replaced by "fprotpars", see FProtParsCommandline.
294 """
295 - def __init__(self, cmd="eprotpars", **kwargs):
296 self.parameters = \
297 [_Option(["-msf","msf"], ["input", "file"], None, 1,
298 "Sequences file to be read in"),
299 _Option(["-besttree","besttree"], ["input"], None, 0,
300 "Search for the best tree"),
301 _Option(["-random","random"], ["input"], None, 0,
302 "Randomize input order of species"),
303 _Option(["-norandom","norandom"], ["input"], None, 0,
304 "Do not randomize input order of species"),
305 _Option(["-randseed","randseed"], ["input"], None, 0,
306 "Random number seed (must be odd)"),
307 _Option(["-randtimes","randtimes"], ["input"], None, 0,
308 "How many times to randomize"),
309 _Option(["-og","og"], ["input"], None, 0,
310 "Use an outgroup root"),
311 _Option(["-noog","noog"], ["input"], None, 0,
312 "Do not use an outgroup root"),
313 _Option(["-outgnum","outgnum"], ["input"], None, 0,
314 "Number of the outgroup"),
315 _Option(["-thresh","thresh"], ["input"], None, 0,
316 "Use Threshold parsimony"),
317 _Option(["-valthresh","valthresh"], ["input"], None, 0,
318 "threshold value"),
319 _Option(["-printdata","printdata"], ["input"], None, 0,
320 "Print out the data at start of run"),
321 _Option(["-progress","progress"], ["input"], None, 0,
322 "Print indications of progress of run"),
323 _Option(["-steps","steps"], ["input"], None, 0,
324 "Print out steps in each site"),
325 _Option(["-seqatnodes","seqatnodes"], ["input"], None, 0,
326 "Print sequences at all nodes of tree"),
327 _Option(["-drawtree","drawtree"], ["input"], None, 0,
328 "Draw tree"),
329 _Option(["-trout","trout"], ["input"], None, 0,
330 "Create a tree file"),
331 _Option(["-notrout","notrout"], ["input"], None, 0,
332 "Do not create a tree file"),
333 _Option(["-treefile","treefile"], ["output", "file"], None, 0,
334 "Output treefile name")]
335 _EmbossCommandLine.__init__(self, cmd, **kwargs)
336
337
339 """Commandline object for the econsense program from EMBOSS (OBSOLETE).
340
341 This is an EMBOSS wrapper around consense from PHYLIP.
342
343 It has been replaced by "fconsense", see FConsenseCommandline.
344 """
345 - def __init__(self, cmd="econsense", **kwargs):
346 self.parameters = \
347 [_Option(["-infile","infile"], ["input", "file"], None, 1,
348 "file to read in (New Hampshire standard form)"),
349 _Option(["-notrout","notrout"], ["input"], None, 0,
350 "Do not create a tree file"),
351 _Option(["-trout","trout"], ["input"], None, 0,
352 "Create a tree file"),
353 _Option(["-treefile","treefile"], ["output", "file"], None, 0,
354 "tree file name"),
355 _Option(["-noog","noog"], ["input"], None, 0,
356 "Do not use an outgroup"),
357 _Option(["-og","og"], ["input"], None, 0,
358 "Use an outgroup"),
359 _Option(["-outgnum","outgnum"], ["input"], None, 0,
360 "number of the outgroup"),
361 _Option(["-nodrawtree","nodrawtree"], ["input"], None, 0,
362 "Do not draw a tree"),
363 _Option(["-drawtree","drawtree"], ["input"], None, 0,
364 "Draw tree"),
365 _Option(["-root","root"], ["input"], None, 0,
366 "Trees to be treated as Rooted"),
367 _Option(["-progress","progress"], ["input"], None, 0,
368 "Print indications of the progress of run"),
369 _Option(["-noprintsets","noprintsets"], ["input"], None, 0,
370 "Do not print out the sets of species"),
371 _Option(["-printsets","printsets"], ["input"], None, 0,
372 "Print out the sets of species")]
373 _EmbossCommandLine.__init__(self, cmd, **kwargs)
374
375
377 """Commandline object for the eseqboot program from EMBOSS (OBSOLETE).
378
379 This is an EMBOSS wrapper around seqboot from PHYLIP.
380
381 It has been replaced by "fseqboot", see FSeqBootCommandline.
382 """
383 - def __init__(self, cmd="eseqboot", **kwargs):
384 self.parameters = \
385 [_Option(["-datafile","datafile"], ["input", "file"], None, 1,
386 "Input file"),
387 _Option(["-randseed","randseed"], ["input"], None, 1,
388 "Random number seed (must be odd)"),
389 _Option(["-method","method"], ["input"], None, 1,
390 "Choose the method"),
391 _Option(["-test","test"], ["input"], None, 1,
392 "Choose test"),
393 _Option(["-reps","reps"], ["input"], None, 1,
394 "How many replicates"),
395 _Option(["-inter","inter"], ["input"], None, 0,
396 "Interleaved input"),
397 _Option(["-enzymes","enzymes"], ["input"], None, 0,
398 "Present in input file"),
399 _Option(["-all","all"], ["input"], None, 0,
400 "All alleles present at each locus"),
401 _Option(["-printdata","printdata"], ["input"], None, 0,
402 "Print out the data at start of run"),
403 _Option(["-progress","progress"], ["input"], None, 0,
404 "Print indications of progress of run")]
405 _EmbossCommandLine.__init__(self, cmd, **kwargs)
406
407
409 """Commandline object for the fdnadist program from EMBOSS.
410
411 fdnadist is an EMBOSS wrapper for the PHYLIP program dnadist for
412 calulating distance matrices from DNA sequence files
413 """
414 - def __init__(self, cmd = "fdnadist", **kwargs):
415 self.parameters = \
416 [_Option(["-sequence", "sequence"], ["input"], None, 1,
417 "seq file to use (phylip)"),
418 _Option(["-method", "method"], ["input"], None, 1,
419 "sub. model [f,k,j,l,s]"),
420 _Option(["-gamma", "gamma"], ["input"], None, 0,
421 "gamma [g, i,n]"),
422 _Option(["-ncategories", "ncategories"], ["input"], None, 0,
423 "number of rate catergories (1-9)"),
424 _Option(["-rate", "rate"], ["input"], None, 0,
425 "rate for each category"),
426 _Option(["-categories","categories"], ["input"], None, 0,
427 "File of substitution rate categories"),
428 _Option(["-weights", "weights"], ["input"], None, 0,
429 "weights file"),
430 _Option(["-gammacoefficient", "gammacoefficient"], ["input"], None, 0,
431 "value for gamma (> 0.001)"),
432 _Option(["-invarfrac", "invarfrac"], ["input"], None, 0,
433 "proportoin of invariant sites"),
434 _Option(["-ttratio", "ttratio"], ["input"], None, 0,
435 "ts/tv ratio"),
436 _Option(["-freqsfrom", "freqsfrom"], ["input"], None, 0,
437 "use emprical base freqs"),
438 _Option(["-basefreq", "basefreq"], ["input"], None, 0,
439 "specify basefreqs"),
440 _Option(["-lower", "lower"], ["input"], None, 0,
441 "lower triangle matrix (y/N)")]
442 _EmbossCommandLine.__init__(self, cmd, **kwargs)
443
444
446 """Commandline object for the ftreedist program from EMBOSS.
447
448 ftreedist is an EMBOSS wrapper for the PHYLIP program treedist used for
449 calulating distance measures between phylogentic trees
450 """
451 - def __init__(self, cmd = "ftreedist", **kwargs):
452 self.parameters = \
453 [_Option(["-intreefile", "intreefile"], ["input"], None, 1,
454 "tree file to score (phylip)"),
455 _Option(["-dtype", "dtype"], ["input"], None, 0,
456 "distance type ([S]ymetric, [b]ranch score)"),
457 _Option(["-pairing", "pairing"], ["input"], None, 0,
458 "tree pairing method ([A]djacent pairs, all [p]ossible pairs)"),
459 _Option(["-style", "style"], ["input"], None, 0,
460 "output style - [V]erbose, [f]ill, [s]parse"),
461 _Option(["-noroot", "noroot"], ["input"], None, 0,
462 "treat trees as rooted [N/y]"),
463 _Option(["-outgrno", "outgrno"], ["input"], None, 0,
464 "which taxon to root the trees with (starts from 0)")]
465 _EmbossCommandLine.__init__(self, cmd, **kwargs)
466
467
469 """Commandline object for the fneighbor program from EMBOSS.
470
471 fneighbor is an EMBOSS wrapper for the PHYLIP program neighbor used for
472 calulating neighbor-joining or UPGMA trees from distance matrices
473 """
474 - def __init__(self, cmd = "fneighbor", **kwargs):
475 self.parameters = \
476 [_Option(["-datafile", "datafile"], ["input"], None, 1,
477 "dist file to use (phylip)"),
478 _Option(["-matrixtype", "matrixtype"], ["input"], None, 0,
479 "is martrix [S]quare pr [u]pper or [l]ower"),
480 _Option(["-treetype", "treetype"], ["input"], None, 0,
481 "nj or UPGMA tree (n/u)"),
482 _Option(["-outgrno","outgrno" ], ["input"], None, 0,
483 "taxon to use as OG"),
484 _Option(["-jumble", "jumble"], ["input"], None, 0,
485 "randommise input order (Y/n)"),
486 _Option(["-seed", "seed"], ["input"], None, 0,
487 "provide a random seed"),
488 _Option(["-trout", "trout"], ["input"], None, 0,
489 "write tree (Y/n)"),
490 _Option(["-outtreefile", "outtreefile"], ["input"], None, 0,
491 "filename for output tree"),
492 _Option(["-progress", "progress"], ["input"], None, 0,
493 "print progress (Y/n)"),
494 _Option(["-treeprint", "treeprint"], ["input"], None, 0,
495 "print tree (Y/n)")]
496 _EmbossCommandLine.__init__(self, cmd, **kwargs)
497
498
500 """Commandline object for the fseqboot program from EMBOSS.
501
502 fseqboot is an EMBOSS wrapper for the PHYLIP program seqboot used to
503 pseudo-sample alignment files
504 """
505 - def __init__(self, cmd = "fseqboot", **kwargs):
506 self.parameters = \
507 [_Option(["-sequence", "sequence"], ["input"], None, 1,
508 "seq file to sample (phylip)"),
509 _Option(["-categories", "catergories"], ["input"], None, 0,
510 "file of input categories"),
511 _Option(["-weights", "weights"], ["input"], None, 0,
512 " weights file"),
513 _Option(["-test", "test"], ["input"], None, 0,
514 "specify operation, default is bootstrap"),
515 _Option(["-regular", "regular"], ["input"], None, 0,
516 "absolute number to resample"),
517 _Option(["-fracsample", "fracsample"], ["input"], None, 0,
518 "fraction to resample"),
519 _Option(["-rewriteformat", "rewriteformat"], ["input"], None, 0,
520 "output format ([P]hyilp, [n]exus, [x]ml"),
521 _Option(["-seqtype", "seqtype"], ["input"], None, 0,
522 "output format ([D]na, [p]rotein, [r]na"),
523 _Option(["-blocksize", "blocksize"], ["input"], None, 0,
524 "print progress (Y/n)"),
525 _Option(["-reps", "reps"], ["input"], None, 0,
526 "how many replicates, defaults to 100)"),
527 _Option(["-justweights", "jusweights"], ["input"], None, 0,
528 "what to write out [D]atasets of just [w]eights"),
529 _Option(["-seed", "seed"], ["input"], None, 0,
530 "specify random seed"),
531 _Option(["-dotdiff", "dotdiff"], ["input"], None, 0,
532 "Use dot-differencing? [Y/n]"),]
533 _EmbossCommandLine.__init__(self, cmd, **kwargs)
534
535
537 """Commandline object for the fdnapars program from EMBOSS.
538
539 fdnapars is an EMBOSS version of the PHYLIP program dnapars, for
540 estimating trees from DNA sequences using parsiomny. Calling this command
541 without providing a value for the option "-intreefile" will invoke
542 "interactive mode" (and as a result fail if called with subprocess) if
543 "-auto" is not set to true
544 """
545 - def __init__(self, cmd = "fdnapars", **kwargs):
546 self.parameters = \
547 [_Option(["-sequence", "sequence"], ["input"], None, 1,
548 "seq file to use (phylip)"),
549 _Option(["-intreefile", "intreefile"], ["input"], None, 0,
550 "Phylip tree file"),
551 _Option(["-weights", "weights"], ["input"], None, 0,
552 "weights file"),
553 _Option(["-maxtrees", "maxtrees"], ["input"], None, 0,
554 "max trees to save during run"),
555 _Option(["-thorough", "thorough"], ["input"], None, 0,
556 "more thorough search (Y/n)"),
557 _Option(["-rearrange", "rearrange"], ["input"], None, 0,
558 "Rearrange on jsut 1 best tree (Y/n)"),
559 _Option(["-transversion", "transversion"], ["input"], None, 0,
560 "Use tranversion parsimony (y/N)"),
561 _Option(["-njumble", "njumble"], ["input"], None, 0,
562 "number of times to randomise input order (default is 0)"),
563 _Option(["-seed", "seed"], ["input"], None, 0,
564 "provde random seed"),
565 _Option(["-outgrno", "outgrno"], ["input"], None, 0,
566 "Specify outgroup"),
567 _Option(["-thresh", "thresh"], ["input"], None, 0,
568 "Use threshold parsimony (y/N)"),
569 _Option(["-threshold", "threshold"], ["input"], None, 0,
570 "Threshold value"),
571 _Option(["-trout", "trout"], ["input"], None, 0,
572 "Write trees to file (Y/n)"),
573 _Option(["-outtreefile", "outtreefile"], ["input"], None, 0,
574 "filename for output tree"),
575 _Option(["-dotdiff", "dotdiff"], ["input"], None, 0,
576 "Use dot-differencing? [Y/n]")]
577 _EmbossCommandLine.__init__(self, cmd, **kwargs)
578
579
581 """Commandline object for the fdnapars program from EMBOSS.
582
583 fprotpars is an EMBOSS version of the PHYLIP program protpars, for
584 estimating trees from protein sequences using parsiomny. Calling this
585 command without providing a value for the option "-intreefile" will invoke
586 "interactive mode" (and as a result fail if called with subprocess) if
587 "-auto" is not set to true
588 """
589 - def __init__(self, cmd = "fprotpars", **kwargs):
590 self.parameters = \
591 [_Option(["-sequence", "sequence"], ["input"], None, 1,
592 "seq file to use (phylip)"),
593 _Option(["-intreefile", "intreefile"], ["input"], None, 0,
594 "Phylip tree file to score"),
595 _Option(["-outtreefile", "outtreefile"], ["input"], None, 1,
596 "phylip tree output file"),
597 _Option(["-weights", "weights"], ["input"], None, 0,
598 "weights file"),
599 _Option(["-whichcode", "whichcode"], ["input"], None, 0,
600 "which genetic code, [U,M,V,F,Y]]"),
601 _Option(["-njumble", "njumble"], ["input"], None, 0,
602 "number of times to randomise input order (default is 0)"),
603 _Option(["-seed", "seed"], ["input"], None, 0,
604 "provde random seed"),
605 _Option(["-outgrno", "outgrno"], ["input"], None, 0,
606 "Specify outgroup"),
607 _Option(["-thresh", "thresh"], ["input"], None, 0,
608 "Use threshold parsimony (y/N)"),
609 _Option(["-threshold", "threshold"], ["input"], None, 0,
610 "Threshold value"),
611 _Option(["-trout", "trout"], ["input"], None, 0,
612 "Write trees to file (Y/n)"),
613 _Option(["-dotdiff", "dotdiff"], ["input"], None, 0,
614 "Use dot-differencing? [Y/n]")]
615 _EmbossCommandLine.__init__(self, cmd, **kwargs)
616
617
619 """Commandline object for the fprotdist program from EMBOSS.
620
621 fprotdist is an EMBOSS wrapper for the PHYLIP program protdist used to
622 estimate trees from protein sequences using parsimony
623 """
624 - def __init__(self, cmd = "fprotdist", **kwargs):
625 self.parameters = \
626 [_Option(["-sequence", "sequence"], ["input"], None, 1,
627 "seq file to use (phylip)"),
628 _Option(["-ncategories", "ncategories"], ["input"], None, 0,
629 "number of rate catergories (1-9)"),
630 _Option(["-rate", "rate"], ["input"], None, 0,
631 "rate for each category"),
632 _Option(["-catergories","catergories"], ["input"], None, 0,
633 "file of rates"),
634 _Option(["-weights", "weights"], ["input"], None, 0,
635 "weights file"),
636 _Option(["-method", "method"], ["input"], None, 0,
637 "sub. model [j,h,d,k,s,c]"),
638 _Option(["-gamma", "gamma"], ["input"], None, 0,
639 "gamma [g, i,c]"),
640 _Option(["-gammacoefficient", "gammacoefficient"], ["input"], None, 0,
641 "value for gamma (> 0.001)"),
642 _Option(["-invarcoefficient", "invarcoefficient"], ["input"], None, 0,
643 "float for variation of substitution rate among sites"),
644 _Option(["-aacateg", "aacateg"], ["input"], None, 0,
645 "Choose the category to use [G,C,H]"),
646 _Option(["-whichcode", "whichcode"], ["input"], None, 0,
647 "genetic code [c,m,v,f,y]"),
648 _Option(["-ease", "ease"], ["input"], None, 0,
649 "Pob change catergory (float between -0 and 1)"),
650 _Option(["-ttratio", "ttratio"], ["input"], None, 0,
651 "Transition/transversion ratio (0-1)"),
652 _Option(["-basefreq", "basefreq"], ["input"], None, 0,
653 "DNA base frequencies (space seperated list)")]
654 _EmbossCommandLine.__init__(self, cmd, **kwargs)
655
656
658 """Commandline object for the fconsense program from EMBOSS.
659
660 fconsense is an EMBOSS wrapper for the PHYLIP program consense used to
661 calculate consensus trees.
662 """
663 - def __init__(self, cmd = "fconsense", **kwargs):
664 self.parameters = \
665 [_Option(["-intreefile", "intreefile"], ["input"], None, 1,
666 "file with phylip trees to make consensus from"),
667 _Option(["-method", "method"], ["input"], None, 0,
668 "consensus method [s, mr, MRE, ml]"),
669 _Option(["-mlfrac", "mlfrac"], ["input"], None, 0,
670 "cut-off freq for a branch to appear in consensus (0.5-1.0)"),
671 _Option(["-root", "root"], ["input"], None, 0,
672 "treat trees as rooted (YES, no)"),
673 _Option(["-outgrno", "outgrno"], ["input"], None, 0,
674 "OTU to use as outgroup (starts from 0)"),
675 _Option(["-trout", "trout"], ["input"], None, 0,
676 "treat trees as rooted (YES, no)"),
677 _Option(["-outtreefile", "outtreefile"], ["input"], None, 0,
678 "Phylip tree output file (optional)")]
679 _EmbossCommandLine.__init__(self, cmd, **kwargs)
680
681
683 """Commandline object for the water program from EMBOSS.
684 """
685 - def __init__(self, cmd="water", **kwargs):
686 self.parameters = \
687 [_Option(["-asequence","asequence"], ["input", "file"], None, 1,
688 "First sequence to align"),
689 _Option(["-bsequence","bsequence"], ["input", "file"], None, 1,
690 "Second sequence to align"),
691 _Option(["-gapopen","gapopen"], ["input"], None, 1,
692 "Gap open penalty"),
693 _Option(["-gapextend","gapextend"], ["input"], None, 1,
694 "Gap extension penalty"),
695 _Option(["-datafile","datafile"], ["input", "file"], None, 0,
696 "Matrix file"),
697 _Option(["-similarity","similarity"], ["input"], None, 0,
698 "Display percent identity and similarity"),
699 _Option(["-snucleotide","snucleotide"], ["input"], None, 0,
700 "Sequences are nucleotide (boolean)"),
701 _Option(["-sprotein","sprotein"], ["input"], None, 0,
702 "Sequences are protein (boolean)"),
703 _Option(["-aformat","aformat"], ["input"], None, 0,
704 "Display output in a different specified output format")]
705 _EmbossCommandLine.__init__(self, cmd, **kwargs)
706
707
709 """Commandline object for the needle program from EMBOSS.
710 """
711 - def __init__(self, cmd="needle", **kwargs):
712 self.parameters = \
713 [_Option(["-asequence","asequence"], ["input", "file"], None, 1,
714 "First sequence to align"),
715 _Option(["-bsequence","bsequence"], ["input", "file"], None, 1,
716 "Second sequence to align"),
717 _Option(["-gapopen","gapopen"], ["input"], None, 1,
718 "Gap open penalty"),
719 _Option(["-gapextend","gapextend"], ["input"], None, 1,
720 "Gap extension penalty"),
721 _Option(["-datafile","datafile"], ["input", "file"], None, 0,
722 "Matrix file"),
723 _Option(["-similarity","similarity"], ["input"], None, 0,
724 "Display percent identity and similarity"),
725 _Option(["-snucleotide","snucleotide"], ["input"], None, 0,
726 "Sequences are nucleotide (boolean)"),
727 _Option(["-sprotein","sprotein"], ["input"], None, 0,
728 "Sequences are protein (boolean)"),
729 _Option(["-aformat","aformat"], ["input"], None, 0,
730 "Display output in a different specified output format")]
731 _EmbossCommandLine.__init__(self, cmd, **kwargs)
732
733
735 """Commandline object for the fuzznuc program from EMBOSS.
736 """
737 - def __init__(self, cmd="fuzznuc", **kwargs):
738 self.parameters = [
739 _Option(["-sequence","sequence"], ["input"], None, 1,
740 "Sequence database USA"),
741 _Option(["-pattern","pattern"], ["input"], None, 1,
742 "Search pattern, using standard IUPAC one-letter codes"),
743 _Option(["-mismatch","mismatch"], ["input"], None, 1,
744 "Number of mismatches"),
745 _Option(["-complement","complement"], ["input"], None, 0,
746 "Search complementary strand"),
747 _Option(["-rformat","rformat"], ["input"], None, 0,
748 "Specify the report format to output in.")]
749 _EmbossCommandLine.__init__(self, cmd, **kwargs)
750
751
753 """Commandline object for the est2genome program from EMBOSS.
754 """
755 - def __init__(self, cmd="est2genome", **kwargs):
756 self.parameters = [
757 _Option(["-est","est"], ["input"], None, 1,
758 "EST sequence(s)"),
759 _Option(["-genome","genome"], ["input"], None, 1,
760 "Genomic sequence"),
761 _Option(["-match","match"], ["input"], None, 0,
762 "Score for matching two bases"),
763 _Option(["-mismatch","mismatch"], ["input"], None, 0,
764 "Cost for mismatching two bases"),
765 _Option(["-gappenalty","gappenalty"], ["input"], None, 0,
766 "Cost for deleting a single base in either sequence, " + \
767 "excluding introns"),
768 _Option(["-intronpenalty","intronpenalty"], ["input"], None, 0,
769 "Cost for an intron, independent of length."),
770 _Option(["-splicepenalty","splicepenalty"], ["input"], None, 0,
771 "Cost for an intron, independent of length " + \
772 "and starting/ending on donor-acceptor sites"),
773 _Option(["-minscore","minscore"], ["input"], None, 0,
774 "Exclude alignments with scores below this threshold score."),
775 _Option(["-reverse","reverse"], ["input"], None, 0,
776 "Reverse the orientation of the EST sequence"),
777 _Option(["-splice","splice"], ["input"], None, 0,
778 "Use donor and acceptor splice sites."),
779 _Option(["-mode","mode"], ["input"], None, 0,
780 "This determines the comparion mode. 'both', 'forward' " + \
781 "'reverse'"),
782 _Option(["-best","best"], ["input"], None, 0,
783 "You can print out all comparisons instead of just the best"),
784 _Option(["-space","space"], ["input"], None, 0,
785 "for linear-space recursion."),
786 _Option(["-shuffle","shuffle"], ["input"], None, 0,
787 "Shuffle"),
788 _Option(["-seed","seed"], ["input"], None, 0,
789 "Random number seed"),
790 _Option(["-align","align"], ["input"], None, 0,
791 "Show the alignment."),
792 _Option(["-width","width"], ["input"], None, 0,
793 "Alignment width")
794 ]
795 _EmbossCommandLine.__init__(self, cmd, **kwargs)
796
797
799 """Commandline object for the etandem program from EMBOSS.
800 """
801 - def __init__(self, cmd="etandem", **kwargs):
802 self.parameters = [
803 _Option(["-sequence","sequence"], ["input", "file"], None, 1,
804 "Sequence"),
805 _Option(["-minrepeat","minrepeat"], ["input"], None, 1,
806 "Minimum repeat size"),
807 _Option(["-maxrepeat","maxrepeat"], ["input"], None, 1,
808 "Maximum repeat size"),
809 _Option(["-threshold","threshold"], ["input"], None, 0,
810 "Threshold score"),
811 _Option(["-mismatch","mismatch"], ["input"], None, 0,
812 "Allow N as a mismatch"),
813 _Option(["-uniform","uniform"], ["input"], None, 0,
814 "Allow uniform consensus"),
815 _Option(["-rformat","rformat"], ["output"], None, 0,
816 "Output report format")]
817 _EmbossCommandLine.__init__(self, cmd, **kwargs)
818
819
821 """Commandline object for the einverted program from EMBOSS.
822 """
823 - def __init__(self, cmd="einverted", **kwargs):
824 self.parameters = [
825 _Option(["-sequence","sequence"], ["input", "file"], None, 1,
826 "Sequence"),
827 _Option(["-gap","gap"], ["input", "file"], None, 1,
828 "Gap penalty"),
829 _Option(["-threshold","threshold"], ["input"], None, 1,
830 "Minimum score threshold"),
831 _Option(["-match","match"], ["input"], None, 1,
832 "Match score"),
833 _Option(["-mismatch","mismatch"], ["input"], None, 1,
834 "Mismatch score"),
835 _Option(["-maxrepeat","maxrepeat"], ["input"], None, 0,
836 "Maximum separation between the start and end of repeat"),
837 ]
838 _EmbossCommandLine.__init__(self, cmd, **kwargs)
839
840
842 """Commandline object for the palindrome program from EMBOSS.
843 """
844 - def __init__(self, cmd="palindrome", **kwargs):
845 self.parameters = [
846 _Option(["-sequence","sequence"], ["input", "file"], None, 1,
847 "Sequence"),
848 _Option(["-minpallen","minpallen"], ["input"], None, 1,
849 "Minimum palindrome length"),
850 _Option(["-maxpallen","maxpallen"], ["input"], None, 1,
851 "Maximum palindrome length"),
852 _Option(["-gaplimit","gaplimit"], ["input"], None, 1,
853 "Maximum gap between repeats"),
854 _Option(["-nummismatches","nummismatches"], ["input"], None, 1,
855 "Number of mismatches allowed"),
856 _Option(["-overlap","overlap"], ["input"], None, 1,
857 "Report overlapping matches"),
858 ]
859 _EmbossCommandLine.__init__(self, cmd, **kwargs)
860
861
863 """Commandline object for the tranalign program from EMBOSS.
864 """
865 - def __init__(self, cmd="tranalign", **kwargs):
866 self.parameters = [
867 _Option(["-asequence","asequence"], ["input", "file"], None, 1,
868 "Nucleotide sequences to be aligned."),
869 _Option(["-bsequence","bsequence"], ["input", "file"], None, 1,
870 "Protein sequence alignment"),
871 _Option(["-outseq","outseq"], ["output", "file"], None, 1,
872 "Output sequence file."),
873 _Option(["-table","table"], ["input"], None, 0,
874 "Code to use")]
875 _EmbossCommandLine.__init__(self, cmd, **kwargs)
876
877
879 """Commandline object for the diffseq program from EMBOSS.
880 """
881 - def __init__(self, cmd="diffseq", **kwargs):
882 self.parameters = [
883 _Option(["-asequence","asequence"], ["input", "file"], None, 1,
884 "First sequence to compare"),
885 _Option(["-bsequence","bsequence"], ["input", "file"], None, 1,
886 "Second sequence to compare"),
887 _Option(["-wordsize","wordsize"], ["input"], None, 1,
888 "Word size to use for comparisons (10 default)"),
889 _Option(["-aoutfeat","aoutfeat"], ["output", "file"], None, 1,
890 "File for output of first sequence's features"),
891 _Option(["-boutfeat","boutfeat"], ["output", "file"], None, 1,
892 "File for output of second sequence's features"),
893 _Option(["-rformat","rformat"], ["output"], None, 0,
894 "Output report file format")
895 ]
896 _EmbossCommandLine.__init__(self, cmd, **kwargs)
897
898
900 """Commandline for EMBOSS iep: calculated isoelectric point and charge.
901 """
902 - def __init__(self, cmd="iep", **kwargs):
903 self.parameters = [
904 _Option(["-sequence","sequence"], ["input", "file"], None, 1,
905 "Protein sequence(s) filename"),
906 _Option(["-amino","amino"], ["input"], None, 0),
907 _Option(["-lysinemodified","lysinemodified"], ["input"], None, 0),
908 _Option(["-disulphides","disulphides"], ["input"], None, 0),
909 _Option(["-notermini","notermini"], ["input"], None, 0),
910 ]
911 _EmbossCommandLine.__init__(self, cmd, **kwargs)
912
913
914
916 """Commandline object for the seqret program from EMBOSS.
917
918 This tool allows you to interconvert between different sequence file
919 formats (e.g. GenBank to FASTA). Combining Biopython's Bio.SeqIO module
920 with seqret using a suitable intermediate file format can allow you to
921 read/write to an even wider range of file formats.
922
923 This wrapper currently only supports the core functionality, things like
924 feature tables (in EMBOSS 6.1.0 onwards) are not yet included.
925 """
926 - def __init__(self, cmd="seqret", **kwargs):
927 self.parameters = [
928 _Option(["-sequence","sequence"], ["input", "file"], None, 0,
929 "Input sequence(s) filename"),
930 _Option(["-outseq","outseq"], ["output", "file"], None, 0,
931 "Output sequence file."),
932 _Option(["-sformat","sformat"], ["input"], None, 0,
933 "Input sequence(s) format (e.g. fasta, genbank)"),
934 _Option(["-osformat","osformat"], ["input"], None, 0,
935 "Output sequence(s) format (e.g. fasta, genbank)"),
936 ]
937 _EmbossMinimalCommandLine.__init__(self, cmd, **kwargs)
938
940
941
942
943 if not (self.outseq or self.filter or self.stdout) :
944 raise ValueError("You must either set outfile (output filename), "
945 "or enable filter or stdout (output to stdout).")
946 if not (self.sequence or self.filter or self.stdint) :
947 raise ValueError("You must either set sequence (input filename), "
948 "or enable filter or stdin (input from stdin).")
949 return _EmbossMinimalCommandLine._validate(self)
950