schrodinger.application.glide.glide module

Classes for creating Grid Generation and Ligand Docking DICE (Impact) input files from user-friendly keyword/value pairs.

The classes use the mm.mmim* wrappers to convert the keywords and values into the actual DICE input files.

Job parameters are specified by passing a dictionary of keyword/value pairs to the class initialization method. In addition, some parameters, such as constraints, can be specified by calling class methods.

Calling the writeSimplified() method will create the input file that can be passed to $SCHRODINGER/glide. The value of the JOBNAME keyword will be used as the base name for the input file.

For a full list of keywords accepted by the Gridgen and Dock classes, respectively, see the output of

$SCHRODINGER/glide -gridgen-keywords
$SCHRODINGER/glide -docking-keywords

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.glide.glide.Grid(grid_file)

Bases: object

Class representing the user selected grid file.

__init__(grid_file)
isValid()

Whether the specified grid file is valid.

class schrodinger.application.glide.glide.Constraint(label, constype)

Bases: object

Class defining a docking constraint in the receptor.

__init__(label, constype)
property name

User-visible constraint name, as it appears in UI and in Glide input files.

type()

Return the type of the (receptor) constraint as a user-friendly string. Possible return values:

  • ‘Hydrophobic’

  • ‘H-bond donor’

  • ‘H-bond acceptor’

  • ‘Metal’

  • ‘Positional’

  • ‘NOE’

  • ‘Metal coordination’

class schrodinger.application.glide.glide.DonorConstraint(label, atoms=None)

Bases: schrodinger.application.glide.glide._HBondConstraint

H-Bond constraint that was specified as a receptor donor atom. A ligand must have an ACCEPTOR group that is making an interaction with this atom to satisfy this constraint.

class schrodinger.application.glide.glide.AcceptorConstraint(label, atoms=None)

Bases: schrodinger.application.glide.glide._HBondConstraint

H-Bond constraint that was specified as a receptor acceptor atom. A ligand must have a DONOR group that is making an interaction with this atom to satisfy this constraint.

class schrodinger.application.glide.glide.MetalConstraint(label, atoms=None)

Bases: schrodinger.application.glide.glide.Constraint

This constraint was specified as a metal receptor atom. A ligand must interact with this metal atom to satisfy this constraint.

keyword = 'METAL_CONSTRAINTS'
__init__(label, atoms=None)
atoms()
atom()
sifValue()
class schrodinger.application.glide.glide.PositionalConstraint(label, x=None, y=None, z=None, radius=None)

Bases: schrodinger.application.glide.glide.Constraint

keyword = 'POSIT_CONSTRAINTS'
__init__(label, x=None, y=None, z=None, radius=None)
sifValue()
class schrodinger.application.glide.glide.NOEConstraint(label, x=None, y=None, z=None, rmin=None, rmax=None)

Bases: schrodinger.application.glide.glide.Constraint

keyword = 'NOE_CONSTRAINTS'
__init__(label, x=None, y=None, z=None, rmin=None, rmax=None)
sifValue()
class schrodinger.application.glide.glide.MetCoordConstraint(label, xmetc, ymetc, zmetc, rmetc)

Bases: schrodinger.application.glide.glide.Constraint

keyword = 'METCOORD_CONSTRAINTS'
sites_keyword = 'METCOORD_SITES'
__init__(label, xmetc, ymetc, zmetc, rmetc)
sifValue()
siteSifValue()
class schrodinger.application.glide.glide.HydrophobicConstraint(label)

Bases: schrodinger.application.glide.glide.Constraint

__init__(label)
class schrodinger.application.glide.glide.FeaturePattern(smarts, atoms, exclude=False, nfill=None)

Bases: object

Class defining a constraint feature pattern.

__init__(smarts, atoms, exclude=False, nfill=None)
class schrodinger.application.glide.glide.Feature(patterns=None)

Bases: object

A list of FeaturePattern objects. Each pattern has these properties: smarts, atoms, exclude.

__init__(patterns=None)
Parameters

patterns (list) – List of patterns associated with this feature. A shallow copy of the patterns list will be made for the new Feature object.

class schrodinger.application.glide.glide.ConstraintGroup(parent, constraints=None, nrequired=- 1)

Bases: object

Class defining a constraint group.

__init__(parent, constraints=None, nrequired=- 1)
addConstraint(label)
setup(cons_labels, feature_sets)
cleanup()

Free the memory associated with this group

class schrodinger.application.glide.glide.GlideJob(jobtype=None, specs=None, keywords=None, createhandle=False)

Bases: schrodinger.application.inputconfig.InputConfig

Class for writing Glide input files - either Gridgen or Docking. The keywords passed are used to set MMIM directly with no processing.

__init__(jobtype=None, specs=None, keywords=None, createhandle=False)

Specify a dictionary of keywords, where the key is the short keyword name and the value is what is should be set to. For indexed keywords, the value needs to be a list. It is also possible to specify a file path to a simplified input file that contains the keywords.

validateValues(*args, **kwargs)

Validate the keywords against the spec. Unlike the parent implementation, raise a ValueError if any unknown keywords are present.

get(key, default=None)

A version of get that doesn’t bypass string interpolation.

getAllowedRange(key)

Will return a tuple of (min, max) for the allowed range of value. Either or both of these values may be None.

Returns

The allowed min/max range.

Return type

Tuple of 2 ints/floats.

cleanup()

Clean up constraints objects.

writeSimplified(filename=None, yesno=False)

Writes a simplified input file to “<jobname>.inp”. This input file needs to be run via $SCHRODINGER/glide.

applyContextDependentDefaults()

Apply context-dependent defaults for a Glide job. It modifies the job object, but marks the modified keywords as “default” so they won’t be written by writeSimplified().

checkConflicts()

Check for invalid keyword combinations. Raises a ValueError if any are found.

setupJson(jsdict)

Additional setup to do before writing a JSON file. Base implementation does nothing. This method is expected not to modify ‘self’, but only jsdict, which is the dictionary of keywords that ultimately will be written to the JSON file.

checkForceFieldLicense(jsdict)

If we are using the default forcefield (OPLS3) and don’t have an OPLS license, fall back to using OPLS_2005.

compileDict()

Return a “compiled” dict with _all_ the keywords, including the ones with default values, after doing validation and applying context-dependent defaults.

writeJSON(filename=None)

Write the keywords as a JSON representation. Unlike writeSimplified, this includes the values for all the keywords, not only the non-default ones.

class schrodinger.application.glide.glide.Gridgen(keywords)

Bases: schrodinger.application.glide.glide.GlideJob

Class for writing Glide Grid Generation input files. Currently, the receptor input file for a Gridgen job (NOT created by this class) must be named “<jobname>.mae”.

__init__(keywords)

Specify a dictionary of keywords, where the key is the short keyword name and the value is what is should be set to. For indexed keywords, the value needs to be a list. It is also possible to specify a file path to a simplified input file that contains the keywords.

Constraint sites may be set via the following keywords:

HBOND_CONSTRAINTS METAL_CONSTRAINTS POSIT_CONSTRAINTS NOE_CONSTRAINTS METCOORD_CONSTRAINTS METCOORD_SITES

Parameters

keywords (dict or file path) – Either a dictionary of keywords or a simplified input file path.

Raises

RuntimeError – If no job name specified.

setupJson(jsdict)

Additional setup to do before writing a JSON file. Base implementation does nothing. This method is expected not to modify ‘self’, but only jsdict, which is the dictionary of keywords that ultimately will be written to the JSON file.

cleanup()

Free the memory associated with constraings

class schrodinger.application.glide.glide.Dock(keywords, jobtypes=None)

Bases: schrodinger.application.glide.glide.GlideJob

Class for generating Glide docking input files.

__init__(keywords, jobtypes=None)

Specify a dictionary of keywords, where the key is the short keyword name and the value is what is should be set to. For indexed keywords, the value needs to be a list. It is also possible to specify a file path to a simplified input file that contains the keywords.

Parameters

keywords (dict or file path) – Either a dictionary of keywords or a simplified input file path.

setLigRange(start, end)

Shortcut for setting the range of ligands to be read from the LIGANDFILE.

Parameters

end – If zero, means to go to the end of the file.

checkConflicts()

Check for invalid keyword combinations. Raises a ValueError if any are found.

applyContextDependentDefaults()

Apply context-dependent defaults for a Glide job. It modifies the job object, but marks the modified keywords as “default” so they won’t be written by writeSimplified().

setupJson(jsdict)

Additional setup to do before writing a JSON file. Base implementation does nothing. This method is expected not to modify ‘self’, but only jsdict, which is the dictionary of keywords that ultimately will be written to the JSON file.

readConsKeywords()

Reads the constraint keywords, parses their values, and returns them as a tuple of (cons groups, feature sets).

cleanup()

Free up the group handles

addConstraintGroup(cons_labels, nrequired)

Add a new constraint group to this Docking instance.

Parameters
  • cons_labels – A list of labels for constraints to use.

  • nrequired – Minimum number of constraints required for match (Can be ALL).

useConstraint(label)

Adds specified constraint to the first group.

Default group is #1; constraint type determined automatically.

setNRequired(nrequired)

Set the minimum number of constraints required for the first group. A value of ALL means all constraints are required.

schrodinger.application.glide.glide.read_constraints(gridfile)

Reads the receptor constraints from the specified grid file.

The constraints are actually read from the .cons file. The resulting constraint “type” refers to the atom type in the RECEPTOR, where applicable. Specifically, H-bond and metal-binding constraints.

The matching ligand atom for an H-bond donor receptor constraint should be an H-bond acceptor (by default). Likewire the matching ligand ato for and H-bond acceptor receptor constraint should be a donor (polar H atom).

Other constraint types don’t refer to any specific atom type (Positional, NOE), or require the same atom type in the ligand as in the receptor (Hydrophobic) so the constraint type is valid for both molecules (ligand and receptor).

To get the constraint label, simply do str(Constraint).

Parameters

gridfile – The gridfile name; should be either a .grd or .zip file.

Return type

A list of Constraint objects.

schrodinger.application.glide.glide.read_yaml()

Read mmim_keywords.json and return a list of objects. The read_yaml() name was retained for compatibility.

schrodinger.application.glide.glide.read_keywords_file()

Read the mmim_keywords.json file from the mmshare data directory and return a list of objects.

schrodinger.application.glide.glide.read_keywords_file_as_dict()

Read the mmim_keywords.json file from the mmshare data directory and return a dict of dicts, where the key is the keyword name and the value is the spec for the keyword (see get_keyword for more details).

schrodinger.application.glide.glide.get_keyword(keyword)

Return the specification of a Glide keyword as a dictionary, with keys such as “keyword”, “type”, “default”, “allowed”, “min”, “max”, and “comment”. For the full list and description for each field, see the comments in mmim_keywords.yaml.

schrodinger.application.glide.glide.get_keywords_dicts(jobtypes, include_undocumented=False)

Return the raw mmim_keywords.yaml data filtered to include only the keywords for the requested job types.

schrodinger.application.glide.glide.keyword_spec(jobtypes, include_undocumented=False)

Return a string with the specification of the mmim keywords that are valid for the jobtypes given. Jobtypes should be an iterable with items such as ‘docking’, ‘multi_docking’, or ‘gridgen’. Keywords for jobtype ‘all’ are always included.

By default, undocumented keywords are not included in the return value, but that behavior can be overridden by setting ‘include_undocumented’ to True.

schrodinger.application.glide.glide.validation_specs(jobtype)

Return a list of validation specs for a given jobtype (e.g., ‘docking’ or ‘gridgen’) or list of jobtypes. This includes not only the keywords returned by keyword_spec(jobtype), but also some extra keywords that are supported by glide.py but not by mmim.

schrodinger.application.glide.glide.get_keywords_set(jobtypes)

Return the set of all keywords valid for the given job types.

schrodinger.application.glide.glide.is_gridgen_keyword(keyword)

Return True is a keyword is valid for gridgen jobs.

schrodinger.application.glide.glide.is_docking_keyword(keyword)

Return True is a keyword is valid for docking jobs.

schrodinger.application.glide.glide.calc_ligand_size(st, ligand_atom_indices)

Given a list of (x, y, z) coordinates for all atoms in a ligand, calculate the ligand size. This value should be added to the innerbox to get the default outerbox.

Parameters
  • st (structure.Structure) – ligand structure

  • ligand_atom_indices (ligand atoms, by atom index) – list[int]

Return type

float

Returns

The size of the ligand.

schrodinger.application.glide.glide.get_default_box_size(struct, ligand_asl='all')

Gets the default box size for a grid. This returns the outer and inner box lengths.

Parameters
  • struct (structure.StructureReader) – The structure containing the reference ligand

  • ligand_asl (str) – The ASL for the ligand. Default: “all”

Return type

tuple of lists, e.g. ([10, 10, 10], [-5.9863, -1.887 , -0.2703])

schrodinger.application.glide.glide.is_gridgen_job(keywords)

Return True if the keywords suggest that this is a gridgen job.

Return type

bool

schrodinger.application.glide.glide.get_glide_job(input_file)

Return a Gridgen or Dock object given an SIF input filename or keyword dictionary. If it is a filename, use it to set JOBNAME (e.g. for “dir/myjob.in”, set it to “myjob”).

schrodinger.application.glide.glide.is_false(val)
schrodinger.application.glide.glide.is_equivalent_to_mininplace(val)

Checks if val is equivalent to mininplace

schrodinger.application.glide.glide.get_default_docking_keyword_value(keyword)

Return the default value for a docking keyword.