Package schrodinger :: Package application :: Package desmond :: Module r_group_asl
[hide private]
[frames] | no frames]

Module r_group_asl

Functions [hide private]
int
countHeavyAtoms(st)
This function counts the number of heavy atoms in the structure.
 
getImportantRotatableBonds(st, atom_cutoff=6)
This function returns important rotatable bonds.
 
get_fep_cts(cts)
Find reactant and product ct from the input, and return touple of full system, environment, reference ligand and mutated ligand structures
 
count_heavy_atoms(ct, atom_index_list)
 
get_heavy_atoms(ct, atom_index_list)
 
convert_ct2graph(ct)
 
get_fragment(b0, b1, ct)
Returns: list of atom indice for all atom connected to b1 when bond b0-b1 is removed
 
get_attachment_bonds(source_ct, dest_ct)
Returns: list of attachment bond pairs
 
get_anchor_atoms(ct)
Returns: list of atom indices Find the core atoms from which a mutation is attached
 
get_dummy_atoms(ct)
dummy atoms here includes mutated ring atoms and linker atoms
 
get_big_fused_rings(ct)
return heavy atoms of fused rings from SSSR set
 
combine_rings(rings)
combine fused rings from SSSR set
 
is_ring_atom(ct, atom)
 
whole_ring_test(ct, atom_list)
test if atom list contains entire rings
 
find_closest_rotbond(graph, anchor_index, rotable_bonds)
given anchor atom and connection graph of a molecule, find the rotable bonds that is cloest (in terms of number of bonds to the anchor atom)
 
remove_extra_rotable_atoms(ct, graph, anchor_index, hot_r, rotable_bonds)
remove the extra fragments connected to the current hot region.
 
find_frag_from_closest_rotbond(ct, anchor_index, rotable_bonds)
find rotable bond that is closest to the anchor atom in terms of number of bonds return the fragment, original rotable bond, bond used to find the fragment, and list of rotable bonds from which large fragment is cut off (extra_rot).
 
get_fragments_from_att_points(source_ct, dest_ct, source_att, dest_att, source_rotable_bonds, dest_rotable_bonds)
given attachment pairs, find the rotable fragments containing the attachment bond return fragments and the rotable bond associated The bigger one of the fragment pair is used to determine which rotabond to use.
 
is_rotabond(bond, rota_bond_list)
 
apply_exclusion(source_hot_frag, source_excl, dest_hot_frag, dest_excl)
 
extend_hotregion(total_heavy, source_ct, dest_ct, att_bonds, hotregion_source, hotregion_dest, source_rot_bonds, dest_rot_bonds, source_frag_rot_bonds_visited, dest_frag_rot_bonds_visited, max_rest_atoms, source_excl, dest_excl)
extend the hot region by moving to the next rotable bond
 
get_rotable_bonds(source_ct, dest_ct, min_h_atom)
Find rotable bonds paired for source and dest cts return paired rotable bonds in core, and all possible rotable bonds for each ct
 
set_hotregion_gui(cts)
This is called whenever the i_fep_mapping is not defined.
 
set_hotregion(cts, max_rest_atoms=MAX_NUM_REST_ATOM, min_h_atom=N_HATOM, exclusion_lists=(set(),set()))
@param cts: input structures, s_fep_fragname should be defined for sourec and dest cts @type cts: Lists of structure @param max_rest_atoms: maximum allowed number of heavy atoms in hot region, soft limit @param min_h_atom: minimum heavy atom moved by a rotable bond @param exclusion_lists: touple of sets of core atoms (hydrogen included) @retrun: number of heavy atoms assigned
Variables [hide private]
  N_HATOM = 1
  MAX_NUM_REST_ATOM = 25
  MIN_FUSED_RING = 7
  LARGE_FRAG_ON_RING = 3
  logger = log.get_output_logger(name= "r_group_asl")
  mae_fname = sys.argv [1]
  cts = []
  n_set = set_hotregion(cts, max_rest_atoms= MAX_NUM_REST_ATOM, ...
  out_fname = sys.argv [2]
Function Details [hide private]

countHeavyAtoms(st)

 

This function counts the number of heavy atoms in the structure.

Parameters:
Returns: int
number of heavy atoms

getImportantRotatableBonds(st, atom_cutoff=6)

 

   This function returns important rotatable bonds. Important rotatable bonds are defined when both sides of the
bond have
   either rings or heavy atoms greater than atom_cutoff.

   @type            st: L{structure.Structure}
   @param           st: Structure
   @type   atom_cutoff: C{int}
   @param  atom_cutoff: # of heavy atoms
   @return            : generator for atom pairs in important rotatable bonds
   

get_fep_cts(cts)

 

Find reactant and product ct from the input, and return touple of full system, environment, reference ligand and mutated ligand structures

Parameters:
  • cts - input structures
Returns:
fsys_ct, env_ct, ref_ct, mut_ct

get_fragment(b0, b1, ct)

 
Parameters:
  • b0 - first atom index for bond
  • b1 - second atom index for bond, this connects to the fragment returned
Returns:
list of atom indice for all atom connected to b1 when bond b0-b1 is removed

get_attachment_bonds(source_ct, dest_ct)

 
Returns:
list of attachment bond pairs

two cts need to have i_fep_subst codes defined ?99-?98 if one of the fragment the linker atom connects contains less than 6 heavy atoms, treat this fragment as functional group

get_anchor_atoms(ct)

 
Returns:
list of atom indices Find the core atoms from which a mutation is attached

get_dummy_atoms(ct)

 

dummy atoms here includes mutated ring atoms and linker atoms

Returns:
list of dummpy atom indices

combine_rings(rings)

 

combine fused rings from SSSR set

Returns:
list of lists of atoms

find_closest_rotbond(graph, anchor_index, rotable_bonds)

 

given anchor atom and connection graph of a molecule, find the rotable bonds that is cloest (in terms of number of bonds to the anchor atom)

Parameters:
  • graph (networkx graph) - molecular graph
  • anchor_index - anchor atom index
  • rotable_bonds (list of touples) - list of rotable bonds

remove_extra_rotable_atoms(ct, graph, anchor_index, hot_r, rotable_bonds)

 

remove the extra fragments connected to the current hot region.

Parameters:
  • ct - structure
  • graph (networkx graph) - molecular graph
  • anchor_index - anchor atom index
  • hot_r (list of integers) - hot region found by finding closes rotable bonds from anchor atom
  • rotable_bonds (list of touples) - list of rotable bonds

find_frag_from_closest_rotbond(ct, anchor_index, rotable_bonds)

 
find rotable bond that is closest to the anchor atom in terms of number of bonds
return the fragment, original rotable bond, bond used to find the fragment,
and list of rotable bonds from which large fragment is cut off (extra_rot).
The last to items are used to find the matching fragment in the other molecule
@return: (hot_r, save_rot_bond, (rot_atom0, rot_atom1), extra_rot)
     hor_r: hot region found
     save_rot_bond: original rotable bond used to find the fragment
     (rot_atom0, rot_atom1): rotable bond in the same atom order passed to get_fragment
     extra_rot: list of extra_rotable bond directly connected to the fragment;
                the fragments attached by these bonds are removed already

get_fragments_from_att_points(source_ct, dest_ct, source_att, dest_att, source_rotable_bonds, dest_rotable_bonds)

 

given attachment pairs, find the rotable fragments containing the attachment bond return fragments and the rotable bond associated The bigger one of the fragment pair is used to determine which rotabond to use.

Parameters:
  • source_ct - source structure
  • dest_ct - dest structure
  • source_att (touple of integers) - source attachment point
  • dest_att (touple of integers) - dest attachment point
  • source_rotable_bonds - source rotable bond list
  • dest_rotable_bonds - dest rotable bond list
Returns:
(source_hot_frag, dest_hot_frag, (s_rot0, s_rot1), (d_rot0, d_rot1)). The order of atoms in the rotable bonds returned is in accord to the way the fragments are generated.

extend_hotregion(total_heavy, source_ct, dest_ct, att_bonds, hotregion_source, hotregion_dest, source_rot_bonds, dest_rot_bonds, source_frag_rot_bonds_visited, dest_frag_rot_bonds_visited, max_rest_atoms, source_excl, dest_excl)

 

extend the hot region by moving to the next rotable bond

Parameters:
  • total_heavy - total heavy atoms in the hot region so far
  • source_ct - source structure
  • dest_ct - dest structure
  • att_bonds - all attachment bonds for mutations
  • source_rot_bonds - rotable bond list of reactant
  • dest_rot_bonds - rotable bond list of product
  • source_frag_rot_bonds_visite - dictionary of rotable bonds already visited for attchment bonds in reactant
  • dest_frag_rot_bonds_visite - dictionary of rotable bonds already visited for attchment bonds in product

set_hotregion_gui(cts)

 

This is called whenever the i_fep_mapping is not defined.

Parameters:
  • cts - input cts
Returns:
none

set_hotregion(cts, max_rest_atoms=MAX_NUM_REST_ATOM, min_h_atom=N_HATOM, exclusion_lists=(set(),set()))

 

@param cts: input structures, s_fep_fragname should be defined for sourec and dest cts
@type cts: Lists of structure
@param max_rest_atoms: maximum allowed number of heavy atoms in hot region, soft limit
@param min_h_atom: minimum heavy atom moved by a rotable bond
@param exclusion_lists: touple of sets of core atoms (hydrogen included)
@retrun: number of heavy atoms assigned

Set the hotregions in the cts according to mutated fragments and maximum allowed number
of atoms.  Core atoms can be exclude via exclusion_lists.

Steps to set REST region
1.  Include all the changed atoms (?99, ?97, ?98)
    If there are too many atoms, stop.  Linker atoms are ignored
    (linker connects two fragments with more than 6 heavy atoms in each of the fragments)
2.  If a rotable bond is also an attachment point, include all atoms in the fragment.
3.  For each changed fragment pair (attachment point), try to include all the atoms up
    to the closest rotatble bond.  How far away the rotable bond is is measure by
    the minimum number of bonds separating the fragment and the rotable bonds.
    Fused rings are excluded.  If the fragment is a ring, the maximum allowed atoms may
    be six more than the allowed number.
4.  Repeat 3, if maximum number of atoms are not reached and it is still possible to add
    more atoms.


Variables Details [hide private]

n_set

Value:
set_hotregion(cts, max_rest_atoms= MAX_NUM_REST_ATOM, min_h_atom= N_HA\
TOM)