schrodinger.application.glide.poseviewconvert module

Functions for creating or converting pose viewer files.

The module can convert a ‘pose viewer’ type file into a series of complexes, and convert complexes into ligand-only, receptor-only, or pose viewer files.

The script pv_convert.py is the preferred command-line interface to this module.

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.application.glide.poseviewconvert.is_pv_file(file_name, max_ligand_atoms=300, test_all=True, test_recep_atom_count=True, test_ligand_atom_count=True, test_recep_gscore=True, test_ligand_gscore=True)

Returns a True if the file appears to be a pose view format file. The tests are simple, and may not be conclusive. It is assumed that the trivial test for a ‘pv.mae’ extension has already been performed.

Specific tests can be skipped by setting the test_recep_atom_count, test_recep_gscore, test_ligand_atom_count, and test_ligand_gscore booleans.

Parameters:
  • max_ligand_atoms (int) – The maximum size in atoms of a putative ligand, and minimum size of the receptor. The default is the package constant schrodinger.application.glide.MAX_LIGAND_ATOMS.
  • test_all (bool) – Perform all tests, regardless of other test_* booleans. Default = True.
  • test_recep_atom_count (bool) – Receptor must have more than max_ligand_atoms. Default = True.
  • test_ligand_atom_count (bool) – Ligand must have less than or equal to max_ligand_atoms. Default = True.
  • test_recep_gscore (bool) – Receptor must not have ‘r_i_glide_gscore’ property. Default = True.
  • test_ligand_gscore (bool) – Ligand must have ‘r_i_glide_gscore’ property. Default = True.
class schrodinger.application.glide.poseviewconvert.Complex(st, ligand_asl=None, ligand_title_source=None, ligand_properties=None)

Bases: object

A helper class to split a receptor-ligand complex structure into ligand, and receptor structure components, and write the structure components to new files.

API Examples:

# Write a pv file
comp = Complex(st)
comp.writePv('output_pv.mae')

# Write a ligand file, transfer all the complex's properties
comp = Complex(
    st
    ligand_properties = st.property.keys()
)
comp.writeLigand('ligand-only.mae')

The receptor will have the same properties as the input complex. By default, the ligand takes the title of the complex but has no other properties. The ligand title can be selected from one of the complex’s properties with ligand_title_source, and a list of properties to transfer to the ligand can be specified with ligand_properties.

Variables:
  • complex (structure.Structure) – The original receptor-ligand complex.
  • receptor (structure.Structure) – The receptor-only (non-ligand).
  • ligand (structure.Structure) – The ligand-only structure.Structure.
  • ligand_indexes (list) – List of atom numbers for the ligand in the complex, the match to the ASL evaluation.
  • ligand_title_source (string) – A single m2io dataname of an entry level property in the complex structure to use as the title for the ligand. Default is ‘s_m_title’.
  • ligand_properties (list) – A list of m2io datanames of entry level properties to copy from the complex to the ligand structure.
Raises:

RuntimeError – If the structure can’t be split.

__init__(st, ligand_asl=None, ligand_title_source=None, ligand_properties=None)
Parameters:
  • st (structure.Structure) – Structure instance of the receptor-ligand complex.
  • ligand_asl (str) – Optional Atom Selection Language expression for the ligand molecule, Default is None, which will select the last molecule in the complex (mol.n #).
  • ligand_title_source (str) – An m2io entry data name of the complex property to use as the ligand’s title. Default is ‘s_m_title’.
  • ligand_properties (list of str) – List of m2io entry level data names in the complex to be transfered to the ligand entry.
writePv(file_name)

Writes receptor and ligand to disk, in pv file format.

__class__

alias of builtins.type

__delattr__

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'schrodinger.application.glide.poseviewconvert', '__doc__': "\n A helper class to split a receptor-ligand complex structure into\n ligand, and receptor structure components, and write the structure\n components to new files.\n\n API Examples::\n\n # Write a pv file\n comp = Complex(st)\n comp.writePv('output_pv.mae')\n\n # Write a ligand file, transfer all the complex's properties\n comp = Complex(\n st\n ligand_properties = st.property.keys()\n )\n comp.writeLigand('ligand-only.mae')\n\n The receptor will have the same properties as the input complex.\n By default, the ligand takes the title of the complex but has no\n other properties. The ligand title can be selected from one of\n the complex's properties with ligand_title_source, and a list\n of properties to transfer to the ligand can be specified with\n ligand_properties.\n\n :vartype complex: structure.Structure\n :ivar complex:\n The original receptor-ligand complex.\n\n :vartype receptor: structure.Structure\n :ivar receptor:\n The receptor-only (non-ligand).\n\n :vartype ligand: structure.Structure\n :ivar ligand:\n The ligand-only structure.Structure.\n\n :vartype ligand_indexes: list\n :ivar ligand_indexes:\n List of atom numbers for the ligand in the complex, the\n match to the ASL evaluation.\n\n :vartype ligand_title_source: string\n :ivar ligand_title_source:\n A single m2io dataname of an entry level property in the\n complex structure to use as the title for the ligand.\n Default is 's_m_title'.\n\n :vartype ligand_properties: list\n :ivar ligand_properties:\n A list of m2io datanames of entry level properties to copy\n from the complex to the ligand structure.\n\n :raise RuntimeError: If the structure can't be split.\n\n ", '__init__': <function Complex.__init__>, '_split': <function Complex._split>, 'writePv': <function Complex.writePv>, 'writeLigand': <function Complex.writeLigand>, 'appendLigand': <function Complex.appendLigand>, 'writeReceptor': <function Complex.writeReceptor>, 'appendReceptor': <function Complex.appendReceptor>, '__dict__': <attribute '__dict__' of 'Complex' objects>, '__weakref__': <attribute '__weakref__' of 'Complex' objects>})
__dir__() → list

default dir() implementation

__eq__

Return self==value.

__format__()

default object formatter

__ge__

Return self>=value.

__getattribute__

Return getattr(self, name).

__gt__

Return self>value.

__hash__

Return hash(self).

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__

Return self<=value.

__lt__

Return self<value.

__module__ = 'schrodinger.application.glide.poseviewconvert'
__ne__

Return self!=value.

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__

Return repr(self).

__setattr__

Implement setattr(self, name, value).

__sizeof__() → int

size of object in memory, in bytes

__str__

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

writeLigand(file_name)

Writes the ligand structure to the passed filename, clobbering as needed.

appendLigand(file_name)

Appends the ligand structure to the passed filename.

writeReceptor(file_name)

Writes the receptor structure to the passed filename, clobbering as needed.

appendReceptor(file_name)

Appends the receptor structure to the passed filename.