Package schrodinger :: Package structutils :: Module assignbondorders
[hide private]
[frames] | no frames]

Module assignbondorders


A module to assign bond orders based on molecular geometry.

Assigns double and triple bonds to structures based on molecular geometry
(bond length, bond angles, and dihedral angles). Useful when importing
ligands from PDBs into Maestro.   Please check the output structure for
errors and compare it to the molecular formula. If this script assigns
bond orders incorrectly to a reasonable structure, please email the
maestro file of the structure to help@schrodinger.com.

Functions:

There is a single public function:

    def assign_st(input_st, atoms=[], neutralize=False) 
        Assigns bond orders to atom list [atoms] of structure input_st and
        returns a new structure object. Bond orders are assigned for
        all atoms all atoms, if the atoms list is empty.
        
Copyright (c) Schrodinger, LLC. All rights reserved.

Classes [hide private]
  AssignBondOrders
Functions [hide private]
 
debug(txt)
For general debug messages
 
debuggroup(msg)
For debugging group bond assignments
 
debugbonders(msg)
For debugging aromatic ring assignments
 
debugbond(msg)
For debugging code that calculates bond "scores"
 
_add_bond_entry(d, pdbname1, pdbname2, order)
 
isMetal(atom)
Returns True if the supplied atomic_number is for a metal
 
get_atom_radius(atom)
Returns the radius of the atom, given the atomic number.
 
get_single_bond_length(a1, a2)
Returns ideal length of a single-order bond between specified atoms.
 
get_neighbors(st, atom)
Returns a list of atoms that <atom> is bound to.
 
calculate_average_angle(st, atom_num)
Calculates the average of all bond angles around the input atom.
 
calculate_dihedral(st, a1, a2)
Calculates the average dihedral angle of the bond between the specified atoms.
 
order_ring_or_chain(st, atoms)
This function orders the atoms in the ring or chain by bonding order.
 
do_rings_share_atoms(r1, r2)
 
get_rings_in_group(ring, rings_to_check)
 
_assign_templated_residue(res, atoms, het_templates, charges_dict)
 
_residue_atom_subset(res, atoms)
 
assign_st(st, atoms=None, neutralize=False, problem_only=False, skip_assigned_residues=True)
Performes the fix-bond-order algorithm on the supplied st.
 
_genBondsDict(st, atoms)
Generates the state dictionary for the specified st.
 
orders_assigned(st, atoms=None, all=False)
Returns True if all bond orders are OK in the specified structure.
Variables [hide private]
  DEBUG = False
  logger = log.get_output_logger("schrodinger.structutils.assign...
  DEBUG_AROMATIC = True
  DEBUG_BOND_SCORE = False
  DEBUG_GROUP = True
  _template_strings = {'HEC ': '\n"FE " " N A" 0\n"FE " " N B"...
  _charges_string = '\n"HEC " " O2D" -1\n"HEC " " O2A" -1\n"HEC ...
  _new_pdb_names = {' N A': ' NA ', ' N B': ' NB ', ' N C': ' NC...
  maxvalence = [0, 1, 1, 1, 2, 6, 4, 4, 2, 1, 1, 1, 2, 8, 8, 8, ...
  alkali_metals = [3, 11, 19, 37, 55, 87]
  alkaline_earth_metals = [4, 12, 20, 38, 56, 88]
  lanthanide_series = [21, 39, 57, 58, 59, 60, 61, 62, 63, 64, 6...
  actinide_series = [89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,...
  transition_metals = [22, 23, 24, 25, 26, 27, 28, 29, 30, 40, 4...
  other_metals = [13, 31, 32, 49, 50, 51, 81, 82, 83, 84]
  all_metals = [3, 11, 19, 37, 55, 87, 4, 12, 20, 38, 56, 88, 21...
  ASSIGNED_AROMATIC = 0
  NOT_AROMATIC = 1
  NOT_ASSIGNED = 2
  __package__ = 'schrodinger.structutils'
Function Details [hide private]

get_atom_radius(atom)

 

Returns the radius of the atom, given the atomic number. For non-common atoms, returns None

get_single_bond_length(a1, a2)

 

Returns ideal length of a single-order bond between specified atoms. If either of the atoms is non-common, returns 0.0.

calculate_average_angle(st, atom_num)

 

Calculates the average of all bond angles around the input atom. Returns 0 if the angle can not be calculated. Close to 109 degrees = tertrahedral Close to 120 degrees = planar Close to 180 degrees = linear

calculate_dihedral(st, a1, a2)

 

Calculates the average dihedral angle of the bond between the specified atoms. Close to 0 (zero) is likely to be double bond.

assign_st(st, atoms=None, neutralize=False, problem_only=False, skip_assigned_residues=True)

 

Performes the fix-bond-order algorithm on the supplied st.
If the atom list is specified, only those atoms are fixed.
neutralize   - protonate carboxilic acids.
problem_only - assign only to atoms with PDB convert problem of 4
               (orange atoms). Not compatible with <atoms> argument.
skip_assigned_residues - If True, bond orders are not assigned to 
                         residues that have double or triple bonds,
                         even if that residue's atoms are in <atoms>.
                         Not compatible with <problem_only> option.

FIXME: This needs to be implemented for Ev:92646:
Returns a list of (atom1, atom2, order) for every bond whose order was
altered.

orders_assigned(st, atoms=None, all=False)

 

Returns True if all bond orders are OK in the specified structure. Can be given a list of atoms to check bond orders of. If not list is specified and all flag is set to True, all atoms are checked; otherwise only atoms with a PDB convert error (appear orange in Maestro) are checked. NOTE: atoms and all options are mutually exclusinve.


Variables Details [hide private]

logger

Value:
log.get_output_logger("schrodinger.structutils.assignbondorders")

_template_strings

Value:
{'HEC ': '''
"FE  " " N A" 0
"FE  " " N B" 0
"FE  " " N C" 0
"FE  " " N D" 0
" CHA" " C1A" 2
" CHA" " C4D" 1
" CHB" " C4A" 2
...

_charges_string

Value:
'''
"HEC " " O2D" -1
"HEC " " O2A" -1
"HEC " "FE  "  2
"HEC " " N A"  -1
"HEC " " N B"  0
"HEC " " N C"  -1
"HEC " " N D"  0
...

_new_pdb_names

Value:
{' N A': ' NA ', ' N B': ' NB ', ' N C': ' NC ', ' N D': ' ND '}

maxvalence

Value:
[0,
 1,
 1,
 1,
 2,
 6,
 4,
 4,
...

lanthanide_series

Value:
[21, 39, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71]

actinide_series

Value:
[89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103]

transition_metals

Value:
[22,
 23,
 24,
 25,
 26,
 27,
 28,
 29,
...

all_metals

Value:
[3,
 11,
 19,
 37,
 55,
 87,
 4,
 12,
...