Package schrodinger :: Package structutils :: Module analyze :: Class AslLigandSearcher
[hide private]
[frames] | no frames]

Class AslLigandSearcher

Search a Structure instance for putative ligands with an Atom Selection Language expression. Results are returned as a list of Ligand instances.

API example:

   st = structure.StructureReader('file.mae').next()
   st_writer = structure.StructureWriter('out.mae')
   asl_searcher = AslLigandSearcher()
   ligands = asl_searcher.search(st)
   for lig in ligands:
       st_writer.append(lig.st)
   st_writer.close()

ASL evaluates molecules in a strict sense. Ligands with zero-order bonds to metal and covalently-attached ligands are difficult to find with this naive approach. See __init__ for options that workaround these limitations.

'sidechain', 'backbone', and 'ion' aliases are used by this module. They are taken from first mmasl.ini in the path, but are assumed to be defined as a list of PDB atom names that correspond to atoms of the protein side chains, protein backbone, and small ions respectively.

Since the precise definition of a ligand is context specific and impossible to generally formulate, this class attempts to provide customizable tools for identifying ligands within a structure. It is the caller's responsibility to customize the search parameters and verify that the hits are appropriate.


See Also: find_ligands for a simple functional interface to this class.

Instance Methods [hide private]
 
__init__(self, remove_zobs=True, check_covalent=True)
 
_getLigandParameters(self)
 
search(self, st, ligand_asl=None)
Find list of putative ligands matching either C{ligand_asl} or the default internally gerenated ASL.
 
_get_molecule_atoms(self, st, ligand_mol_atoms)
 
_extract_ligands(self, st, ligand_mol_atoms)
list
_old_search(self, st, ligand_asl)
Find list of putative ligands matching either ligand_asl or the default internally generated ASL.
str
getAsl(self)
Get a default ASL for matching putative ligands.
 
_removeZeroOrderBonds(self)
Removes all the zero-order bonds from the self.working_st.
Class Variables [hide private]
  orig_index_prop = 'i_asl_atom_index'
  orig_moln_prop = 'i_asl_mol_index'
Instance Variables [hide private]
bool check_covalent_fillres
If True then remove entire residues that match the sidechain and backbone aliases.
bool copy_props
If True then copy the ct-level properties from the searched structure to all the found ligand substructures.
bool exclude_amino_acids
If True then 'sidechain and backbone' are excluded from the ASL evaluation, and therefore not considered putative ligands.
bool exclude_ions
If True then 'ions' are excluded from the ASL evaluation, and therefore not considered putative ligands.
list excluded_residues
List of three-letter PDB codes that are excluded from matching.
int max_atom_count
Maximum number of atoms for a putative ligand.
int min_atom_count
Minimum number of atoms for a putative ligand.
Method Details [hide private]

__init__(self, remove_zobs=True, check_covalent=True)
(Constructor)

 
Parameters:
  • remove_zobs (bool) - If True then cut all zero-order bonds before evaluating the ASL.
  • check_covalent (bool) - If True, try to find covalently attached putative ligands.

search(self, st, ligand_asl=None)

 

Find list of putative ligands matching either C{ligand_asl} or the
default internally gerenated ASL.

@deprecated ligand_asl Using the default ASL ligand keyword
                       is more likely accurate behavior

@type st: L{Structure}
@param st:
    Structure to search for ligands.

@deprecated ligand_asl Using the default ASL and the ligand keyword
                       is more likely accurate behavior

@rtype: list
@return:
    a list of L{Ligand} instances.  These are putative ligands
    that match the ASL expression.  See L{Ligand} for attributes.

_old_search(self, st, ligand_asl)

 

Find list of putative ligands matching either ligand_asl or the default internally generated ASL.

A working copy of the structure is prepared and evaluated with an ASL expression. An ASL evaluation is performed after removing zero order bonds from the working structure, and again after removing protein atoms from the working structure. The atoms that match are mapped to their corresponding molecule number in the working structure.

Parameters:
  • st (Structure) - Structure to search for ligands.
  • ligand_asl (str) - ASL expression use to identify putative ligands. The default is to generate an expression from the internal settings.
Returns: list
a list of Ligand instances. These are putative ligands that match the ASL expression. See Ligand for attributes.

getAsl(self)

 

Get a default ASL for matching putative ligands. The default ASL is based on molecule size, and excludes amino acids and certain known small molecules. See exclusion list in __init__.

Returns: str
an ASL expression to match putative ligands.

Instance Variable Details [hide private]

check_covalent_fillres

If True then remove entire residues that match the sidechain and backbone aliases. False restores the suite2011 behavior. This addresses issues like 1am6 where a fragment of an ion is returned as a ligand after removing charge carrying atoms that match the backbone alias.
Type:
bool

copy_props

If True then copy the ct-level properties from the searched structure to all the found ligand substructures. If False, only the title will be copied. (default: True)
Type:
bool

exclude_amino_acids

If True then 'sidechain and backbone' are excluded from the ASL evaluation, and therefore not considered putative ligands. (default: False)
Type:
bool

exclude_ions

If True then 'ions' are excluded from the ASL evaluation, and therefore not considered putative ligands. (default: True)
Type:
bool

excluded_residues

List of three-letter PDB codes that are excluded from matching. These are ubiquitous small molecules that are rarely treated as ligands. See __init__ body for the full list.
Type:
list

max_atom_count

Maximum number of atoms for a putative ligand. (default: 130)
Type:
int

min_atom_count

Minimum number of atoms for a putative ligand. (default: 5)
Type:
int