schrodinger.application.desmond.r_group_asl module¶
- schrodinger.application.desmond.r_group_asl.countHeavyAtoms(st)¶
This function counts the number of heavy atoms in the structure.
- Parameters
st (
structure.Structure
) – Structure- Return type
int
- Returns
number of heavy atoms
- schrodinger.application.desmond.r_group_asl.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.
- Parameters
st (
structure.Structure
) – Structureatom_cutoff (
int
) – # of heavy atoms
- Returns
generator for atom pairs in important rotatable bonds
- schrodinger.application.desmond.r_group_asl.get_fep_cts(cts)¶
Find reactant and product ct from the input, and return touple of reference ligand and mutated ligand structures :param cts: input structures :return: ref_ct, mut_ct
- schrodinger.application.desmond.r_group_asl.count_heavy_atoms(ct, atom_index_list)¶
- schrodinger.application.desmond.r_group_asl.get_heavy_atoms(ct, atom_index_list)¶
- schrodinger.application.desmond.r_group_asl.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
- schrodinger.application.desmond.r_group_asl.get_attachment_bonds(source_ct, dest_ct)¶
- Parameters
source_ct (
structure.Structure
) – reference structuredest_ct (
structure.Structure
) – mutant structure
- Returns
[(int, int), (int, int)] list of attachment bond pairs: ((source_anchor, source_bridge), (dest_anchor, dest_bridge)) source_anchor and dest_anchor are matched pair of core atom numbers; source_bridge and dest_bridge are atoms connect to the anchor atom numbers (these could be None).
The algorithm works by looking at each matched pair of atoms (core atoms) and track chemical changes. If there is a dummy atom attached to the mutant core atom, an attachment point is generated. If the chemical change is connected to more than one core atoms, ring or linker atom mutation is detected for attachment point generation after the dummy atom mutations. If any of the fragment to which linker atom connects has less than 6 heavy atoms, treat this fragment as functional group.
In an attachment bond, the second atom connects to a mutating fragment. If there is a dummy atom, it is always the second atom. For bonds attached to ring/linker atom mutations, both atoms in one structure may map to atoms in the other. In case one atom is a core atom and the other is a mutating linker atom, the ring/linker atom must be the second atom. This way the calling function can use the second atom to decide which fragment is mutating across the attachment bond.
- schrodinger.application.desmond.r_group_asl.get_big_fused_rings(ct)¶
return heavy atoms of fused rings from SSSR set
- schrodinger.application.desmond.r_group_asl.combine_rings(rings)¶
combine fused rings from SSSR set :return: list of lists of atoms
- schrodinger.application.desmond.r_group_asl.is_ring_atom(ct, atom)¶
- schrodinger.application.desmond.r_group_asl.whole_ring_test(ct, atom_list)¶
test if atom list contains entire rings
- schrodinger.application.desmond.r_group_asl.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) :param graph: molecular graph :type graph: networkx graph :param anchor_index: anchor atom index :param rotable_bonds: list of rotable bonds :type rotable_bonds: list of touples
- schrodinger.application.desmond.r_group_asl.remove_extra_rotable_atoms(ct, graph, anchor_index, hot_r, rotable_bonds)¶
remove the extra fragments connected to the current hot region. :param ct: structure :param graph: molecular graph :type graph: networkx graph :param anchor_index: anchor atom index :param hot_r: hot region found by finding closes rotable bonds from anchor atom :type hot_r: list of integers :param rotable_bonds: list of rotable bonds :type rotable_bonds: list of touples
- schrodinger.application.desmond.r_group_asl.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 two items are used to find the matching fragment in the other molecule
- return
(hot_r, save_rot_bond, (rot_atom0, rot_atom1), extra_rot) where:
hot_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
- schrodinger.application.desmond.r_group_asl.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. :param source_ct: source structure :param dest_ct: dest structure :param source_att: source attachment point :type source_att: touple of integers :param dest_att: dest attachment point :type dest_att: touple of integers :param source_rotable_bonds: source rotable bond list :param dest_rotable_bonds: dest rotable bond list :return: (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.
- schrodinger.application.desmond.r_group_asl.is_rotabond(bond, rota_bond_list)¶
- schrodinger.application.desmond.r_group_asl.apply_exclusion(source_hot_frag, source_excl, dest_hot_frag, dest_excl)¶
- schrodinger.application.desmond.r_group_asl.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 :param total_heavy: total heavy atoms in the hot region so far :param source_ct: source structure :param dest_ct: dest structure :param att_bonds: all attachment bonds for mutations :param source_rot_bonds: rotable bond list of reactant :param dest_rot_bonds: rotable bond list of product :param source_frag_rot_bonds_visite: dictionary of rotable bonds already visited for attchment bonds in reactant :param dest_frag_rot_bonds_visite: dictionary of rotable bonds already visited for attchment bonds in product
- schrodinger.application.desmond.r_group_asl.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
- schrodinger.application.desmond.r_group_asl.set_hotregion(cts, max_rest_atoms=25, min_h_atom=1, exclusion_lists=(set(), set()), get_fragment=<function get_fragment>, get_attachment_bonds=<function get_attachment_bonds>)¶
- Parameters
cts (Lists of structure) – input structures, s_fep_fragname should be defined for sourec and dest cts
max_rest_atoms – maximum allowed number of heavy atoms in hot region, soft limit
min_h_atom – minimum heavy atom moved by a rotable bond
exclusion_lists – touple of sets of core atoms (hydrogen included)
get_fragment – callable to compute fragment given (atom_index0, atom_index1, ct)
get_attachment_bonds – callable to compute attathment points given two cts with i_fep_mapping defined (ct0, ct1)
- Returns
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:
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)
If a rotable bond is also an attachment point, include all atoms in the fragment.
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.
Repeat 3, if maximum number of atoms are not reached and it is still possible to add more atoms.