Back to index

python-biopython  1.60
Applications.py
Go to the documentation of this file.
00001 # Copyright 2001-2009 Brad Chapman.
00002 # Revisions copyright 2009-2010 by Peter Cock.
00003 # Revisions copyright 2009 by David Winter.
00004 # Revisions copyright 2009-2010 by Leighton Pritchard.
00005 # All rights reserved.
00006 # This code is part of the Biopython distribution and governed by its
00007 # license.  Please see the LICENSE file that should have been included
00008 # as part of this package.
00009 """Code to interact with and run various EMBOSS programs.
00010 
00011 These classes follow the AbstractCommandline interfaces for running
00012 programs.
00013 """
00014 
00015 from Bio.Application import _Option, _Switch, AbstractCommandline
00016 
00017 class _EmbossMinimalCommandLine(AbstractCommandline):
00018     """Base Commandline object for EMBOSS wrappers (PRIVATE).
00019 
00020     This is provided for subclassing, it deals with shared options
00021     common to all the EMBOSS tools:
00022 
00023      - auto               Turn off prompts
00024      - stdout             Write standard output
00025      - filter             Read standard input, write standard output
00026      - options            Prompt for standard and additional values
00027      - debug              Write debug output to program.dbg
00028      - verbose            Report some/full command line options
00029      - help               Report command line options. More
00030                           information on associated and general
00031                           qualifiers can be found with -help -verbose
00032      - warning            Report warnings
00033      - error              Report errors
00034      - fatal              Report fatal errors
00035      - die                Report dying program messages
00036     """
00037     def __init__(self, cmd=None, **kwargs):
00038         assert cmd is not None
00039         extra_parameters = [
00040            _Switch(["-auto","auto"], 
00041                    """Turn off prompts.
00042            
00043                    Automatic mode disables prompting, so we recommend you set
00044                    this argument all the time when calling an EMBOSS tool from
00045                    Biopython.
00046                    """),
00047            _Switch(["-stdout","stdout"],
00048                    "Write standard output."),
00049            _Switch(["-filter","filter"],
00050                    "Read standard input, write standard output."),
00051            _Switch(["-options","options"],
00052                    """Prompt for standard and additional values.
00053 
00054                    If you are calling an EMBOSS tool from within Biopython,
00055                    we DO NOT recommend using this option.
00056                    """),
00057            _Switch(["-debug","debug"],
00058                    "Write debug output to program.dbg."),
00059            _Switch(["-verbose","verbose"],
00060                    "Report some/full command line options"),
00061            _Switch(["-help","help"],
00062                    """Report command line options.
00063 
00064                    More information on associated and general qualifiers can
00065                    be found with -help -verbose
00066                    """),
00067            _Switch(["-warning","warning"],
00068                    "Report warnings."),
00069            _Switch(["-error","error"],
00070                    "Report errors."),
00071            _Switch(["-die","die"],
00072                    "Report dying program messages."),
00073             ]
00074         try:
00075             #Insert extra parameters - at the start just in case there
00076             #are any arguments which must come last:
00077             self.parameters = extra_parameters + self.parameters
00078         except AttributeError:
00079             #Should we raise an error?  The subclass should have set this up!
00080             self.parameters = extra_parameters
00081         AbstractCommandline.__init__(self, cmd, **kwargs)
00082 
00083 class _EmbossCommandLine(_EmbossMinimalCommandLine):
00084     """Base Commandline object for EMBOSS wrappers (PRIVATE).
00085 
00086     This is provided for subclassing, it deals with shared options
00087     common to all the EMBOSS tools plus:
00088     
00089      - outfile            Output filename
00090 
00091     """
00092     def __init__(self, cmd=None, **kwargs):
00093         assert cmd is not None
00094         extra_parameters = [
00095             _Option(["-outfile","outfile"],
00096                     "Output filename",
00097                     filename=True),
00098             ]
00099         try:
00100             #Insert extra parameters - at the start just in case there
00101             #are any arguments which must come last:
00102             self.parameters = extra_parameters + self.parameters
00103         except AttributeError:
00104             #Should we raise an error?  The subclass should have set this up!
00105             self.parameters = extra_parameters
00106         _EmbossMinimalCommandLine.__init__(self, cmd, **kwargs)
00107 
00108     def _validate(self):
00109         #Check the outfile, filter, or stdout option has been set.
00110         #We can't simply do this via the required flag for the outfile
00111         #output - this seems the simplest solution.
00112         if not (self.outfile or self.filter or self.stdout):
00113             raise ValueError("You must either set outfile (output filename), "
00114                              "or enable filter or stdout (output to stdout).")
00115         return _EmbossMinimalCommandLine._validate(self)
00116 
00117 class Primer3Commandline(_EmbossCommandLine):
00118     """Commandline object for the Primer3 interface from EMBOSS.
00119 
00120     The precise set of supported arguments depends on your version of EMBOSS.
00121     This version accepts arguments current at EMBOSS 6.1.0, but in order to
00122     remain backwards compatible also support the old argument names as well.
00123 
00124     e.g. Using EMBOSS 6.1.0 or later,
00125     
00126     >>> cline = Primer3Commandline(sequence="mysequence.fas", auto=True, hybridprobe=True)
00127     >>> cline.explainflag = True
00128     >>> cline.osizeopt=20
00129     >>> cline.psizeopt=200
00130     >>> cline.outfile = "myresults.out"
00131     >>> cline.bogusparameter = 1967     # Invalid parameter
00132     Traceback (most recent call last):
00133         ...
00134     ValueError: Option name bogusparameter was not found.
00135     >>> print cline
00136     eprimer3 -auto -outfile=myresults.out -sequence=mysequence.fas -hybridprobe=True -psizeopt=200 -osizeopt=20 -explainflag=True
00137 
00138     The equivalent for anyone still using an older version of EMBOSS would be:
00139 
00140     >>> cline = Primer3Commandline(sequence="mysequence.fas", auto=True, hybridprobe=True)
00141     >>> cline.explainflag = True
00142     >>> cline.oligosize=20              # Old EMBOSS, instead of osizeopt
00143     >>> cline.productosize=200          # Old EMBOSS, instead of psizeopt
00144     >>> cline.outfile = "myresults.out"
00145     >>> print cline
00146     eprimer3 -auto -outfile=myresults.out -sequence=mysequence.fas -hybridprobe=True -productosize=200 -oligosize=20 -explainflag=True
00147     
00148     """
00149     def __init__(self, cmd="eprimer3", **kwargs):
00150         self.parameters = [
00151            _Option(["-sequence","sequence"],
00152                    "Sequence to choose primers from.",
00153                    is_required=True),
00154            _Option(["-task","task"],
00155                    "Tell eprimer3 what task to perform."),
00156            _Option(["-hybridprobe","hybridprobe"],
00157                    "Find an internal oligo to use as a hyb probe."),
00158            _Option(["-numreturn","numreturn"],
00159                    "Maximum number of primer pairs to return."),
00160            _Option(["-includedregion","includedregion"],
00161                    "Subregion of the sequence in which to pick primers."),
00162            _Option(["-target","target"],
00163                    "Sequence to target for flanking primers."),
00164            _Option(["-excludedregion","excludedregion"],
00165                    "Regions to exclude from primer picking."),
00166            _Option(["-forwardinput","forwardinput"],
00167                    "Sequence of a forward primer to check."),
00168            _Option(["-reverseinput","reverseinput"],
00169                    "Sequence of a reverse primer to check."),
00170            _Option(["-gcclamp","gcclamp"],
00171                    "The required number of Gs and Cs at the 3' of each primer."),
00172            _Option(["-osize","osize"],
00173                    "Optimum length of a primer oligo."),
00174            _Option(["-minsize","minsize"],
00175                    "Minimum length of a primer oligo."),
00176            _Option(["-maxsize","maxsize"],
00177                    "Maximum length of a primer oligo."),
00178            _Option(["-otm","otm"],
00179                    "Optimum melting temperature for a primer oligo."),
00180            _Option(["-mintm","mintm"],
00181                    "Minimum melting temperature for a primer oligo."),
00182            _Option(["-maxtm","maxtm"],
00183                    "Maximum melting temperature for a primer oligo."),
00184            _Option(["-maxdifftm","maxdifftm"],
00185                    "Maximum difference in melting temperatures between "
00186                    "forward and reverse primers."),
00187            _Option(["-ogcpercent","ogcpercent"],
00188                    "Optimum GC% for a primer."),
00189            _Option(["-mingc","mingc"],
00190                    "Minimum GC% for a primer."),
00191            _Option(["-maxgc","maxgc"],
00192                    "Maximum GC% for a primer."),
00193            _Option(["-saltconc","saltconc"],
00194                    "Millimolar salt concentration in the PCR."),
00195            _Option(["-dnaconc","dnaconc"],
00196                    "Nanomolar concentration of annealing oligos in the PCR."),
00197            _Option(["-maxpolyx","maxpolyx"],
00198                    "Maximum allowable mononucleotide repeat length in a primer."),
00199            #Primer length:
00200            _Option(["-productosize","productosize"],
00201                    """Optimum size for the PCR product (OBSOLETE).
00202 
00203                    Option replaced in EMBOSS 6.1.0 by -psizeopt
00204                    """),
00205            _Option(["-psizeopt", "psizeopt"], 
00206                    """Optimum size for the PCR product.
00207 
00208                    Option added in EMBOSS 6.1.0, replacing -productosize
00209                    """),
00210            _Option(["-productsizerange","productsizerange"],
00211                    """Acceptable range of length for the PCR product (OBSOLETE).
00212 
00213                    Option replaced in EMBOSS 6.1.0 by -prange
00214                    """),
00215            _Option(["-prange", "prange"], 
00216                    """Acceptable range of length for the PCR product.
00217 
00218                    Option added in EMBOSS 6.1.0, replacing -productsizerange
00219                    """),
00220            #Primer temperature:
00221            _Option(["-productotm","productotm"],
00222                    """Optimum melting temperature for the PCR product (OBSOLETE).
00223 
00224                    Option replaced in EMBOSS 6.1.0 by -ptmopt
00225                    """),
00226            _Option(["-ptmopt", "ptmopt"], 
00227                    """Optimum melting temperature for the PCR product.
00228 
00229                    Option added in EMBOSS 6.1.0, replacing -productotm
00230                    """),
00231            _Option(["-productmintm","productmintm"],
00232                    """Minimum allowed melting temperature for the amplicon (OBSOLETE)
00233 
00234                    Option replaced in EMBOSS 6.1.0 by -ptmmin
00235                    """),
00236            _Option(["-ptmmin", "ptmmin"], 
00237                    """Minimum allowed melting temperature for the amplicon."),
00238 
00239                    Option added in EMBOSS 6.1.0, replacing -productmintm
00240                    """),
00241            _Option(["-productmaxtm","productmaxtm"],
00242                    """Maximum allowed melting temperature for the amplicon (OBSOLETE).
00243 
00244                    Option replaced in EMBOSS 6.1.0 by -ptmmax
00245                    """),
00246            _Option(["-ptmmax", "ptmmax"], 
00247                    """Maximum allowed melting temperature for the amplicon."),
00248 
00249                    Option added in EMBOSS 6.1.0, replacing -productmaxtm
00250                    """),
00251            #Note to self, should be -oexcludedregion not -oexcluderegion
00252            _Option(["-oexcludedregion", "oexcludedregion"], 
00253                    """Do not pick internal oligos in this region."),
00254 
00255                    Option added in EMBOSS 6.1.0, replacing -oligoexcludedregion.
00256                    """),
00257            _Option(["-oligoexcludedregion", "oligoexcludedregion"],
00258                    """Do not pick internal oligos in this region (OBSOLETE)."),
00259 
00260                    Option replaced in EMBOSS 6.1.0 by -oexcluderegion.
00261                    """),
00262            _Option(["-oligoinput","oligoinput"],
00263                    "Sequence of the internal oligo."),
00264            #Oligo length:
00265            _Option(["-oligosize","oligosize"], 
00266                    """Optimum length of internal oligo (OBSOLETE).
00267  
00268                    Option replaced in EMBOSS 6.1.0 by -osizeopt.
00269                    """),
00270            _Option(["-osizeopt", "osizeopt"], 
00271                    """Optimum length of internal oligo.
00272 
00273                    Option added in EMBOSS 6.1.0, replaces -oligosize
00274                    """),
00275            _Option(["-oligominsize","oligominsize"], 
00276                    """Minimum length of internal oligo (OBSOLETE)."),
00277  
00278                    Option replaced in EMBOSS 6.1.0 by -ominsize.
00279                    """),
00280            _Option(["-ominsize", "ominsize"], 
00281                    """Minimum length of internal oligo."
00282 
00283                    Option added in EMBOSS 6.1.0, replaces -oligominsize
00284                    """),
00285            _Option(["-oligomaxsize","oligomaxsize"], 
00286                    """Maximum length of internal oligo (OBSOLETE).
00287  
00288                    Option replaced in EMBOSS 6.1.0 by -omaxsize.
00289                    """),
00290            _Option(["-omaxsize", "omaxsize"], 
00291                    """Maximum length of internal oligo.
00292 
00293                    Option added in EMBOSS 6.1.0, replaces -oligomaxsize
00294                    """),
00295            #Oligo GC temperature:
00296            _Option(["-oligotm","oligotm"], 
00297                    """Optimum melting temperature of internal oligo (OBSOLETE).
00298  
00299                    Option replaced in EMBOSS 6.1.0 by -otmopt.
00300                    """),
00301            _Option(["-otmopt", "otmopt"], 
00302                    """Optimum melting temperature of internal oligo.
00303 
00304                    Option added in EMBOSS 6.1.0.
00305                    """),
00306            _Option(["-oligomintm","oligomintm"], 
00307                    """Minimum melting temperature of internal oligo (OBSOLETE).
00308  
00309                    Option replaced in EMBOSS 6.1.0 by -otmmin.
00310                    """),
00311            _Option(["-otmmin", "otmmin"], 
00312                    """Minimum melting temperature of internal oligo.
00313 
00314                    Option added in EMBOSS 6.1.0, replacing -oligomintm
00315                    """),
00316            _Option(["-oligomaxtm","oligomaxtm"], 
00317                    """Maximum melting temperature of internal oligo (OBSOLETE).
00318  
00319                    Option replaced in EMBOSS 6.1.0 by -otmmax.
00320                    """),
00321            _Option(["-otmmax", "otmmax"], 
00322                    """Maximum melting temperature of internal oligo.
00323 
00324                    Option added in EMBOSS 6.1.0, replacing -oligomaxtm
00325                    """),
00326            #Oligo GC percent:
00327            _Option(["-oligoogcpercent","oligoogcpercent"], 
00328                    """Optimum GC% for internal oligo (OBSOLETE).
00329  
00330                    Option replaced in EMBOSS 6.1.0 by -ogcopt.
00331                    """),
00332            _Option(["-ogcopt", "ogcopt"], 
00333                    """Optimum GC% for internal oligo."
00334 
00335                    Option added in EMBOSS 6.1.0, replacing -oligoogcpercent
00336                    """),
00337            _Option(["-oligomingc","oligomingc"], 
00338                    """Minimum GC% for internal oligo (OBSOLETE).
00339  
00340                    Option replaced in EMBOSS 6.1.0 by -ogcmin.
00341                    """),
00342            _Option(["-ogcmin", "ogcmin"], 
00343                    """Minimum GC% for internal oligo.
00344 
00345                    Option added in EMBOSS 6.1.0, replacing -oligomingc
00346                    """),
00347            _Option(["-oligomaxgc","oligomaxgc"], 
00348                    """Maximum GC% for internal oligo.
00349  
00350                    Option replaced in EMBOSS 6.1.0 by -ogcmax
00351                    """),
00352            _Option(["-ogcmax", "ogcmax"], 
00353                    """Maximum GC% for internal oligo."),
00354 
00355                    Option added in EMBOSS 6.1.0, replacing -oligomaxgc
00356                    """),
00357            #Oligo salt concentration:
00358            _Option(["-oligosaltconc","oligosaltconc"], 
00359                    """Millimolar concentration of salt in the hybridisation."),
00360  
00361                    Option replaced in EMBOSS 6.1.0 by -osaltconc
00362                    """),
00363            _Option(["-osaltconc", "osaltconc"], 
00364                    """Millimolar concentration of salt in the hybridisation."),
00365 
00366                    Option added in EMBOSS 6.1.0, replacing -oligosaltconc
00367                    """),
00368            _Option(["-oligodnaconc","oligodnaconc"], 
00369                    """Nanomolar concentration of internal oligo in the hybridisation.
00370  
00371                    Option replaced in EMBOSS 6.1.0 by -odnaconc
00372                    """),
00373            _Option(["-odnaconc", "odnaconc"], 
00374                    """Nanomolar concentration of internal oligo in the hybridisation.
00375 
00376                    Option added in EMBOSS 6.1.0, replacing -oligodnaconc
00377                    """),
00378            #Oligo self complementarity
00379            _Option(["-oligoselfany","oligoselfany"], 
00380                    """Maximum allowable alignment score for self-complementarity (OBSOLETE).
00381  
00382                    Option replaced in EMBOSS 6.1.0 by -oanyself
00383                    """),
00384            _Option(["-oanyself", "oanyself"], 
00385                    """Maximum allowable alignment score for self-complementarity."),
00386 
00387                    Option added in EMBOSS 6.1.0, replacing -oligoselfany
00388                    """),
00389            _Option(["-oligoselfend","oligoselfend"], 
00390                    """Maximum allowable 3`-anchored global alignment score "
00391                    for self-complementarity (OBSOLETE).
00392  
00393                    Option replaced in EMBOSS 6.1.0 by -oendself
00394                    """),
00395            _Option(["-oendself", "oendself"], 
00396                    """Max 3`-anchored self-complementarity global alignment score.
00397 
00398                    Option added in EMBOSS 6.1.0, replacing -oligoselfend
00399                    """),
00400            _Option(["-oligomaxpolyx","oligomaxpolyx"], 
00401                    """Maximum length of mononucleotide repeat in internal oligo (OBSOLETE).
00402 
00403                    Option replaced in EMBOSS 6.1.0 by -opolyxmax
00404                    """),
00405            _Option(["-opolyxmax", "opolyxmax"], 
00406                    """Maximum length of mononucleotide repeat in internal oligo."),
00407 
00408                    Option added in EMBOSS 6.1.0, replacing -oligomaxpolyx
00409                    """),
00410            _Option(["-mispriminglibraryfile","mispriminglibraryfile"],
00411                     "File containing library of sequences to avoid amplifying"),
00412            _Option(["-maxmispriming","maxmispriming"],
00413                    "Maximum allowed similarity of primers to sequences in "
00414                    "library specified by -mispriminglibrary"),
00415            _Option(["-oligomaxmishyb","oligomaxmishyb"], 
00416                    """Maximum alignment score for hybridisation of internal oligo to
00417                    library specified by -oligomishyblibraryfile (OBSOLETE).
00418 
00419                    Option replaced in EMBOSS 6.1.0 by -omishybmax
00420                    """),
00421            _Option(["-omishybmax", "omishybmax"], 
00422                    """Maximum alignment score for hybridisation of internal oligo to
00423                    library specified by -mishyblibraryfile.
00424 
00425                    Option added in EMBOSS 6.1.0, replacing -oligomaxmishyb
00426                    """),
00427            _Option(["-oligomishyblibraryfile", "oligomishyblibraryfile"],
00428                   
00429                     """Library file of seqs to avoid internal oligo hybridisation (OBSOLETE).
00430 
00431                    Option replaced in EMBOSS 6.1.0 by -mishyblibraryfile
00432                    """),
00433            _Option(["-mishyblibraryfile", "mishyblibraryfile"],
00434                     """Library file of seqs to avoid internal oligo hybridisation.
00435 
00436                    Option added in EMBOSS 6.1.0, replacing -oligomishyblibraryfile
00437                    """),
00438            _Option(["-explainflag","explainflag"],
00439                    "Produce output tags with eprimer3 statistics"),
00440            ]
00441         _EmbossCommandLine.__init__(self, cmd, **kwargs)
00442         
00443 
00444 class PrimerSearchCommandline(_EmbossCommandLine):
00445     """Commandline object for the primersearch program from EMBOSS.
00446     """
00447     def __init__(self, cmd="primersearch", **kwargs):
00448         self.parameters = [
00449           _Option(["-seqall","-sequences","sequences","seqall"],
00450                   "Sequence to look for the primer pairs in.",
00451                   is_required=True),
00452                   #When this wrapper was written primersearch used -sequences
00453                   #as the argument name. Since at least EMBOSS 5.0 (and
00454                   #perhaps earlier) this has been -seqall instead.
00455           _Option(["-infile","-primers","primers","infile"],
00456                   "File containing the primer pairs to search for.",
00457                   filename=True,
00458                   is_required=True),
00459                   #When this wrapper was written primersearch used -primers
00460                   #as the argument name. Since at least EMBOSS 5.0 (and
00461                   #perhaps earlier) this has been -infile instead.
00462           _Option(["-mismatchpercent","mismatchpercent"],
00463                   "Allowed percentage mismatch (any integer value, default 0).",
00464                   is_required=True),
00465           _Option(["-snucleotide","snucleotide"],
00466                   "Sequences are nucleotide (boolean)"),
00467           _Option(["-sprotein","sprotein"],
00468                   "Sequences are protein (boolean)"),
00469           ]
00470         _EmbossCommandLine.__init__(self, cmd, **kwargs)
00471 
00472 
00473 class FDNADistCommandline(_EmbossCommandLine):
00474     """Commandline object for the fdnadist program from EMBOSS.
00475 
00476     fdnadist is an EMBOSS wrapper for the PHYLIP program dnadist for
00477     calulating distance matrices from DNA sequence files.
00478     """
00479     def __init__(self, cmd = "fdnadist", **kwargs):
00480         self.parameters = [
00481         _Option(["-sequence", "sequence"],
00482                 "seq file to use (phylip)",
00483                 filename=True,
00484                 is_required=True),
00485         _Option(["-method", "method"],
00486                  "sub. model [f,k,j,l,s]",
00487                 is_required=True),
00488         _Option(["-gamma", "gamma"],
00489                  "gamma [g, i,n]"),
00490         _Option(["-ncategories", "ncategories"],
00491                  "number of rate catergories (1-9)"),
00492         _Option(["-rate", "rate"],
00493                  "rate for each category"),
00494         _Option(["-categories","categories"],
00495                  "File of substitution rate categories"),
00496         _Option(["-weights", "weights"],
00497                  "weights file"),
00498         _Option(["-gammacoefficient", "gammacoefficient"],
00499                  "value for gamma (> 0.001)"),
00500         _Option(["-invarfrac", "invarfrac"],
00501                  "proportoin of invariant sites"),
00502         _Option(["-ttratio", "ttratio"],
00503                  "ts/tv ratio"),
00504         _Option(["-freqsfrom", "freqsfrom"],
00505                  "use emprical base freqs"),
00506         _Option(["-basefreq", "basefreq"],
00507                  "specify basefreqs"),
00508         _Option(["-lower", "lower"],
00509                  "lower triangle matrix (y/N)")]
00510         _EmbossCommandLine.__init__(self, cmd, **kwargs)
00511 
00512 
00513 class FTreeDistCommandline(_EmbossCommandLine):
00514     """Commandline object for the ftreedist program from EMBOSS.
00515 
00516     ftreedist is an EMBOSS wrapper for the PHYLIP program treedist used for
00517     calulating distance measures between phylogentic trees.
00518     """
00519     def __init__(self, cmd = "ftreedist", **kwargs):
00520         self.parameters = [
00521         _Option(["-intreefile", "intreefile"],
00522                 "tree file to score (phylip)",
00523                 filename=True,
00524                 is_required=True),
00525         _Option(["-dtype", "dtype"],
00526                  "distance type ([S]ymetric, [b]ranch score)"),
00527         _Option(["-pairing", "pairing"],
00528                  "tree pairing method ([A]djacent pairs, all [p]ossible pairs)"),
00529         _Option(["-style", "style"],
00530                  "output style - [V]erbose, [f]ill, [s]parse"),
00531         _Option(["-noroot", "noroot"],
00532                  "treat trees as rooted [N/y]"),
00533         _Option(["-outgrno", "outgrno"],
00534                  "which taxon to root the trees with (starts from 0)")]
00535         _EmbossCommandLine.__init__(self, cmd, **kwargs)
00536 
00537 
00538 class FNeighborCommandline(_EmbossCommandLine):
00539     """Commandline object for the fneighbor program from EMBOSS.
00540 
00541     fneighbor is an EMBOSS wrapper for the PHYLIP program neighbor used for
00542     calulating neighbor-joining or UPGMA trees from distance matrices.
00543     """
00544     def __init__(self, cmd = "fneighbor", **kwargs):
00545         self.parameters = [
00546         _Option(["-datafile", "datafile"],
00547                 "dist file to use (phylip)",
00548                 filename=True,
00549                 is_required=True),
00550         _Option(["-matrixtype", "matrixtype"],
00551                  "is martrix [S]quare pr [u]pper or [l]ower"),
00552         _Option(["-treetype", "treetype"],
00553                  "nj or UPGMA tree (n/u)"),
00554         _Option(["-outgrno","outgrno" ],
00555                  "taxon to use as OG"),
00556         _Option(["-jumble", "jumble"],
00557                  "randommise input order (Y/n)"),
00558         _Option(["-seed", "seed"],
00559                  "provide a random seed"),
00560         _Option(["-trout", "trout"],
00561                  "write tree (Y/n)"),
00562         _Option(["-outtreefile", "outtreefile"],
00563                  "filename for output tree"),
00564         _Option(["-progress", "progress"],
00565                  "print progress (Y/n)"),
00566         _Option(["-treeprint", "treeprint"],
00567                  "print tree (Y/n)")]
00568         _EmbossCommandLine.__init__(self, cmd, **kwargs)
00569 
00570 
00571 class FSeqBootCommandline(_EmbossCommandLine):
00572     """Commandline object for the fseqboot program from EMBOSS.
00573 
00574     fseqboot is an EMBOSS wrapper for the PHYLIP program seqboot used to
00575     pseudo-sample alignment files.
00576     """
00577     def __init__(self, cmd = "fseqboot", **kwargs):
00578         self.parameters = [
00579         _Option(["-sequence", "sequence"],
00580                 "seq file to sample (phylip)",
00581                 filename=True,
00582                 is_required=True),
00583         _Option(["-categories", "catergories"],
00584                  "file of input categories"),
00585         _Option(["-weights", "weights"],
00586                  " weights file"),
00587         _Option(["-test", "test"],
00588                  "specify operation, default is bootstrap"),
00589         _Option(["-regular", "regular"],
00590                  "absolute number to resample"),
00591         _Option(["-fracsample", "fracsample"],
00592                  "fraction to resample"),
00593         _Option(["-rewriteformat", "rewriteformat"],
00594                  "output format ([P]hyilp, [n]exus, [x]ml"),
00595         _Option(["-seqtype", "seqtype"],
00596                  "output format ([D]na, [p]rotein, [r]na"),
00597         _Option(["-blocksize", "blocksize"],
00598                  "print progress (Y/n)"),
00599         _Option(["-reps", "reps"],
00600                  "how many replicates, defaults to 100)"),
00601         _Option(["-justweights", "jusweights"],
00602                  "what to write out [D]atasets of just [w]eights"),
00603         _Option(["-seed", "seed"],
00604                  "specify random seed"),
00605         _Option(["-dotdiff", "dotdiff"],
00606                  "Use dot-differencing? [Y/n]"),]
00607         _EmbossCommandLine.__init__(self, cmd, **kwargs)
00608 
00609 
00610 class FDNAParsCommandline(_EmbossCommandLine):
00611     """Commandline object for the fdnapars program from EMBOSS.
00612 
00613     fdnapars is an EMBOSS version of the PHYLIP program dnapars, for
00614     estimating trees from DNA sequences using parsiomny. Calling this command
00615     without providing a value for the option "-intreefile" will invoke
00616     "interactive mode" (and as a result fail if called with subprocess) if
00617     "-auto" is not set to true.
00618     """
00619     def __init__(self, cmd = "fdnapars", **kwargs):
00620         self.parameters = [
00621         _Option(["-sequence", "sequence"],
00622                 "seq file to use (phylip)",
00623                 filename=True,
00624                 is_required=True),
00625         _Option(["-intreefile", "intreefile"],
00626                  "Phylip tree file"),
00627         _Option(["-weights", "weights"],
00628                  "weights file"),
00629         _Option(["-maxtrees", "maxtrees"],
00630                  "max trees to save during run"),
00631         _Option(["-thorough", "thorough"],
00632                  "more thorough search (Y/n)"),
00633         _Option(["-rearrange", "rearrange"],
00634                  "Rearrange on jsut 1 best tree (Y/n)"),
00635         _Option(["-transversion", "transversion"],
00636                  "Use tranversion parsimony (y/N)"),
00637         _Option(["-njumble", "njumble"],
00638                  "number of times to randomise input order (default is 0)"),
00639         _Option(["-seed", "seed"],
00640                  "provde random seed"),
00641         _Option(["-outgrno", "outgrno"],
00642                  "Specify outgroup"),
00643         _Option(["-thresh", "thresh"],
00644                  "Use threshold parsimony (y/N)"),
00645         _Option(["-threshold", "threshold"],
00646                  "Threshold value"),
00647         _Option(["-trout", "trout"],
00648                  "Write trees to file (Y/n)"),
00649         _Option(["-outtreefile", "outtreefile"],
00650                  "filename for output tree"),
00651         _Option(["-dotdiff", "dotdiff"],
00652                  "Use dot-differencing? [Y/n]")]
00653         _EmbossCommandLine.__init__(self, cmd, **kwargs)
00654 
00655 
00656 class FProtParsCommandline(_EmbossCommandLine):
00657     """Commandline object for the fdnapars program from EMBOSS.
00658 
00659     fprotpars is an EMBOSS version of the PHYLIP program protpars, for
00660     estimating trees from protein  sequences using parsiomny. Calling this
00661     command without providing a value for the option "-intreefile" will invoke
00662     "interactive mode" (and as a result fail if called with subprocess) if
00663     "-auto" is not set to true.
00664     """
00665     def __init__(self, cmd = "fprotpars", **kwargs):
00666         self.parameters = [
00667         _Option(["-sequence", "sequence"],
00668                 "seq file to use (phylip)",
00669                 filename=True,
00670                 is_required=True),
00671         _Option(["-intreefile", "intreefile"],
00672                  "Phylip tree file to score"),
00673         _Option(["-outtreefile", "outtreefile"],
00674                 "phylip tree output file",
00675                 filename=True,
00676                 is_required=True),
00677         _Option(["-weights", "weights"],
00678                  "weights file"),
00679         _Option(["-whichcode", "whichcode"],
00680                  "which genetic code, [U,M,V,F,Y]]"),
00681         _Option(["-njumble", "njumble"],
00682                  "number of times to randomise input order (default is 0)"),
00683         _Option(["-seed", "seed"],
00684                  "provde random seed"),
00685         _Option(["-outgrno", "outgrno"],
00686                  "Specify outgroup"),
00687         _Option(["-thresh", "thresh"],
00688                  "Use threshold parsimony (y/N)"),
00689         _Option(["-threshold", "threshold"],
00690                  "Threshold value"),
00691         _Option(["-trout", "trout"],
00692                  "Write trees to file (Y/n)"),
00693         _Option(["-dotdiff", "dotdiff"],
00694                  "Use dot-differencing? [Y/n]")]
00695         _EmbossCommandLine.__init__(self, cmd, **kwargs)
00696 
00697 
00698 class FProtDistCommandline(_EmbossCommandLine):
00699     """Commandline object for the fprotdist program from EMBOSS.
00700 
00701     fprotdist is an EMBOSS wrapper for the PHYLIP program protdist used to
00702     estimate trees from protein sequences using parsimony
00703     """
00704     def __init__(self, cmd = "fprotdist", **kwargs):
00705         self.parameters = [
00706         _Option(["-sequence", "sequence"],
00707                 "seq file to use (phylip)",
00708                 filename=True,
00709                 is_required=True),
00710         _Option(["-ncategories", "ncategories"],
00711                  "number of rate catergories (1-9)"),
00712         _Option(["-rate", "rate"],
00713                  "rate for each category"),
00714         _Option(["-catergories","catergories"],
00715                  "file of rates"),
00716         _Option(["-weights", "weights"],
00717                  "weights file"),
00718         _Option(["-method", "method"],
00719                  "sub. model [j,h,d,k,s,c]"),
00720         _Option(["-gamma", "gamma"],
00721                  "gamma [g, i,c]"),
00722         _Option(["-gammacoefficient", "gammacoefficient"],
00723                  "value for gamma (> 0.001)"),
00724         _Option(["-invarcoefficient", "invarcoefficient"],
00725                  "float for variation of substitution rate among sites"),
00726         _Option(["-aacateg", "aacateg"],
00727                  "Choose the category to use [G,C,H]"),
00728         _Option(["-whichcode", "whichcode"],
00729                  "genetic code [c,m,v,f,y]"),
00730         _Option(["-ease", "ease"],
00731                  "Pob change catergory (float between -0 and 1)"),
00732         _Option(["-ttratio", "ttratio"],
00733                  "Transition/transversion ratio (0-1)"),
00734         _Option(["-basefreq", "basefreq"],
00735                  "DNA base frequencies (space seperated list)")]
00736         _EmbossCommandLine.__init__(self, cmd, **kwargs)
00737 
00738 
00739 class FConsenseCommandline(_EmbossCommandLine):
00740     """Commandline object for the fconsense program from EMBOSS.
00741 
00742     fconsense is an EMBOSS wrapper for the PHYLIP program consense used to
00743     calculate consensus trees.
00744     """
00745     def __init__(self, cmd = "fconsense", **kwargs):
00746         self.parameters = [
00747         _Option(["-intreefile", "intreefile"],
00748                 "file with phylip trees to make consensus from",
00749                 filename=True,
00750                 is_required=True),
00751         _Option(["-method", "method"],
00752                  "consensus method [s, mr, MRE, ml]"),
00753         _Option(["-mlfrac", "mlfrac"],
00754                  "cut-off freq for a branch to appear in consensus (0.5-1.0)"),
00755         _Option(["-root", "root"],
00756                  "treat trees as rooted (YES, no)"),
00757         _Option(["-outgrno", "outgrno"],
00758                  "OTU to use as outgroup (starts from 0)"),
00759         _Option(["-trout", "trout"],
00760                  "treat trees as rooted (YES, no)"),
00761         _Option(["-outtreefile", "outtreefile"],
00762                  "Phylip tree output file (optional)")]
00763         _EmbossCommandLine.__init__(self, cmd, **kwargs)
00764 
00765 
00766 class WaterCommandline(_EmbossCommandLine):
00767     """Commandline object for the water program from EMBOSS.
00768     """
00769     def __init__(self, cmd="water", **kwargs):
00770         self.parameters = [
00771          _Option(["-asequence","asequence"],
00772                  "First sequence to align",
00773                  filename=True,
00774                  is_required=True),
00775          _Option(["-bsequence","bsequence"],
00776                  "Second sequence to align",
00777                  filename=True,
00778                  is_required=True),
00779          _Option(["-gapopen","gapopen"],
00780                  "Gap open penalty",
00781                  is_required=True),
00782          _Option(["-gapextend","gapextend"],
00783                  "Gap extension penalty",
00784                  is_required=True),
00785          _Option(["-datafile","datafile"],
00786                  "Matrix file",
00787                  filename=True),
00788          _Switch(["-nobrief", "nobrief"],
00789                  "Display extended identity and similarity"),
00790          _Switch(["-brief", "brief"],
00791                  "Display brief identity and similarity"),
00792          _Option(["-similarity","similarity"],
00793                  "Display percent identity and similarity"),
00794          _Option(["-snucleotide","snucleotide"],
00795                  "Sequences are nucleotide (boolean)"),
00796          _Option(["-sprotein","sprotein"],
00797                  "Sequences are protein (boolean)"),
00798          _Option(["-aformat","aformat"],
00799                  "Display output in a different specified output format")]
00800         _EmbossCommandLine.__init__(self, cmd, **kwargs)
00801 
00802 
00803 class NeedleCommandline(_EmbossCommandLine):
00804     """Commandline object for the needle program from EMBOSS.
00805     """
00806     def __init__(self, cmd="needle", **kwargs):
00807         self.parameters = [
00808          _Option(["-asequence","asequence"],
00809                  "First sequence to align",
00810                  filename=True,
00811                  is_required=True),
00812          _Option(["-bsequence","bsequence"],
00813                   "Second sequence to align",
00814                  filename=True,
00815                  is_required=True),
00816          _Option(["-gapopen","gapopen"],
00817                  "Gap open penalty",
00818                  is_required=True),
00819          _Option(["-gapextend","gapextend"],
00820                  "Gap extension penalty",
00821                  is_required=True),
00822          _Option(["-datafile","datafile"],
00823                  "Matrix file",
00824                  filename=True),
00825          _Option(["-endweight", "endweight"],
00826                  "Apply And gap penalties"),
00827          _Option(["-endopen", "endopen"],
00828                  "The score taken away when an end gap is created."),
00829          _Option(["-endextend", "endextend"],
00830                  "The score added to the end gap penality for each base or "
00831                  "residue in the end gap."),
00832          _Switch(["-nobrief", "nobrief"],
00833                  "Display extended identity and similarity"),
00834          _Switch(["-brief", "brief"],
00835                  "Display brief identity and similarity"),
00836          _Option(["-similarity","similarity"],
00837                  "Display percent identity and similarity"),
00838          _Option(["-snucleotide","snucleotide"],
00839                  "Sequences are nucleotide (boolean)"),
00840          _Option(["-sprotein","sprotein"],
00841                  "Sequences are protein (boolean)"),
00842          _Option(["-aformat","aformat"],
00843                  "Display output in a different specified output format")]
00844         _EmbossCommandLine.__init__(self, cmd, **kwargs)
00845 
00846 
00847 class NeedleallCommandline(_EmbossCommandLine):
00848     """Commandline object for the needleall program from EMBOSS.
00849     """
00850     def __init__(self, cmd="needleall", **kwargs):
00851         self.parameters = [
00852          _Option(["-asequence","asequence"],
00853                  "First sequence to align",
00854                  filename=True,
00855                  is_required=True),
00856          _Option(["-bsequence","bsequence"],
00857                   "Second sequence to align",
00858                  filename=True,
00859                  is_required=True),
00860          _Option(["-gapopen","gapopen"],
00861                  "Gap open penalty",
00862                  is_required=True),
00863          _Option(["-gapextend","gapextend"],
00864                  "Gap extension penalty",
00865                  is_required=True),
00866          _Option(["-datafile","datafile"],
00867                  "Matrix file",
00868                  filename=True),
00869          _Option(["-minscore","minscore"],
00870                  "Exclude alignments with scores below this threshold score."),
00871          _Option(["-errorfile", "errorfile"],
00872                  "Error file to be written to."),
00873          _Option(["-endweight", "endweight"],
00874                  "Apply And gap penalties"),
00875          _Option(["-endopen", "endopen"],
00876                  "The score taken away when an end gap is created."),
00877          _Option(["-endextend", "endextend"],
00878                  "The score added to the end gap penality for each base or "
00879                  "residue in the end gap."),
00880          _Switch(["-nobrief", "nobrief"],
00881                  "Display extended identity and similarity"),
00882          _Switch(["-brief", "brief"],
00883                  "Display brief identity and similarity"),
00884          _Option(["-similarity","similarity"],
00885                  "Display percent identity and similarity"),
00886          _Option(["-snucleotide","snucleotide"],
00887                  "Sequences are nucleotide (boolean)"),
00888          _Option(["-sprotein","sprotein"],
00889                  "Sequences are protein (boolean)"),
00890          _Option(["-aformat","aformat"],
00891                  "Display output in a different specified output format")]
00892         _EmbossCommandLine.__init__(self, cmd, **kwargs)
00893 
00894 
00895 class StretcherCommandline(_EmbossCommandLine):
00896     """Commandline object for the stretcher program from EMBOSS.
00897     """
00898     def __init__(self, cmd="stretcher", **kwargs):
00899         self.parameters = [
00900          _Option(["-asequence","asequence"],
00901                  "First sequence to align",
00902                  filename=True,
00903                  is_required=True),
00904          _Option(["-bsequence","bsequence"],
00905                   "Second sequence to align",
00906                  filename=True,
00907                  is_required=True),
00908          _Option(["-gapopen","gapopen"],
00909                  "Gap open penalty",
00910                  is_required=True,
00911                  checker_function=lambda value: isinstance(value, int)),
00912          _Option(["-gapextend","gapextend"],
00913                  "Gap extension penalty",
00914                  is_required=True,
00915                  checker_function=lambda value: isinstance(value, int)),
00916          _Option(["-datafile","datafile"],
00917                  "Matrix file",
00918                  filename=True),
00919          _Option(["-snucleotide","snucleotide"],
00920                  "Sequences are nucleotide (boolean)"),
00921          _Option(["-sprotein","sprotein"],
00922                  "Sequences are protein (boolean)"),
00923          _Option(["-aformat","aformat"],
00924                  "Display output in a different specified output format")]
00925         _EmbossCommandLine.__init__(self, cmd, **kwargs)
00926 
00927 
00928 class FuzznucCommandline(_EmbossCommandLine):
00929     """Commandline object for the fuzznuc program from EMBOSS.
00930     """
00931     def __init__(self, cmd="fuzznuc", **kwargs):
00932         self.parameters = [
00933          _Option(["-sequence","sequence"],
00934                  "Sequence database USA",
00935                  is_required=True),
00936          _Option(["-pattern","pattern"],
00937                  "Search pattern, using standard IUPAC one-letter codes",
00938                  is_required=True),
00939          _Option(["-mismatch","mismatch"],
00940                  "Number of mismatches",
00941                  is_required=True),
00942          _Option(["-complement","complement"],
00943                  "Search complementary strand"),
00944          _Option(["-rformat","rformat"],
00945                  "Specify the report format to output in.")]
00946         _EmbossCommandLine.__init__(self, cmd, **kwargs)
00947 
00948 
00949 class Est2GenomeCommandline(_EmbossCommandLine):
00950     """Commandline object for the est2genome program from EMBOSS.
00951     """
00952     def __init__(self, cmd="est2genome", **kwargs):
00953         self.parameters = [
00954          _Option(["-est","est"],
00955                  "EST sequence(s)",
00956                  is_required=True),
00957          _Option(["-genome","genome"],
00958                  "Genomic sequence",
00959                  is_required=True),
00960          _Option(["-match","match"], 
00961                  "Score for matching two bases"),
00962          _Option(["-mismatch","mismatch"],
00963                  "Cost for mismatching two bases"),
00964          _Option(["-gappenalty","gappenalty"],
00965                  "Cost for deleting a single base in either sequence, "
00966                  "excluding introns"),
00967          _Option(["-intronpenalty","intronpenalty"],
00968                  "Cost for an intron, independent of length."),
00969          _Option(["-splicepenalty","splicepenalty"],
00970                  "Cost for an intron, independent of length "
00971                  "and starting/ending on donor-acceptor sites"),
00972          _Option(["-minscore","minscore"],
00973                  "Exclude alignments with scores below this threshold score."),
00974          _Option(["-reverse","reverse"],
00975                  "Reverse the orientation of the EST sequence"),
00976          _Option(["-splice","splice"],
00977                  "Use donor and acceptor splice sites."),
00978          _Option(["-mode","mode"],
00979                  "This determines the comparion mode. 'both', 'forward' "
00980                  "'reverse'"),
00981          _Option(["-best","best"],
00982                  "You can print out all comparisons instead of just the best"),
00983          _Option(["-space","space"],
00984                  "for linear-space recursion."),
00985          _Option(["-shuffle","shuffle"],
00986                  "Shuffle"),
00987          _Option(["-seed","seed"],
00988                  "Random number seed"),
00989          _Option(["-align","align"],
00990                  "Show the alignment."),
00991          _Option(["-width","width"],
00992                  "Alignment width")
00993         ]
00994         _EmbossCommandLine.__init__(self, cmd, **kwargs)
00995 
00996 
00997 class ETandemCommandline(_EmbossCommandLine):
00998     """Commandline object for the etandem program from EMBOSS.
00999     """
01000     def __init__(self, cmd="etandem", **kwargs):
01001         self.parameters = [
01002          _Option(["-sequence","sequence"],
01003                  "Sequence",
01004                  filename=True,
01005                  is_required=True),
01006          _Option(["-minrepeat","minrepeat"],
01007                  "Minimum repeat size",
01008                  is_required=True),
01009          _Option(["-maxrepeat","maxrepeat"],
01010                  "Maximum repeat size",
01011                  is_required=True),
01012          _Option(["-threshold","threshold"],
01013                  "Threshold score"),
01014          _Option(["-mismatch","mismatch"],
01015                    "Allow N as a mismatch"),
01016          _Option(["-uniform","uniform"],
01017                    "Allow uniform consensus"),
01018          _Option(["-rformat","rformat"],
01019                  "Output report format")]
01020         _EmbossCommandLine.__init__(self, cmd, **kwargs)
01021 
01022 
01023 class EInvertedCommandline(_EmbossCommandLine):
01024     """Commandline object for the einverted program from EMBOSS.
01025     """
01026     def __init__(self, cmd="einverted", **kwargs):
01027         self.parameters = [
01028          _Option(["-sequence","sequence"],
01029                  "Sequence",
01030                  filename=True,
01031                  is_required=True),
01032          _Option(["-gap","gap"],
01033                  "Gap penalty",
01034                  filename=True,
01035                  is_required=True),
01036          _Option(["-threshold","threshold"],
01037                  "Minimum score threshold",
01038                  is_required=True),
01039          _Option(["-match","match"],
01040                  "Match score",
01041                  is_required=True),
01042          _Option(["-mismatch","mismatch"],
01043                  "Mismatch score",
01044                  is_required=True),
01045          _Option(["-maxrepeat","maxrepeat"],
01046                  "Maximum separation between the start and end of repeat"),
01047          ]
01048         _EmbossCommandLine.__init__(self, cmd, **kwargs)
01049 
01050 
01051 class PalindromeCommandline(_EmbossCommandLine):
01052     """Commandline object for the palindrome program from EMBOSS.
01053     """
01054     def __init__(self, cmd="palindrome", **kwargs):
01055         self.parameters = [
01056          _Option(["-sequence","sequence"],
01057                  "Sequence",
01058                  filename=True,
01059                  is_required=True),
01060          _Option(["-minpallen","minpallen"],
01061                  "Minimum palindrome length",
01062                  is_required=True),
01063          _Option(["-maxpallen","maxpallen"],
01064                  "Maximum palindrome length",
01065                  is_required=True),
01066          _Option(["-gaplimit","gaplimit"],
01067                  "Maximum gap between repeats",
01068                  is_required=True),
01069          _Option(["-nummismatches","nummismatches"],
01070                  "Number of mismatches allowed",
01071                  is_required=True),
01072          _Option(["-overlap","overlap"],
01073                  "Report overlapping matches",
01074                  is_required=True),
01075          ]
01076         _EmbossCommandLine.__init__(self, cmd, **kwargs)
01077 
01078 
01079 class TranalignCommandline(_EmbossCommandLine):
01080     """Commandline object for the tranalign program from EMBOSS.
01081     """
01082     def __init__(self, cmd="tranalign", **kwargs):
01083         self.parameters = [
01084          _Option(["-asequence","asequence"],
01085                  "Nucleotide sequences to be aligned.",
01086                  filename=True,
01087                  is_required=True),
01088          _Option(["-bsequence","bsequence"],
01089                  "Protein sequence alignment",
01090                  filename=True,
01091                  is_required=True),
01092          _Option(["-outseq","outseq"],
01093                  "Output sequence file.",
01094                  filename=True,
01095                  is_required=True),
01096          _Option(["-table","table"],
01097                  "Code to use")]
01098         _EmbossCommandLine.__init__(self, cmd, **kwargs)
01099 
01100 
01101 class DiffseqCommandline(_EmbossCommandLine):
01102     """Commandline object for the diffseq program from EMBOSS.
01103     """
01104     def __init__(self, cmd="diffseq", **kwargs):
01105         self.parameters = [
01106          _Option(["-asequence","asequence"],
01107                  "First sequence to compare",
01108                  filename=True,
01109                  is_required=True),
01110          _Option(["-bsequence","bsequence"],
01111                  "Second sequence to compare",
01112                  filename=True,
01113                  is_required=True),
01114          _Option(["-wordsize","wordsize"],
01115                  "Word size to use for comparisons (10 default)",
01116                  is_required=True),
01117          _Option(["-aoutfeat","aoutfeat"],
01118                  "File for output of first sequence's features",
01119                  filename=True,
01120                  is_required=True),
01121          _Option(["-boutfeat","boutfeat"],
01122                  "File for output of second sequence's features",
01123                  filename=True,
01124                  is_required=True),
01125          _Option(["-rformat","rformat"],
01126                  "Output report file format")
01127          ]
01128         _EmbossCommandLine.__init__(self, cmd, **kwargs)
01129 
01130 
01131 class IepCommandline(_EmbossCommandLine):
01132     """Commandline for EMBOSS iep: calculated isoelectric point and charge.
01133     
01134     Example:
01135 
01136     >>> from Bio.Emboss.Applications import IepCommandline
01137     >>> iep_cline = IepCommandline(sequence="proteins.faa",
01138     ...                            outfile="proteins.txt")
01139     >>> print iep_cline
01140     iep -outfile=proteins.txt -sequence=proteins.faa
01141 
01142     You would typically run the command line with iep_cline() or via the
01143     Python subprocess module, as described in the Biopython tutorial.
01144     """
01145     def __init__(self, cmd="iep", **kwargs):
01146         self.parameters = [
01147          _Option(["-sequence","sequence"],
01148                 "Protein sequence(s) filename",
01149                  filename=True,
01150                  is_required=True),
01151          _Option(["-amino","amino"],
01152                  """Number of N-termini
01153                  
01154                  Integer 0 (default) or more.
01155                  """),
01156          _Option(["-carboxyl","carboxyl"],
01157                  """Number of C-termini
01158                  
01159                  Integer 0 (default) or more.
01160                  """),
01161          _Option(["-lysinemodified","lysinemodified"],
01162                  """Number of modified lysines
01163 
01164                  Integer 0 (default) or more.
01165                  """),
01166          _Option(["-disulphides","disulphides"],
01167                  """Number of disulphide bridges
01168                  
01169                  Integer 0 (default) or more.
01170                  """),
01171          #Should we implement the -termini switch as well?
01172          _Option(["-notermini","notermini"],
01173                  "Exclude (True) or include (False) charge at N and C terminus."),
01174          ]
01175         _EmbossCommandLine.__init__(self, cmd, **kwargs)
01176 
01177 
01178 #seqret uses -outseq, not -outfile, so use the base class:
01179 class SeqretCommandline(_EmbossMinimalCommandLine):
01180     """Commandline object for the seqret program from EMBOSS.
01181 
01182     This tool allows you to interconvert between different sequence file
01183     formats (e.g. GenBank to FASTA). Combining Biopython's Bio.SeqIO module
01184     with seqret using a suitable intermediate file format can allow you to
01185     read/write to an even wider range of file formats.
01186 
01187     This wrapper currently only supports the core functionality, things like
01188     feature tables (in EMBOSS 6.1.0 onwards) are not yet included.
01189     """
01190     def __init__(self, cmd="seqret", **kwargs):
01191         self.parameters = [
01192          _Option(["-sequence","sequence"],
01193                  "Input sequence(s) filename",
01194                  filename=True),
01195          _Option(["-outseq","outseq"],
01196                  "Output sequence file.",
01197                  filename=True),
01198          _Option(["-sformat","sformat"],
01199                  "Input sequence(s) format (e.g. fasta, genbank)"),
01200          _Option(["-osformat","osformat"],
01201                  "Output sequence(s) format (e.g. fasta, genbank)"),
01202          ]
01203         _EmbossMinimalCommandLine.__init__(self, cmd, **kwargs)
01204 
01205     def _validate(self):
01206         #Check the outfile, filter, or stdout option has been set.
01207         #We can't simply do this via the required flag for the outfile
01208         #output - this seems the simplest solution.
01209         if not (self.outseq or self.filter or self.stdout):
01210             raise ValueError("You must either set outfile (output filename), "
01211                              "or enable filter or stdout (output to stdout).")
01212         if not (self.sequence or self.filter or self.stdint):
01213             raise ValueError("You must either set sequence (input filename), "
01214                              "or enable filter or stdin (input from stdin).")
01215         return _EmbossMinimalCommandLine._validate(self)
01216 
01217 class SeqmatchallCommandline(_EmbossCommandLine):
01218     """ Commandline object for the seqmatchall program from EMBOSS
01219 
01220     e.g.
01221     >>> cline = SeqmatchallCommandline(sequence="opuntia.fasta", outfile="opuntia.txt")
01222     >>> cline.auto = True
01223     >>> cline.wordsize = 18
01224     >>> cline.aformat = "pair"
01225     >>> print cline
01226     seqmatchall -auto -outfile=opuntia.txt -sequence=opuntia.fasta -wordsize=18 -aformat=pair
01227 
01228     """
01229     def __init__(self, cmd="seqmatchall", **kwargs):
01230         self.parameters = [
01231           _Option(["-sequence", "sequence"],
01232                   "Readable set of sequences",
01233                   filename=True,
01234                   is_required=True),
01235           _Option(["-wordsize", "wordsize"],
01236                   "Word size (Integer 2 or more, default 4)"),
01237           _Option(["-aformat","aformat"],
01238                   "Display output in a different specified output format"),
01239         ]
01240         _EmbossCommandLine.__init__(self, cmd, **kwargs)
01241 
01242 def _test():
01243     """Run the Bio.Emboss.Applications module doctests."""
01244     import doctest
01245     doctest.testmod()
01246 
01247 if __name__ == "__main__":
01248     #Run the doctests
01249     _test()