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

Module int_match

Classes [hide private]
  MatchedInteractions
abstraction for all kinds of matched interactions
  AlchemicalInteractions
Dictionaries for matched, unmatched and to be deleted interactions Atom is keyed by "m", "wt_dummy" and "mut_dummy"
Functions [hide private]
 
convert_fragment_to_graph(bonds, atoms)
Convert a molecule to networkx graph bonds: all bonds in the molecule atoms: list of fragment atoms retrun: nx graph
 
select_bonds_to_delete(att_points, g)
Select attachment points to delete so that the no two core attachment points are connected att_points: list of attachement points g: networkx graph return: dictionary of paths from anchor atom up to broken bond keyed by broken bonds
 
find_bonds_to_delete(frag_group, wt_bonds, mut_bonds)
Given a fragment group, find all the bonds that need to be deleted...
 
get_all_deleted_bonds_of_decoupled_state(fragment_groups, wt_bonds, mut_bonds)
Find all deleted_bonds in dummy state because of loops...
 
get_conf_restraint(path_dict)
Get conformational restraints from path dictionary path_dict: dictionary of path from anchor atom upto broken bonds return: list of dihedral angles for conformation restraint
 
match_pairs(wt_pairs, mut_pairs, wt_core_map, mut_core_map)
Match pairs (bond, 14, exclusion) of wt and mut cts wt_pairs: set of pairs in reactant mut_pairs: set of pairs in product wt_core_map: map of core atoms in reactant to that product mut_core_map: map of core atoms in product to that in reactant return: MatchedInteractions object for pairs
 
match_bonds(wt_bonds, mut_bonds, wt_bonds_delete, mut_bonds_delete, wt_core_map, mut_core_map)
Match bonds of wt and mut cts wt_bonds: set of bonds in reactant mut_bonds: set of bonds in product wt_bonds_delete: set of bonds to be deleted in reactant dummy state mut_bonds_delete: set of bonds to be deleted in product dummy state wt_core_map: map of core atoms in reactant to that product mut_core_map: map of core atoms in product to that in reactant return: MatchedInteractions object for bonds
 
linear_bonds(atoms)
Given consective list of atom indices, generate set of bonds atoms: list of n atoms return: set of bonds (frozenset((0, 1)) , frozenset((1, 2)), ..., frozenset((n-1, n)))
 
find_angles_contain_bond(angles, bond)
Find all angles that contain bond
 
match_angles(wt_angles, mut_angles, wt_core_map, mut_core_map, wt_bonds_delete, mut_bonds_delete)
Match bonds of wt and mut cts wt_angles: set of angles in reactant mut_angles: set of angles in product wt_core_map: map of core atoms in reactant to that product mut_core_map: map of core atoms in product to that in reactant wt_bonds_delete: bonds involving dummpy atoms in reactant to be delted mut_bonds_delete: bonds involving dummpy atoms in product to be delted return: MatchedInteractions object for angles
 
find_dihedrals_contain_bond(dihedrals, bond)
Find all dihedrals that contain bond dihedrals: list of dihedral angles bond: tuple of atom indexes for bond
 
match_dihedrals(wt_dihedrals, mut_dihedrals, wt_core_map, mut_core_map, wt_bonds_delete, mut_bonds_delete)
Match bonds of wt and mut cts wt_dihedrals: set of dihedrals in reactant mut_dihedrals: set of dihedrals in product wt_core_map: map of core atoms in reactant to that product mut_core_map: map of core atoms in product to that in reactant wt_bonds_delete: bonds involving dummpy atoms in reactant to be delted mut_bonds_delete: bonds involving dummpy atoms in product to be delted return: MatchedInteractions object for dihedrals
 
find_impropers_contain_bond(impropers, bond)
Find all impropers that contain bond impropers: list of improper, (i, j, k, l) k is connnect to all other three atoms bond: bond tuple
 
match_impropers(wt_impropers, mut_impropers, wt_core_map, mut_core_map, wt_bonds_delete, mut_bonds_delete, wt_bonds, mut_bonds)
Match bonds of wt and mut cts wt_impropers: set of impropers in reactant mut_impropers: set of impropers in product wt_core_map: map of core atoms in reactant to that product mut_core_map: map of core atoms in product to that in reactant wt_bonds_delete: bonds involving dummpy atoms in reactant to be delted mut_bonds_delete: bonds involving dummpy atoms in product to be delted wt_bonds: all bonds in wt mut_bonds: all bonds in mut return: MatchedInteractions object for improper terms
 
generate_core_maps(source_core_atoms, dest_core_atoms)
return two dictionaries of forward and inverse core atom maps
 
remove_deleted_att(att_dict, bond_delete)
Find all attachment points that still exist after bond deletion att_dict: dictionary keyed by attachment bond bond_delete: bonds to be deleted return set of attachment points remains
 
find_angle_for_att(unmatched_angles, att_bonds, core_atoms)
Find angle terms that contains attachment points and one core atom...
 
find_dihedrals_for_att(unmatched_dihedrals, att_dict, core_atoms)
Find dihedrals containing attchment points and at least one core atom unmatched_dihes: set of dihedrals involving at least one dummy atom att_dict: dictionary keyed by attachment point core_atoms: core_atom list return: attachment dictionary with dihedrals, remaing dihedrals to be kept
 
match_angle(core_map, angle)
Given core map and angle, return matched angle in conanical form (i, j, k) (i < k) core_map: mapping core atoms to those in the other molecule angel: angle to be mapped return matched_angle or None if there is no match
 
find_dihe_contain_angle(dihes, angle, core_atoms)
Find dihedral angles containing the angle dihes: list of dihedrals angle: imput angle in conanical form core_atoms: list of core atoms return a dictionary keyed by number of core atoms consisting of the dihedral
 
find_atoms_to_restrain(ct, att_dict, core_map, angles_param, other_angles_param)
Find all the possible atoms for dihedral or improper restraint across attachment bonds ct: the L{schrodinger.Structure} object of this molecule att_dict: dictionary of interactions keyed by attachment bonds core_map: map core atoms to the ones in the other molecule angles_param: parameter dictionary for angles in this other_angles_param: parameter dictionary of angles for the other return: dictionary: key = attachment-bond, value = a list of tuples, where each tuple is (angle, proper/None, improper/None).
 
find_impropers_for_att(unmatched_impts, att_dict, core_atoms)
Find impropers contaning attachment points and at least one core atom unmatched_impts: set of impropers involving at least one dummy atom att_dict: dictionary keyed by attachment point core_atoms: core_atom list return: attachment dictionary with impropers, remaing impropers to be kept
 
find_ring_containing_att(ct, anchor, bridge)
ct: schrodinger.Structure instance of this molecule anchor: index of the anchor atom (at the core side) bridge: index of the bridge atom (at the dummy side) return: a list of lists.
 
find_dihedrals_containing_atoms(ai, aj, ak, dihedrals)
ai, aj, and ak: indices of the 3 atoms in a dihedral quadruplet.
 
next_atom_in_ring(i, ring)
i: array index of the current atom in the ring.
 
prev_atom_in_ring(i, ring)
Similar to next_atom_in_ring, but returns a 2-tuple for the previous atom in the ring.
 
find_next_atom_in_ring(aj, ak, ring)
find the next atom in the ring along the direction from aj to ak.
 
find_dihedral_restraint_for_dummy(ring, dihedrals, ai, aj, ak)
find all dihedral restraints that involve L{ai}, L{aj}, and L{ak} atoms.
 
add_dihedral_restraint_for_dummy(ct, core_atoms, dummy_atoms, att_points, dihedrals, angles)
add one dihedral angle for dummy atoms directly attached to attachment point ct: schrodinger.Structure instance of this molecule core_atoms: list of core atoms dummy_atoms: list of dummy atoms att_points: list of attachment point tuples dihedrals: dihedral angles containing attachment point return: list of additional dihedrals to be restrainted
 
update_generic(interaction_dict, im_matched, wt_param, mut_param, wt_kept, mut_kept, include_param=True)
update interaction match dictionaries for generic interactions, dihedrals and impropers
 
update_pair(pair_dict, pair_match, wt_param, mut_param, include_param=True)
update 14 and exclusion interaction matches ignore del terms for 14pair and exclusion
 
matched_w_diff_param(matched, wt_param, mut_param, include_param=True)
Check if parameters are different for matched interaction pairs matched: list of matched interactions wt_param: reactant parameter dictionary for initial molecule mut_para: product parameter dictionary for final molecule return: dictionary of parameters keyed by the matched pair
 
unmatched_param(wt_unmatched, wt_param, include_param=True)
Generate parameter dictionary for unmatched interaction term return: dictionary of parameters
 
get_restraint_angle_dihe_improper(rest_dict, att_dict)
Find restraint/deletion of angle, dihedral and improper terms from attachment point dictionary rest_dict: dictionary for restraint keyed by attachment bond att_dict: dictionary for all interactions involving attachemnt bonds keyed by attachment bond return: (angle_kept, angle_delete, dihedral_restraint, improper_restraint)
 
fake_param(keys)
Generate dummy parameters for 14pair and exclusion
 
generate_alchemy(wt_ct, wt_core, mut_ct, mut_core, ff, incl_param=False)
Compute alchemical interaction match for to molecules given matching core atoms wt_ct: input structure for initial molecule wt_core: core atom indices for initial molecule mut_ct: input structure for final molecule mut_core: core atom indices for final molecule, must match wt_core in order ff: instance of FFFLD class incl_param: include force field parameters in the output or not return: instance of AlchemicalInteractions class
Variables [hide private]
  __package__ = 'schrodinger.application.desmond'
Function Details [hide private]

select_bonds_to_delete(att_points, g)

 

Select attachment points to delete so that the no two core attachment points
are connected
att_points: list of attachement points
g: networkx graph
return: dictionary of paths from anchor atom up to broken bond
        keyed by broken bonds

in general cut in the middle of shortest path,
excluding bonds in cycles

find_bonds_to_delete(frag_group, wt_bonds, mut_bonds)

 

Given a fragment group, find all the bonds that need to be deleted
frag_group: FragmentGroup instance
wt_bonds: all bonds in wt 
mut_bonds: all bonds in mut 
return: (wt_path, mut_path)
         wt_path, dictionary of atoms connect the breaking point to an anchor atom             
         mut_path, dictionary of atoms connect the breaking point to an anchor atom             

get_all_deleted_bonds_of_decoupled_state(fragment_groups, wt_bonds, mut_bonds)

 

Find all deleted_bonds in dummy state because of loops
fragement_groups: list of FragmentGroup objects
wt_bonds: all bonds in wt 
mut_bonds: all bonds in mut 
return: (wt_path, mut_path)
         wt_path, dictionary of atoms connect the breaking point to an anchor atom             
         mut_path, dictionary of atoms connect the breaking point to an anchor atom             

find_angle_for_att(unmatched_angles, att_bonds, core_atoms)

 

Find angle terms that contains attachment points and one core atom
unmatched_angles: set of angles involving at least one dummy atom
att_bonds: set of attachment bonds
core_atoms: core_atom list
return: dict of keeped angle,
        angles to be turned off and angles to be kept keyed by att_ponits

find_atoms_to_restrain(ct, att_dict, core_map, angles_param, other_angles_param)

 

Find all the possible atoms for dihedral or improper restraint across attachment bonds
ct: the L{schrodinger.Structure} object of this molecule
att_dict: dictionary of interactions keyed by attachment bonds
core_map: map core atoms to the ones in the other molecule
angles_param: parameter dictionary for angles in this
other_angles_param: parameter dictionary of angles for the other
return: dictionary: key = attachment-bond, value = a list of tuples, where each tuple
        is (angle, proper/None, improper/None). where the proper or improper is the
        is the candidate dihedral interation to be restrained.

find_ring_containing_att(ct, anchor, bridge)

 

ct: schrodinger.Structure instance of this molecule anchor: index of the anchor atom (at the core side) bridge: index of the bridge atom (at the dummy side) return: a list of lists. each element is a list of atom IDs from the same ring.

find_dihedrals_containing_atoms(ai, aj, ak, dihedrals)

 

ai, aj, and ak: indices of the 3 atoms in a dihedral quadruplet.
dihedrals: a list of 4-tuples. each 4-tuple element is a set of four atom indices.
return: a list of 4-tuples. each 4-tuple element is a set of four atom indices,
        representing a dihedral angle that involves the given three atoms.

next_atom_in_ring(i, ring)

 

i: array index of the current atom in the ring.
ring: a list of sorted atom IDs. these atoms form a ring topology.
      e.g., a 4-member ring:
            
            1---2
            |   |
            3---4

where the numbers are atom IDs. C{ring} value would be = [1, 2, 3, 4].

return: 2-tuple (array-index, ID-of-next-atom). For example:
        C{next_atom_in_ring(1, [1, 2, 3, 4])} will return (2, 3).

find_next_atom_in_ring(aj, ak, ring)

 

find the next atom in the ring along the direction from aj to ak. aj and ak: Atom IDs. They should be atoms in the given ring. ring: a list of sorted atom IDs. these atoms form a ring topology. Refer to the docstring of next_atom_in_ring for more detail. return: atom IDs of the next atom in the ring. except: RuntimeError will be raised if the atom cannot be found.

find_dihedral_restraint_for_dummy(ring, dihedrals, ai, aj, ak)

 

find all dihedral restraints that involve L{ai}, L{aj}, and L{ak} atoms.
ring: a list of sorted atom IDs. these atoms form a ring topology. Refer to the
docstring of L{next_atom_in_ring} for more detail.
dihedrals: a list of 4-tuples. each 4-tuple element is a set of four atom indices.
return: a list of 4-tuples. each 4-tuple element is a set of four atom indices,
        representing a dihedral angle that involves the given three atoms.

update_generic(interaction_dict, im_matched, wt_param, mut_param, wt_kept, mut_kept, include_param=True)

 

update interaction match dictionaries for generic interactions,
       dihedrals and impropers

interaction_dict: output dictionary for different type of interactions
im_matched: input MatchedInteractions object
wt_param: dictionary of parameters keyed by interaction for initial molecule
mut_param: dictionary of parameter keyed by interaction for final molecule
include_param: boolian to decide if parameters are to be included in output

update_pair(pair_dict, pair_match, wt_param, mut_param, include_param=True)

 

update 14 and exclusion interaction matches ignore del terms for 14pair and exclusion

pair_dict: output dictionary for different pair interactions pair_match: input MatchedInteractions object for pair wt_param: dictionary of parameters keyed by pair for initial molecule mut_param: dictionary of parameter keyed by pair for final molecule include_param: boolian to decide if parameters are to be included in output