Biskit :: SurfaceRacer :: SurfaceRacer :: Class SurfaceRacer
[hide private]
[frames] | no frames]

Class SurfaceRacer

source code


Run SurfaceRacer

Runs surface_racer_3 with given PDBModel, and returns a dictionary with accessible, molecular surface areas (MS and AS) and average curvature. Hydrogens should not be present in the pdb-file during the calculation. If a probe radius of 1.4 A and the Richards vdw radii set is used the relative exposure is also calculated.

Options

probe - float, probe radii vdw_set - int, Van del Waals radii set
  • Richards (1977)
  • Chothia (1976)
  • mode - int, calculation mode
  • Accessible surface area only
  • Accessible and molecular surface areas
  • Accessible, molecular surface areas and average curvature
  • Example usage

    >>> x = SurfaceRacer( model, 1.4, verbose=1 )
    >>> result = x.run()
    

    References



    Instance Methods [hide private]
      __init__(self, model, probe, vdw_set=1, mode=3, **kw)
    SurfaceRacer creates three output files:
      prepare(self)
    Overrides Executor method.
      __prepareFolder(self)
    The surfrace binary, radii files and the PDB have to be in the current working directory.
      __prepareModel(self, model, f_pdb_out)
    Prepare a model that SurfaceRacer likes.
      cleanup(self)
    Tidy up the mess you created.
    dict parse_result(self, output)
    Parse the SurfaceRacer output file which has the same nawe as the input pdb, but with a txt extension.
    [float] __checkProfileIntegrity(self, profile, upperLimit=1.0, lowerLimit=-1.0)
    In some cases SurfaceRacer generates incorrect curvature values for some atoms.
    [float] __relExposure(self, key='AS', clip=1)
    Calculate how exposed an atom is relative to the same atom in a GLY-XXX-GLY tripeptide, an approximation of the unfolded state.
      isFailed(self)
    Overrides Executor method
      finish(self)
    Overrides Executor method
      failed(self)
    Called if external program failed, Overrides Executor method.

    Class Variables [hide private]
      inp = """ %(vdw_set)i %(f_pdb_name)s %(probe).2f %(mode)i """

    Method Details [hide private]

    __init__(self, model, probe, vdw_set=1, mode=3, **kw)
    (Constructor)

    source code 

    SurfaceRacer creates three output files:
     result.txt - contains breakdown of surface areas and is writen
                    to the directory where the program resides. This
                    file is discharded here.
     file *.txt - contains the accessible, molecular surface areas
                    and average curvature information paresd here.
                    The filename is that of the input pdb file but
                    with a .txt extension.
     stdout     - some general information about the calculation.
                    Redirected to /dev/null
    
    Parameters:
    • model (PDBModel) - model analyze
    • probe (float) - probe radii, Angstrom
    • vdw_set (1|2) - Van del Waals radii set (default: 1):
                       1 - Richards (1977)
                       2 - Chothia  (1976)
      
    • mode (1|2|3) - calculation mode (default: 3):
                   1- Accessible surface area only
                   2- Accessible and molecular surface areas
                   3- Accessible, molecular surface areas and
                      average curvature
      
    • kw (key=value pairs :
       debug    - 0|1, keep all temporary files (default: 0)
       verbose  - 0|1, print progress messages to log (log != STDOUT)
       node     - str, host for calculation (None->local) NOT TESTED
                       (default: None)
       nice     - int, nice level (default: 0)
       log      - Biskit.LogFile, program log (None->STOUT) (default: None)
      
      ) - additional key=value parameters for Executor:

    prepare(self)

    source code 

    
    Overrides Executor method.
    - link surfaceracer binary to temporary folder
    - put cleaned up pdb into same folder
    - adapt working directory and output names to same folder
    (changes self.cwd, f_pdb, f_pdb_names, f_out_name)
    
    

    __prepareFolder(self)

    source code 

    The surfrace binary, radii files and the PDB have to be in the current working directory. Otherwise we get a pretty silent segmentation fault.

    @return temp folder @rtype str

    __prepareModel(self, model, f_pdb_out)

    source code 

    Prepare a model that SurfaceRacer likes.
    • Surface curvature should only be calculated on heavy atoms.
    • Delete Hydrogens, sequential numbering ...
    Parameters:
    • model (PDBModel) - model
    • f_pdb_out (str) - name of pdb file to write
    Raises:

    cleanup(self)

    source code 

    Tidy up the mess you created.

    parse_result(self, output)

    source code 

    Parse the SurfaceRacer output file which has the same nawe as the input pdb, but with a txt extension. The output ends up un the same folder as the input. In addition a file called result.txt is created in the same directory as the binary.
    Parameters:
    • output (str) - full path to input pdb-file
    Returns: dict
    dictionary with curvature and surface data

    __checkProfileIntegrity(self, profile, upperLimit=1.0, lowerLimit=-1.0)

    source code 

    In some cases SurfaceRacer generates incorrect curvature values for some atoms. This function sets values outside a given range to 0
    Parameters:
    • profile (str) - profile name
    • upperLimit (float) - upper limit for a valid value (default: 1.0)
    • lowerLimit (float) - lower limit for a valid value (default: -1.0)
    Returns: [float]
    profile with inspected values

    __relExposure(self, key='AS', clip=1)

    source code 

    Calculate how exposed an atom is relative to the same atom in a GLY-XXX-GLY tripeptide, an approximation of the unfolded state. See Biskit.surfaceRacerTools.relExposure()
    Parameters:
    • key (MS|AS) - caclulate relative Molecular Surface or Acessible Surface (default: AS)
    • clip (1|0) - clip MS ans AS values above 100% to 100% (default: 1)
    Returns: [float]
    relAS - list of relative solvent accessible surfaces OR relMS - list of relative molecular surface exposure

    isFailed(self)

    source code 

    Overrides Executor method

    finish(self)

    source code 

    Overrides Executor method

    failed(self)

    source code 

    Called if external program failed, Overrides Executor method.

    In some very rare cases SurfaceRacer round off error cause the program to terminate. The simplest remedy to this problem is to increase the probe radii with a very small number and rerun the calculation.

    Class Variable Details [hide private]

    inp

    Value:
    """
    %(vdw_set)i
    
    %(f_pdb_name)s
    %(probe).2f
    %(mode)i
    
    
    ...