schrodinger.project_surface module¶
Pythonic wrappings for mmsurf surfaces retrieved from a project
-
class
schrodinger.project_surface.
ProjectSurface
(proj_handle, eid, name, proj_row)¶ Bases:
schrodinger.surface.Surface
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 viaschrodinger.project.ProjectRow.newMolecularSurface
.-
classmethod
addSurfaceToProject
(surf, proj, row, overwrite=True, copy=False)¶ Add an existing
Surface
object to a project. Note that, by default, this method will invalidate the inputSurface
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.
- surf (
-
delete
()¶ Delete this surface. After the surface is deleted, any further attempt to interact with this object will result in a RuntimeError.
-
name
¶ The name of the surface. Note that all surfaces for a given project entry have unique names. :type: str
-
classmethod
newMolecularSurface
(proj, row, name, asl=None, atoms=None, resolution=0.5, probe_radius=None, vdw_scaling=1.0, mol_surf_type=<MolSurfType.molecular: 2>, overwrite=True)¶ 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
andatoms
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
andatoms
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
isMolSurfType.Molecular
orMolSurfType.Extended
. May not be given ifmol_surf_type
isMolSurfType.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: The new surface
Return type: - proj (
-
classmethod
read
(filename)¶
-
classmethod
-
class
schrodinger.project_surface.
SurfaceDict
(proj, row)¶ Bases:
_abcoll.MutableMapping
A dictionary of {surface name:
ProjectSurface
object} for the specified project row. Note that surfaces may not be created by assignment to a dictionary value. Useadd
, {addFromFile}, orschrodinger.project.ProjectRow.newMolecularSurface
instead.SurfaceDict
objects are typically accessed viaschrodinger.project.ProjectRow.surface
.-
add
(surf, overwrite=True, copy=False)¶ Add an existing
Surface
object to the project row. Note that if copy is False (the default), this method will invalidate the inputSurface
object, as the mmsurf handle will be managed by the project.Parameters: - surf (
Surface
) – The surface to add. - 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.
Returns: A
ProjectSurface
object for the added surface.Return type: - surf (
-
addFromFile
(filename, name=None, overwrite=True)¶ Read a surface from a file and add it to the project row.
Parameters: - filename (str) – The file to read
- name (str) – If given, the surface will be renamed to this before being loaded into the project.
- 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: A
ProjectSurface
object for the added surface.Return type:
-