schrodinger.application.desmond.fep_scholar_util module

This file contains common utility methods and classes used in several FEP scripts.

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.application.desmond.fep_scholar_util.DECREMENT(x)
schrodinger.application.desmond.fep_scholar_util.get_chmmol_bonds_from_atoms(chmmol, atoms)

This function returns a list of bonds that connect atoms in a given list.

Parameters
  • chmmol (canvas.ChmMol) – molecule structure

  • atoms (list) – list of atom indices

schrodinger.application.desmond.fep_scholar_util.get_mutation_atoms_and_bonds(cmol, match, mut_atoms)

This function determines lists of atoms and bonds that should be highlighted to show mutations.

Parameters
  • cmol (canvas2d.ChmMol) – Canvas ChmMol

  • match (list) – list of core atoms

  • mut_atoms (list) – list of ‘mutated’ atoms

Returns

tuple that contains list of atoms and list of bonds

Return type

tuple

schrodinger.application.desmond.fep_scholar_util.generate_default_pic(ligand1, ligand2)

Create default picture of two ligands, which only shows ligand structures and no mapping.

Parameters
  • ligand1 (fep_scholar_util.FEPStructureObject) – first ligand FEP structure object

  • ligand2 (fep_scholar_util.FEPStructureObject) – second ligand FEP structure object

schrodinger.application.desmond.fep_scholar_util.generate_mutation_pic(mapper, ligand1, ligand2)

Create mutations on ligand structures.

Parameters
  • mapper (fep_scholar_util.FEPScholarMapper) – FEP scholar mapper object

  • ligand1 (fep_scholar_util.FEPStructureObject) – first ligand FEP structure object

  • ligand2 (fep_scholar_util.FEPStructureObject) – second ligand FEP structure object

schrodinger.application.desmond.fep_scholar_util.generate_mapping_pic(mapper, ligand1, ligand2)

Create atom mapping by displaying atom indices on ligand structures. For the second ligand we display corresponding atom indices from the first ligand.

Parameters
  • mapper (fep_scholar_util.FEPScholarMapper) – FEP scholar mapper object

  • ligand1 (fep_scholar_util.FEPStructureObject) – first ligand FEP structure object

  • ligand2 (fep_scholar_util.FEPStructureObject) – second ligand FEP structure object

schrodinger.application.desmond.fep_scholar_util.generate_core_pic(mapper, ligand1, ligand2)

Highlight core atoms and bonds in ligand structures.

Parameters
  • mapper (fep_scholar_util.FEPScholarMapper) – FEP scholar mapper object

  • ligand1 (fep_scholar_util.FEPStructureObject) – first ligand FEP structure object

  • ligand2 (fep_scholar_util.FEPStructureObject) – second ligand FEP structure object

schrodinger.application.desmond.fep_scholar_util.generate_hot_atoms_pic(mapper, ligand1, ligand2)

Show ‘hot’ atoms on ligand structures.

Parameters
  • mapper (fep_scholar_util.FEPScholarMapper) – FEP scholar mapper object

  • ligand1 (fep_scholar_util.FEPStructureObject) – first ligand FEP structure object

  • ligand2 (fep_scholar_util.FEPStructureObject) – second ligand FEP structure object

class schrodinger.application.desmond.fep_scholar_util.MappingAnnotator(matches, map_to=None)

Bases: schrodinger.infra._canvas2d.ChemViewAnnotator

This annotator allows to show atom numbers for a selected subset of atoms. In addition user can specify ‘map to’ list of atom numbers that will be used instead to as atom labels.

__init__(matches, map_to=None)

Instantiate a MappingAnnotator instance.

Parameters
  • matches (list) – list of atoms for which atom labels will be shown.

  • map_to (list) – list of atom numbers that will be used as atom labels. Atom indices in this list are zero-based.

annotate(view, dm)

Add atom number to each atom

Parameters
  • view (Chemview) – the View this item goes in

  • dm (ChmDrawMol) – object that contains the list of atom and bond graphics

class schrodinger.application.desmond.fep_scholar_util.MetaAtom(atom)

Bases: object

This is the meta atom class that mostly provides convinience functions. It is used by the scholar mapper functions.

__init__(atom)
property index
property atom_type

Return macromodel atom type.

property xyz
property connected_atoms

Return a list of atoms that are bonded to this atom.

class schrodinger.application.desmond.fep_scholar_util.FEPScholarMapper(st1, st2, dist=0.4, match1=None, match2=None, core_hop=False)

Bases: object

This is a mapper class used by FEP Scholar GUI so that we don’t need to use Canvas MCS for matching molecule atoms.

__init__(st1, st2, dist=0.4, match1=None, match2=None, core_hop=False)

Class initializer, which takes two molecule structures that need to be matched. If optional core atom matches for two molecules are provided (match1 and match2) this data would be used to match two molecules instead.

Parameters
  • st1 (structure.Structure) – first structure

  • st2 (structure.Structure) – second structure

  • dist (float) – distance cutoff

  • match1 (list) – list of core atom indices for first structure

  • match2 (list) – list of core atom indices for second structure

createMap()

This function should be called when this class is initialized. It determines atom mapping between two structures. Mapping information is stored as various properties in structure objects.

getMatches()

This function returns tuple that contains lists of ‘core’ atom indices for both structures. For the second ligand list of atom matches is reordered to reference the list of matches for the first ligand.

Returns

tuple that contains two lists of core atoms

Return type

tuple

getMutations()

This function finds mutated atoms for two ligand structures. Atoms in two ligands are defined as ‘mutated’ if they are defined as ‘core’ atoms, but don’t have same atomic numbers.

Returns

tuple that contains lists of ‘mutated’ atoms for two ligands

Return type

tuple

getHotAtoms()

This function returns lists of ‘hot’ atoms for two ligands.

Returns

tuple that contains lists of ‘hot’ atoms.

Return type

tuple

getStructures()

This function returns structure.Structure objects for two ligands. Note that these structures are different(!) from the ones used to initialize this class. There contain special fep mapping properties.

Returns

modified structures for two ligands

Return type

tuple

getCoreRmsd()

This function calculates RMSD for core atoms in two ligands.

Returns

core RMSD

Return type

float

get_carat_map(st)
clear_atom_props(st)
get_dist(xyz1, xyz2)
get_atom_key(atom)
get_coords_dict(st)

This function creates so-called coordinates dictionary for each atom in a structure. Here key is the text string based on atom coordinates and value is atom’s MetaAtom object.

Returns

‘coordinates dictionary’

Return type

dict

del_from_carat(idx)
set_match_atom(atom, matched_atom_index)
match_by_cartesian_coordinates(st_new)
match_by_distance(st_new, distance)
get_core_map(st_new)
remove_unconn_core_atoms(st_new)
match_core_hydrogens(st_new)
get_fep_mapping(st)
class schrodinger.application.desmond.fep_scholar_util.ScholarStructureItem(rect=None)

Bases: schrodinger.ui.qt.structure2d.structure_item

This class adds new function to the base structure_item class that allows to show some atoms and bonds with highlighting.

generatePictureHighlight(atoms, bonds, color, gen_coord)

Generates a QPicture of the structure. This should be called after setting the structure and the accompaning annotators.

Parameters
  • atoms (list) – list atom indices that should be highlighted.

  • bonds (list) – list of bond indices that should be highlighted

  • color (QtGui.QColor) – highlighting color

  • gen_coord (bool) – argument indicating whether molecule coordinates should be generated.

class schrodinger.application.desmond.fep_scholar_util.FEPStructureObject(parent, rect=None)

Bases: PyQt6.QtCore.QObject

This class holds all information about each ligand. It also contains drawing objects.

__init__(parent, rect=None)
setStructure(st, template_chmmol=None, mapper=None)

Set structure and generate coordinates. If template molecule is provided, coordinates will be generated to align matching mcs atoms.

Parameters
  • st (structure.Structure) – molecule structure

  • template_chmmol (canvas2d.ChmMol) – template molecule

  • mapper (FEPScholarMapper) – FEP mapper from which MCS matches are obtained.

setChmmol(chmmol)

Assigns a chmmol to the structure item, then clears and regenerates its picture.

Parameters

chmmol (canvas2d.ChmMol) – the chmmol object corresponding to the structure

clear()
sizeHint()

Provide size hint for structure pictures.

See Qt documentation for an explanation of arguments and return value.

schrodinger.application.desmond.fep_scholar_util.make_fep_cmd(cd_params, jobname, struct_fname, opt=[])

Generates an FEP command list based on the specified parameters.

Parameters
  • cd_params (dict) – config dialog parameters

  • jobname (str) – the jobname

  • main_msj_fname (str) – the filename for the main msj file

  • struct_fname (str) – the filename for the input structure

Returns

a command list for launching the job

Return type

list

schrodinger.application.desmond.fep_scholar_util.generate_scripts(cd_params, jobname, cmd)

Write the command line for submitting the job