Package schrodinger :: Package application :: Package canvas :: Module r_group
[hide private]
[frames] | no frames]

Module r_group

Detect r-groups from CanvasMCS, CombiGlide, or SMARTS

Classes [hide private]
  Data
Class to store intermediary and finals data structures for R-group analysis.
  TempAtom
  RGroupException
This is a special exception, which is thrown when for some reason r-group calculation can not be completed.
  RGroupFinder
This class is used to find optimal core alignments and determines r-groups for input structures.
Functions [hide private]
 
add_methyl_ring(ct, principal_bond, bond_list, attachment_positions, output, grow=True)
Add capping methyls to ring like r_groups
 
add_methyl_standard(ct, core_atom, side_atom, output, grow=True)
Breaks bond between core and side atom Grows Carbon off of side-atom, maintaining bond order of core_atom - side_atom bond
 
add_to_data(data, fragment, from_atom, to_atom, to_atom_chirality, j, ct_index)
tuple
checkMultipleMappings(fragment, smiles, from_atom, to_atom)
This function checks whether a given fragment may match SMILES string multiple times.
 
determine_attachments(core, ct, ct_index, data)
 
get_atom_chirality(ct, atom)
 
determine_rings_in_attachments(functional_rings, r_group_attachment_bonds)
 
determine_attachment_bonds(ct, core, r_groups_per_atom)
@return list of lists.
 
conglomerate_rings(rings, core)
This function takes the mmssr and combines rings if they are entirely part of the core structure.
 
bond_in_ring(ring, bond)
 
get_connected_ring_bonds(ct_rings, ring)
This function returns any other rings that are also connected to any attachment bonds that are part of the ring fed to the function.
 
get_rgroup_DEE(input_file, SMARTS, temp_dir=None, thread=None, use_mm=1, use_fp_sim=False, sa_seed=None, t_factor=None, tmax_mult=None)
 
get_rgroup_SMARTS(input_file, SMARTS, temp_dir=None, thread=None)
Takes input_file and SMARTS_pattern and defines r-groups input_file - input .mae file SMARTS_pattern defining core
 
get_rgroup_combgen(input_file, temp_dir=None)
Takes an input_file and creates instance of Data class That stores r_groups as SMILE patterns
 
get_rgroup_MCS(input_file, MCS_index, temp_dir=None, thread=None, use_mm=0, use_fp_sim=False, sa_seed=None, t_factor=None, tmax_mult=None)
Determines the core and r-groups using the canvasMCS method.
list
getMCSMatches(input_file, MCS_index, temp_dir=None, thread=None)
This function is used to setup and run MCS calculation on a given input file.
 
find_best_core_match(ct, cores, ref_ct=None, ref_core=None)
 
write_core_only(structure, attachment_points, core_indexes, core_bonds, temp_dir=None)
 
add_ct_data(data, core, ct, ct_index)
Add to the determine the rings and r-groups per atom for each ct and add the following data structures: data.add_functional_rings data.add_rings data.add_r_groups_to_atom
Settings
write_output(data, input_file, smarts, cli=False, temp_dir=None, thread=None, settings=None)
This function writes RGA results to output files.
 
determine_rgroup_indexes(ct, number_of_groups)
list
evaluate_smarts_ex(structure, smarts, stereo=STEREO_FROM_ANNOTATION_AND_GEOM, start_index=1, uniqueFilter=False, allowRelativeStereo=False, rigorousValidationOfSource=False, hydrogensInterchangeable=True)
Evaluate SMARTS patterns using the Canvas libraries.
 
import_canvas()
Perform a lazy import of canvas libraries to speed up loading time.
 
import_canvas2d()
Variables [hide private]
  __doc__ = ...
  logger = log.get_output_logger("schrodinger.application.canvas...
  canvastable = None
hash(x)
  canvasapp = None
hash(x)
  maestro = None
hash(x)
  canvasmcs_process = None
hash(x)
  canvas2d = None
hash(x)
  canvas = None
hash(x)
  NULL_GROUP = 'null'
  HYDROGEN_GROUP = 'hydrogen'
  ATTACHMENT_PAIRS_TO_SKIP = [(NULL_GROUP, NULL_GROUP), (NULL_GR...
Function Details [hide private]

add_methyl_ring(ct, principal_bond, bond_list, attachment_positions, output, grow=True)

 

Add capping methyls to ring like r_groups

Parameters:
  • ct (schrodinger.structure.Structure object) - structure that you are adding a capping group to
  • principal_bond (list) - [ _StructureAtom of to_atom, _StructureAtom of from_atom, bond_order ]
  • bond_list (list) - This contains an outer list of all bonds (specified in in the same way as principal_bond) which contain rings that will need to be capped
  • attachment_positions (list) - list of the index of bonds (from the data.r_group_attachment_bonds ), which need to be capped with rings
  • output (bool)
Returns:
Returns a tuple of structure of the fragment, to_atom index and from-atom index

add_methyl_standard(ct, core_atom, side_atom, output, grow=True)

 

Breaks bond between core and side atom Grows Carbon off of side-atom, maintaining bond order of core_atom - side_atom bond

Parameters:
  • ct (schrodinger.structure.Structure object) - structure that you are adding a capping group to
  • core_atom (int) - index of the core atom
  • side_atom (int) - index of the attachment atom
  • output (bool)
Returns:
Returns a tuple of structure of the fragment, to_atom index and from-atom index

checkMultipleMappings(fragment, smiles, from_atom, to_atom)

 

This function checks whether a given fragment may match SMILES string multiple times. In that case a 'canonical' match is selected. In no mapping is found we return (-1, -1) as in previous version of add_to_data function. We assume that calling functions know how to deal with this case.

Parameters:
  • fragment (structure.Structure) - r-group structure
  • from_atom (int) - atom index of 'from' atom in fragment. This is a core atom that was replaced with a cap group.
  • to_atom (int) - atom index of 'to' atom in fragment. This is atom in r-group attached to core.
  • smiles (str)
Returns: tuple
tuple that contains positions of 'from' and 'to' atoms in SMILES mapping. These values are 0-indexed. If no mapping is found we return (-1, -1).

determine_attachment_bonds(ct, core, r_groups_per_atom)

 

@return list of lists. Inner element is the [core_atom, bonded_atom, bond_order ] of each attachment point

conglomerate_rings(rings, core)

 

This function takes the mmssr and combines rings if they are entirely part of the core structure. Since we know in RGA we are never breaking the core structure, this is a safe operation.

Parameters:
  • rings - output from a mmsssr calculation on the entire output structure
  • core - list of atoms in the core structure

get_connected_ring_bonds(ct_rings, ring)

 

This function returns any other rings that are also connected to any attachment bonds that are part of the ring fed to the function.

Parameters:
  • ct_rings (list) - Outer list is a list of each ring that is stored in the data class. Inner list is an index of the attachment bond that is present in that ring
  • ring (list) - List of attachment bonds that are present in the ring

get_rgroup_MCS(input_file, MCS_index, temp_dir=None, thread=None, use_mm=0, use_fp_sim=False, sa_seed=None, t_factor=None, tmax_mult=None)

 

Determines the core and r-groups using the canvasMCS method.

Parameters:
  • input_file (string) - Absolute path to mae file to run the canvasMCS utility on
  • MCS_index (int/str) - atomtyping scheme to use in canvasMCS
  • temp_dir (str) - name of temporary directory
  • thread (calculation_thread) - calculation thread (optional)
  • use_mm (int) - type of multiple matching algorithm (0-Original method, 1-SA and 2-DEE)
  • use_fp_sim (bool) - True to use fingerprint similarity between pairs of 'states'
  • sa_seed (int) - SimulatedAnnealing random number generator seed. 'None' will use the SimulatedAnnealing defaults.
  • t_factor - SimulatedAnnealing temperature factor. 'None' will use the SimulatedAnnealing defaults.
  • tmax_mult (float) - SimulatedAnnealing parameter to set starting temperature. 'None' will use the SimulatedAnnealing defaults.

getMCSMatches(input_file, MCS_index, temp_dir=None, thread=None)

 

This function is used to setup and run MCS calculation on a given input file. It returns a list of matching SMARTS patterns.

Parameters:
  • input_file (string) - Absolute path to mae file to run the canvasMCS utility on
  • MCS_index (int/str) - atomtyping scheme to use in canvasMCS
  • temp_dir (str) - name of temporary directory
  • thread (calculation_thread) - calculation thread (optional)
Returns: list
list of matching SMARTS patterns

add_ct_data(data, core, ct, ct_index)

 

Add to the determine the rings and r-groups per atom for each ct and add the following data structures: data.add_functional_rings data.add_rings data.add_r_groups_to_atom

Parameters:
  • core (list) - list of atoms belonging to the core
  • ct (schrodinger.structure.Structure object) - structure object corresponding to the core atoms

write_output(data, input_file, smarts, cli=False, temp_dir=None, thread=None, settings=None)

 

This function writes RGA results to output files.

Parameters:
  • data (Data) - data object that contains calculation results
  • input_file (str) - name of input file used in calculation
  • smarts (bool) - True when MCS/SMARTS method was used and False otherwise
  • cli (bool) - True if RGA was run from CL without GUI (this is a guess!)
  • temp_dir (str) - name of temporary directory
  • thread (calculation_thread) - thread used to run RGA calculation
Returns: Settings
Settings data object, which is used in RGA GUI

evaluate_smarts_ex(structure, smarts, stereo=STEREO_FROM_ANNOTATION_AND_GEOM, start_index=1, uniqueFilter=False, allowRelativeStereo=False, rigorousValidationOfSource=False, hydrogensInterchangeable=True)

 

Evaluate SMARTS patterns using the Canvas libraries.

Returns a list of lists of ints. Each list of ints is a list of atom indices matching the SMARTS pattern.

Parameters:
  • structure (Structure or schrodinger.application.canvas.base.ChmMol) - Structure to search for matching substructures.
  • smarts (str) - SMARTS string used to match substructures.
  • stereo (enum) - Specify how to determine the stereochemistry of a ChmMol from a Structure. Can be STEREO_FROM_GEOMETRY, STEREO_FROM_ANNOTATION, STEREO_FROM_ANNOTATION_AND_GEOM, or NO_STEREO. See schrodinger.structutils.smiles.SmilesGenerator.__init__ for descriptions of these options.
  • start_index (int) - Specify the start index of the atom indices returned. Defaults to Structure mode, which is 1-based. Pass in 0 for 0-based indices.
Returns: list
Each value is a list of atom indices matching the SMARTS pattern.

Variables Details [hide private]

__doc__

Value:
"""
r_group.py

Description: A module that contains function to detect r-groups. The c\
ore is
determined either from CombiGlide results, a user-submitted SMARTS pat\
tern,
or a Canvas Maximum Common Substructure. These functions were split fr\
...

logger

Value:
log.get_output_logger("schrodinger.application.canvas.r_group")

ATTACHMENT_PAIRS_TO_SKIP

Value:
[(NULL_GROUP, NULL_GROUP), (NULL_GROUP, HYDROGEN_GROUP), (HYDROGEN_GRO\
UP, NULL_GROUP), (HYDROGEN_GROUP, HYDROGEN_GROUP)]