Package schrodinger :: Module surface :: Class ProjectSurface
[hide private]
[frames] | no frames]

Class ProjectSurface

object --+    
         |    
   Surface --+
             |
            ProjectSurface

A Pythonic wrapping for mmsurf surfaces retrieved from a project. ProjectSurface objects are typically accessed via the schrodinger.project.ProjectRow.surface SurfaceDict object or created via schrodinger.project.ProjectRow.newMolecularSurface.

Nested Classes [hide private]

Inherited from Surface: Color, ColorBy, ColorFrom, Style

Instance Methods [hide private]
 
__init__(self, proj_handle, eid, name, proj_row)
x.__init__(...) initializes x; see help(type(x)) for signature
 
__del__(self)
When this object is garbage collected, terminate the mmlib libraries and delete the mmsurf handle if it's managed by this object.
 
_handle(self)
The mmsurf handle for this surface.
 
_checkHandle(self)
Make sure that our mmsurf handle is still valid.
 
delete(self)
Delete this surface.
 
name(self, value)
 
rename(self, new_name, overwrite=True)
Rename this surface
 
_updateMaestro(self)
Tell Maestro to update the workspace surface representation.

Inherited from Surface: back_transparency, color, color_scheme, color_source, coloring, copy, darken_colors_by_cavity_depth, front_transparency, has_vertex_colors, hide, nearest_atom_indices, patch_count, patch_vertices, setColoring, setTransparency, show, smoothColors, style, surface_area, surface_type, vertex_colors, vertex_coords, vertex_count, vertex_normals, visible, write

Inherited from Surface (private): _initializeMmlibs, _terminateMmlibs

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
ProjectSurface
newMolecularSurface(cls, proj, row, name, asl=None, atoms=None, resolution=0.5, probe_radius=None, vdw_scaling=1.0, mol_surf_type=MolSurfType.molecular, overwrite=True)
Create a new molecular surface for the specified project row
 
_addHandleToProject(cls, handle, proj, row, name)
Add the specified mmsurf handle to a project.
 
addSurfaceToProject(cls, surf, proj, row, overwrite=True, copy=False)
Add an existing Surface object to a project.
Surface
read(cls, filename)
Read surface data from a file.

Inherited from Surface (private): _createMolecularSurface

Static Methods [hide private]
 
_checkName(proj, row, name)
Make sure that no surface of the specified name exists.

Inherited from Surface (private): _generateBitset

Class Variables [hide private]

Inherited from Surface: SURFACE_TYPE_NAME

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, proj_handle, eid, name, proj_row)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • proj_handle (int) - The project handle
  • eid (str) - The entry ID of the entry containing the surface
  • name (str) - The name of the surface
Overrides: object.__init__

Note: This method does not confirm that the specified surface exists, as this check is done in SurfaceDict.__getitem__. Attempting to get or set values on a non-existent surface will lead to a RuntimeError.

__del__(self)
(Destructor)

 

When this object is garbage collected, terminate the mmlib libraries and delete the mmsurf handle if it's managed by this object.

Overrides: Surface.__del__
(inherited documentation)

_handle(self)

 

The mmsurf handle for this surface. Note that mmproj may change the mmsurf handle whenever the entry leaves the workspace, so we fetch the mmsurf handle using the surface name. This ensures that we're not using a stale handle.

Decorators:
  • @property
Raises:
  • RuntimeError - If the underlying surface has been deleted or cannot be found.

_checkHandle(self)

 

Make sure that our mmsurf handle is still valid. Raise a RuntimeError if it isn't.

delete(self)

 

Delete this surface. After the surface is deleted, any further attempt to interact with this object will result in a RuntimeError.

Decorators:
  • @_requires_update
Overrides: Surface.delete

name(self, value)

 
Decorators:
  • @name.setter
Overrides: Surface.name

rename(self, new_name, overwrite=True)

 

Rename this surface

Parameters:
  • new_name (str) - The new surface name
  • overwrite (bool) - What to do if the new name is the same as an existing surface for this project row. If True, the existing surface will be overwritten. In False, a ValueError will be raised.
Overrides: Surface.rename

_updateMaestro(self)

 

Tell Maestro to update the workspace surface representation.

Overrides: Surface._updateMaestro

newMolecularSurface(cls, proj, row, name, asl=None, atoms=None, resolution=0.5, probe_radius=None, vdw_scaling=1.0, mol_surf_type=MolSurfType.molecular, overwrite=True)
Class Method

 

Create a new molecular surface for the specified project row

Parameters:
  • proj (schrodinger.project.Project) - The project that this surface will be part of
  • row (schrodinger.project.ProjectRow) - The project row that this surface will belong to. This is the structure that the surface will be created around.
  • name (str) - The name of the surface. Note that project rows require all surfaces to be named uniquely. See overwrite.
  • asl (str or NoneType) - If given, the surface will only be created for atoms in the structure that match the provided ASL. Note that only one of asl and atoms may be given. If neither are given, then the surface will be created for all atoms in the structure.
  • atoms (list or NoneType) - An optional list of atom numbers. If given, the surface will only be created for the specified atoms. Note that only one of asl and atoms may be given. If neither are given, then the surface will be created for all atoms in the structure.
  • resolution (float) - The resolution of the surface, generally between 0 and 1. Smaller numbers lead to a more highly detailed surface.
  • probe_radius (float) - The radius of the rolling sphere used to calculate the surface. Defaults to 1.4 if mol_surf_type is MolSurfType.Molecular or MolSurfType.Extended. May not be given if mol_surf_type is MolSurfType.vdw.
  • vdw_scaling (float) - If given, all atomic radii will be scaled by the provided value before the surface is calculated.
  • mol_surf_type (MolSurfType) - The type of surface to create.
  • overwrite (bool) - What to do if the new surface has the same name as an existing surface for this project row. If True, the existing surface will be overwritten. In False, a ValueError will be raised.
Returns: ProjectSurface
The new surface
Overrides: Surface.newMolecularSurface

_addHandleToProject(cls, handle, proj, row, name)
Class Method

 

Add the specified mmsurf handle to a project.

Parameters:

addSurfaceToProject(cls, surf, proj, row, overwrite=True, copy=False)
Class Method

 

Add an existing Surface object to a project. Note that, by default, this method will invalidate the input Surface object, as the mmsurf handle will be managed by the project.

Parameters:
  • surf (Surface) - The surface to add.
  • proj (schrodinger.project.Project) - The project to add the surface to.
  • row (schrodinger.project.ProjectRow) - The project row to add the surface to.
  • overwrite (bool) - What to do if the new surface has the same name as an existing surface for this project row. If True, the existing surface will be overwritten. In False, a ValueError will be raised.
  • copy (bool) - If True, a copy of the surface will be added to the project and the input surface will not be invalidated.

_checkName(proj, row, name)
Static Method

 

Make sure that no surface of the specified name exists. Raise a ValueError if one does.

Parameters:

read(cls, filename)
Class Method

 

Read surface data from a file.

Parameters:
  • filename - The file to read from.
Returns: Surface
The read surface.
Overrides: Surface.read
(inherited documentation)