Package Bio :: Package Application
[hide private]
[frames] | no frames]

Package Application

source code

General mechanisms to access applications in Biopython.

Classes [hide private]
  ApplicationResult
Make results of a program available through a standard interface (OBSOLETE).
  AbstractCommandline
Generic interface for constructing command line strings.
  _AbstractParameter
A class to hold information about a parameter for a commandline.
  _Option
Represent an option that can be set for a program.
  _Switch
Represent an optional argument switch for a program.
  _Argument
Represent an argument on a commandline.
Functions [hide private]
 
generic_run(commandline)
Run an application with the given commandline (OBSOLETE).
source code
 
_escape_filename(filename)
Escape filenames with spaces by adding quotes (PRIVATE).
source code
 
_test()
Run the Bio.Application module's doctests.
source code
Variables [hide private]
  __package__ = 'Bio.Application'
Function Details [hide private]

generic_run(commandline)

source code 

Run an application with the given commandline (OBSOLETE).

This expects a pre-built commandline that derives from AbstractCommandline, and returns a ApplicationResult object to get results from a program, along with handles of the standard output and standard error.

WARNING - This will read in the full program output into memory! This may be in issue when the program writes a large amount of data to standard output.

NOTE - This function is considered to be obsolete, and we intend to deprecate it and then remove it in future releases of Biopython. We now recommend you invoke subprocess directly, using str(commandline) to turn an AbstractCommandline wrapper into a command line string. This will give you full control of the tool's input and output as well.

_escape_filename(filename)

source code 

Escape filenames with spaces by adding quotes (PRIVATE).

Note this will not add quotes if they are already included:

>>> print _escape_filename('example with spaces')
"example with spaces"
>>> print _escape_filename('"example with spaces"')
"example with spaces"

_test()

source code 

Run the Bio.Application module's doctests.

This will try and locate the unit tests directory, and run the doctests from there in order that the relative paths used in the examples work.