schrodinger.application.glide.job module

Classes for representing Glide gridgen or docking jobs as dict-like objects and for reading and writing Glide input files. The keyword combinations are checked to ensure that values have the expected types and ranges, and that mutually incompatible keywords are not used.

The two job classes provided by this module are Gridgen and Dock, but the most general way of instantiating them is via the get_glide_job() factory function, which determines the job type automatically.

Usage example:

glide_job = get_glide_job({
    'GRIDFILE': 'grid.zip',
    'LIGANDFILE': 'ligs.mae',
})
glide_job.writeSimplified('dock.in')

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.job.GlideJob(jobtype=None, specs=None, keywords=None, createhandle=False)

Bases: 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.

Parameters:

filename – either a filename or a file-like object

asSIF() str

Return the SIF representation of the job (the same that writeSimplified() would write to a file.)

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.

resolvePaths()

Update the values of keywords containing filenames to their runtime values.

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.job.Gridgen(keywords)

Bases: 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.job.Dock(keywords, jobtypes=None)

Bases: 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).

removeConsKeywords() bool

Delete the sections related to receptor-based constraints (CONSTRAINT_GROUP:<n> and FEATURE:<n>).

Returns:

True if any keywords were deleted.

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.job.is_false(val)
schrodinger.application.glide.job.is_equivalent_to_mininplace(val)

Checks if val is equivalent to mininplace

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

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

Return type:

bool

Raises:

ValueError if both docking-only and gridgen-only keywords are present in the supplied keywords.

schrodinger.application.glide.job.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.job.get_default_docking_keyword_value(keyword)

Return the default value for a docking keyword.