schrodinger.application.bioluminate.protein.protein module

Module to gather residue property data for proteins.

Copyright (c) Schrodinger, LLC. All rights reserved

schrodinger.application.bioluminate.protein.protein.get_residue_asl(residue, ca=False)

Creates an ASL based on a residue’s chain, residue number and inscode. The ASL can optionally only include the alpha carbon of the residue.

Parameters

residue (schrodinger.structure._Residue) – The residue to create an ASL for

Raises

RuntimeError – If the passed in residue is incorrect type

Returns

ASL expression for residue

Return type

str

schrodinger.application.bioluminate.protein.protein.get_residues_asl(residues, ca=False)

Creates an ASL based on a list of residue’s chains, residue numbers and inscodes. The ASL can optionally only include the alpha carbon of the residue.

Parameters

residue (list or tuple of schrodinger.structure._Residue) – The residues to create an ASL for

Raises
  • RuntimeError – If residues are not a list or tuple

  • RuntimeError – If any passed in residues are incorrect type

Returns

ASL expression for all residues

Return type

str

schrodinger.application.bioluminate.protein.protein.valid_asl(st, asl)

Returns True/False depending on whether the asl is a valid expression or not.

schrodinger.application.bioluminate.protein.protein.get_residues_within(st, residues, within=0.0, ca=False)

Returns a list of residues for st that are within within angstroms of each residue. If the ca keyword is True the within calculation will only look for alpha carbon in residues. This means that if within is set to 5.5 angstroms and there is only a single atom that belongs to a residue at that cutoff, the residue that the atom belongs to will be refined.

Parameters
  • st (schrodinger.structure.Structure) – Structure to evaluate and which all residues correspond

  • residues (list or tuple of schrodinger.structure._Residue) – All residues targeted for refinement

  • within (float) – Distance (angstroms) of residues to include in refinement

  • ca (bool) – Use only alpha carbons to find residues within

Returns

List of schrodinger.structure._Residue objects

Return type

list

schrodinger.application.bioluminate.protein.protein.residue_is_polar(residue)

Tests whether a residue is polar

Parameters

residue (structure._Residue) – Residue to test

Return type

bool

schrodinger.application.bioluminate.protein.protein.residue_is_nonpolar(residue)

Tests whether a residue is nonpolar (for SASA)

Parameters

residue (structure._Residue) – Residue to test

Return type

bool

schrodinger.application.bioluminate.protein.protein.atom_is_nonpolar(atom)

Returns true if the atom is considered non-polar. Here are the rules for non-polar atoms:

  • The atom’s element is a C or S

  • The atom’s element is a H and one bonded atom’s element is C or S

class schrodinger.application.bioluminate.protein.protein.PrimeConfig(st_filename, set_defaults=True, **kwargs)

Bases: schrodinger.application.prime.input.Prime

Class containing the methods to write Prime input files. NOTE THAT THIS ALWAYS USES OPLS2005

ALL_RESIDUES = 'all'
__init__(st_filename, set_defaults=True, **kwargs)

Accepts one argument which is either a path or a keyword dictionary.

addResidues(residues=None)

Adds residues to consider for refinement. The passed in argument can take the form of:

prepEnergy()
prepMinimize(residues=None)
prepResidue(residues=None)
prepSidechain(residues=None)
prepSidechainCBeta(residues=None)
prepSidechainBB(residues=None)
prepActive(lig_id, residues=None)
prepLoop(start_res=None, end_res=None, res_sphere=7.5, maxcalpha=None, protocol='LOOP_BLD', loop2=None, max_jobs=0, residues=None)
Parameters
  • start_res (string) – loop start residue, e.g. A:15

  • end_res (string) – loop start residue, e.g. A:20

  • res_sphere (float) – radius of nearby residue refinement

  • maxcalpha (float) – CA atom movement constraint

  • protocol (string) – loop refinement protocol

  • loop2 (list) – the definition of the second loop, e.g. [‘A:4’,’A:6’]

  • residues (None) – Unused, kept for API compatibility

  • max_jobs (int) – how many processes will be run simultaneously

prepAntibodyLoop(start_res=None, end_res=None, cpus=1, residues=None)
prepBldStruct(jobname, dirname)
__contains__(key, /)

True if the dictionary has the specified key, else False.

__len__()

Return len(self).

as_bool(key)

Accepts a key as input. The corresponding value must be a string or the objects (True or 1) or (False or 0). We allow 0 and 1 to retain compatibility with Python 2.2.

If the string is one of True, On, Yes, or 1 it returns True.

If the string is one of False, Off, No, or 0 it returns False.

as_bool is not case sensitive.

Any other input will raise a ValueError.

>>> a = ConfigObj()
>>> a['a'] = 'fish'
>>> a.as_bool('a')
Traceback (most recent call last):
ValueError: Value "fish" is neither True nor False
>>> a['b'] = 'True'
>>> a.as_bool('b')
1
>>> a['b'] = 'off'
>>> a.as_bool('b')
0
as_float(key)

A convenience method which coerces the specified value to a float.

If the value is an invalid literal for float, a ValueError will be raised.

>>> a = ConfigObj()
>>> a['a'] = 'fish'
>>> a.as_float('a')  
Traceback (most recent call last):
ValueError: invalid literal for float(): fish
>>> a['b'] = '1'
>>> a.as_float('b')
1.0
>>> a['b'] = '3.2'
>>> a.as_float('b')  
3.2...
as_int(key)

A convenience method which coerces the specified value to an integer.

If the value is an invalid literal for int, a ValueError will be raised.

>>> a = ConfigObj()
>>> a['a'] = 'fish'
>>> a.as_int('a')
Traceback (most recent call last):
ValueError: invalid literal for int() with base 10: 'fish'
>>> a['b'] = '1'
>>> a.as_int('b')
1
>>> a['b'] = '3.2'
>>> a.as_int('b')
Traceback (most recent call last):
ValueError: invalid literal for int() with base 10: '3.2'
as_list(key)

A convenience method which fetches the specified value, guaranteeing that it is a list.

>>> a = ConfigObj()
>>> a['a'] = 1
>>> a.as_list('a')
[1]
>>> a['a'] = (1,)
>>> a.as_list('a')
[1]
>>> a['a'] = [1]
>>> a.as_list('a')
[1]
clear()

A version of clear that also affects scalars/sections Also clears comments and configspec.

Leaves other attributes alone :

depth/main/parent are not affected

copy() a shallow copy of D
dict()

Return a deepcopy of self as a dictionary.

All members that are Section instances are recursively turned to ordinary dictionaries - by calling their dict method.

>>> n = a.dict()
>>> n == a
1
>>> n is a
0
fromkeys(value=None, /)

Create a new dictionary with keys from iterable and values set to value.

get(key, default=None)

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

getSpecsString()

Return a string of specifications. One keywords per line. Raises ValueError if this class has no specifications.

items() list of D’s (key, value) pairs, as 2-tuples
iteritems() an iterator over the (key, value) items of D
iterkeys() an iterator over the keys of D
itervalues() an iterator over the values of D
keys() list of D’s keys
merge(indict)

A recursive update - useful for merging config files.

>>> a = '''[section1]
...     option1 = True
...     [[subsection]]
...     more_options = False
...     # end of file'''.splitlines()
>>> b = '''# File is user.ini
...     [section1]
...     option1 = False
...     # end of file'''.splitlines()
>>> c1 = ConfigObj(b)
>>> c2 = ConfigObj(a)
>>> c2.merge(c1)
>>> c2
ConfigObj({'section1': {'option1': 'False', 'subsection': {'more_options': 'False'}}})
pop(key, default=<object object>)

‘D.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised’

popitem()

Pops the first (key,val)

printout()

Print all keywords of this instance to stdout.

This method is meant for debugging purposes.

reload()

Reload a ConfigObj from file.

This method raises a ReloadError if the ConfigObj doesn’t have a filename attribute pointing to a file.

rename(oldkey, newkey)

Change a keyname to another, without changing position in sequence.

Implemented so that transformations can be made on keys, as well as on values. (used by encode and decode)

Also renames comments.

reset()

Clear ConfigObj instance and restore to ‘freshly created’ state.

restore_default(key)

Restore (and return) default value for the specified key.

This method will only work for a ConfigObj that was created with a configspec and has been validated.

If there is no default value for this key, KeyError is raised.

restore_defaults()

Recursively restore default values to all members that have them.

This method will only work for a ConfigObj that was created with a configspec and has been validated.

It doesn’t delete or modify entries without default values.

setdefault(key, default=None)

A version of setdefault that sets sequence if appropriate.

update(indict)

A version of update that uses our __setitem__.

validate(validator, preserve_errors=False, copy=False, section=None)

Test the ConfigObj against a configspec.

It uses the validator object from validate.py.

To run validate on the current ConfigObj, call:

test = config.validate(validator)

(Normally having previously passed in the configspec when the ConfigObj was created - you can dynamically assign a dictionary of checks to the configspec attribute of a section though).

It returns True if everything passes, or a dictionary of pass/fails (True/False). If every member of a subsection passes, it will just have the value True. (It also returns False if all members fail).

In addition, it converts the values from strings to their native types if their checks pass (and stringify is set).

If preserve_errors is True (False is default) then instead of a marking a fail with a False, it will preserve the actual exception object. This can contain info about the reason for failure. For example the VdtValueTooSmallError indicates that the value supplied was too small. If a value (or section) is missing it will still be marked as False.

You must have the validate module to use preserve_errors=True.

You can then use the flatten_errors function to turn your nested results dictionary into a flattened list of failures - useful for displaying meaningful error messages.

validateValues(preserve_errors=True, copy=True)

Validate the values read in from the InputConfig file.

Provide values for keywords with validators that have default values.

If a validator for a keyword is specified without a default and the keyword is missing from the input file, a RuntimeError will be raised.

Parameters
  • preserve_errors (bool) –

    If set to False, this method returns True if

    all tests passed, and False if there is a failure. If set to True, then instead of getting False for failed checkes, the actual detailed errors are printed for any validation errors encountered.

    Even if preserve_errors is True, missing keys or sections will still be represented by a False in the results dictionary.

  • copy (bool) – If False, default values (as specified in the ‘specs’ strings in the constructor) will not be copied to object’s “defaults” list, which will cause them to not be written out when writeInputFile() method is called. If True, then all keywords with a default will be written out to the file via the writeInputFile() method. NOTE: Default is True, while in ConfigObj default is False.

values() list of D’s values
walk(function, raise_errors=True, call_on_sections=False, **keywargs)

Walk every member and call a function on the keyword and value.

Return a dictionary of the return values

If the function raises an exception, raise the errror unless raise_errors=False, in which case set the return value to False.

Any unrecognised keyword arguments you pass to walk, will be pased on to the function you pass in.

Note: if call_on_sections is True then - on encountering a subsection, first the function is called for the whole subsection, and then recurses into it’s members. This means your function must be able to handle strings, dictionaries and lists. This allows you to change the key of subsections as well as for ordinary members. The return value when called on the whole subsection has to be discarded.

See the encode and decode methods for examples, including functions.

caution

You can use walk to transform the names of members of a section but you mustn’t add or delete members.

>>> config = '''[XXXXsection]
... XXXXkey = XXXXvalue'''.splitlines()
>>> cfg = ConfigObj(config)
>>> cfg
ConfigObj({'XXXXsection': {'XXXXkey': 'XXXXvalue'}})
>>> def transform(section, key):
...     val = section[key]
...     newkey = key.replace('XXXX', 'CLIENT1')
...     section.rename(key, newkey)
...     if isinstance(val, (tuple, list, dict)):
...         pass
...     else:
...         val = val.replace('XXXX', 'CLIENT1')
...         section[newkey] = val
>>> cfg.walk(transform, call_on_sections=True)
{'CLIENT1section': {'CLIENT1key': None}}
>>> cfg
ConfigObj({'CLIENT1section': {'CLIENT1key': 'CLIENT1value'}})
write(filename)

Writes a simplified input file to filename.

This input file needs to be run via $SCHRODINGER/prime.

writeInputFile(filename, ignore_none=False, yesno=False, smartsort=False)

Write the configuration to a file in the InputConfig format.

Parameters
  • filename (a file path or an open file handle) – The file to write the configuration to.

  • ignore_none (bool) – If True, keywords with a value of None will not be written to the input file.

  • yesno (bool) – If True, boolean keywords will be written as “yes” and “no”, if False, as “True” and “False”.

  • smartsort (bool) – If True, keywords that are identical except for the numbers at the end will be sorted such that “2” will go before “10”.

class schrodinger.application.bioluminate.protein.protein.PrimeStructure(jobname)

Bases: object

__init__(jobname)
createTemplateFile(template_seq, filename=None)

Writes a template PDB file as .ent

createAlignFile(reference_seq, template_seq, filename=None)

Writes an alignment file for the template. If no filename is supplied the file will be named <jobname>.aln.

Parameters
  • reference_seq (sequence) – The reference sequence

  • template_seq (sequence) – The template sequence

exception schrodinger.application.bioluminate.protein.protein.PropkaError

Bases: Exception

A custom exception for any propka failures

__init__(*args, **kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class schrodinger.application.bioluminate.protein.protein.OrderedResidueDict(residues, default_value=None)

Bases: collections.OrderedDict

Creates an ordered dictionary for residues in a structure

__init__(residues, default_value=None)
__contains__(key, /)

True if the dictionary has the specified key, else False.

__len__()

Return len(self).

clear() None.  Remove all items from od.
copy() a shallow copy of od
fromkeys(value=None)

Create a new ordered dictionary with keys from iterable and values set to value.

get(key, default=None, /)

Return the value for key if key is in the dictionary, else default.

items() a set-like object providing a view on D’s items
keys() a set-like object providing a view on D’s keys
move_to_end(key, last=True)

Move an existing element to the end (or beginning if last is false).

Raise KeyError if the element does not exist.

pop(k[, d]) v, remove specified key and return the corresponding

value. If key is not found, d is returned if given, otherwise KeyError is raised.

popitem(last=True)

Remove and return a (key, value) pair from the dictionary.

Pairs are returned in LIFO order if last is true or FIFO order if false.

setdefault(key, default=None)

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

update([E, ]**F) None.  Update D from dict/iterable E and F.

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values() an object providing a view on D’s values
class schrodinger.application.bioluminate.protein.protein.PropertyCalculator(struct, jobname, cleanup=True, nbcutoff=14.0, residues=None, lig_asl=None)

Bases: object

Class for calculating properties of proteins and protein residues.

Here is an example of how to calculate properties for a protein:

from schrodinger import structure
from schrodinger.application.bioluminate import protein

# Get the input structure
st = structure.Structure.read('receptor.maegz')

# Define the properties to calculate
calculations = [ 'e_pot', 'e_internal', 'e_interaction', 'prime_energy',
                 'pka', 'sasa_polar', 'sasa_nonpolar', 'sasa_total']

# Create the calculator
calculator = protein.PropertyCalculator(st, "my_calculator_jobname")

# Calculate the properties
properties = calculator.calculate(*calculations)

In the example above the properties output would look something like this:

properties = {
    'e_pot'         : 1573.4,
    'e_internal'    : 624.7,
    'e_interaction' : 994.8,
    'prime_energy'  : 744.2,
    'pka'           : 124.1,
    'sasa_polar',   : 3122.3,
    'sasa_nonpolar' : 271.1,
    'sasa_total'    : 3393.4
}
AGGREGATE_CALCULATIONS = ['e_pot', 'prime_energy', 'pka', 'sasa_polar', 'sasa_nonpolar', 'sasa_total', 'hydropathy', 'rotatable', 'vdw_surf_comp']
RESIDUE_CALCULATIONS = ['e_pot', 'e_internal', 'e_interaction', 'pka', 'sasa_polar', 'sasa_nonpolar', 'sasa_total', 'hydropathy', 'rotatable', 'vdw_surf_comp']
__init__(struct, jobname, cleanup=True, nbcutoff=14.0, residues=None, lig_asl=None)

Construct a ProteinCalculator class from a structure file and a jobname.

Parameters
  • struct (schrodinger.structure.Structure object) – The protein structure or protein/ligand structures

  • jobname – The jobname that will be used for all calculations that require output files.

  • residues (Iterable of schrodinger.structure._Residue objects.) – An iterable of _Residue objects to analyze. If not specified, all residues in the structure are considered.

  • lig_asl (str) – The ASL for the ligand substructure. Used for calculating the vdW surface complementarity.

progress

Variable that can be used to get the progress of calculations. This variable is only set in self.calculateOverResidues. Since that method returns a generator, each step can query self.progress to get a description of the progress. This variable is a tuple with the form ( step, total steps ).

property minimizer

The minimizer used in energy calculations.

runpKa()

Runs PROPKA to get the pKa of all residues in the self.struct, then sets self.pka_data.

getResiduepKa(residue)

Returns the pKa for specified residue

Parameters

residue (structure._Residue) – Residue to get internal energy for

Return type

float

getTotalpKa()

Gets the sum of the pKa values for the protein.

Return type

float

setpKaData(summary, renum_map=None)

Compares residues from the PROPKA summary with the residues in self.residues and when matches are found the summary’s pKa is set for that residue in self.pka_data

getTotalPrimeEnergy()

Run Prime Minimization on self.struct. This will launch a job using job control. After the job completes the total energy will be taken from the first CT using the “r_psp_Prime_Energy” property.

Returns

Prime energy of protein

Return type

float

getPrimeEnergyByResidues(residues)

Run Prime Minimization on self.struct only minimizing the residues in residues. This will launch a job using job control. After the job completes the total energy will be taken from the first CT using the “r_psp_Prime_Energy” property.

Parameters

residues (list of residues) – Residues to minimize

Returns

Prime energy of protein

Return type

float

getResiduePotentialEnergy(residue)

Return the potential energy for a residue.

Parameters

residue (structure._Residue) – Residue to get potential energy for

Return type

float

getPotentialEnergyGenerator()

Return a generator that iterates over each residue in self.struct yielding the schrodinger.structure._Residue object and it’s potential energy.

Return type

generator

See

schrodinger.structutils.minimize.Minimizer.getSelfEnergy

See

schrodinger.structutils.minimize.Minimizer.getInteractionEnergy

getTotalPotentialEnergy()

Get the potential energy of self.struct which is calculated using schrodinger.structutils.minimize.Minimizer. The potential energy is the sum of the internal energies and the interaction energies.

Returns

Total potential energy of all the residues

Return type

float

See

schrodinger.structutils.minimize.Minimizer.getSelfEnergy

See

schrodinger.structutils.minimize.Minimizer.getInteractionEnergy

getResidueInternalEnergy(residue)

Return the residue’s internal energy.

Parameters

residue (structure._Residue) – Residue to get internal energy for

Return type

float

See

schrodinger.structutils.minimize.Minimizer.getSelfEnergy

getInternalEnergyGenerator()

Return a generator that iterates over each residue in self.struct. This yields the schrodinger.structure._Residue object and it’s internal energy.

Return type

generator

See

schrodinger.structutils.minimize.Minimizer.getSelfEnergy

getResidueInteractionEnergy(residue)

Return the residue’s interaction energy.

Parameters

residue (structure._Residue) – Residue to get interaction energy for

Return type

float

See

schrodinger.structutils.minimize.Minimizer.getInteractionEnergy

getInteractionEnergyGenerator()

Return a generator that iterates over each residue in self.struct. This yields the schrodinger.structure._Residue object and it’s interaction energy.

Return type

generator

See

schrodinger.structutils.minimize.Minimizer.getInteractionEnergy

getResidueAtomicPolarSASA(residue, sidechain=False)

Returns SASA for all polar atoms in residue

Parameters
  • residue (structure._Residue) – Residue to get atomic polar SASA contribution for

  • sidechain (bool) – Only consider sidechain atoms when calculating SASA

Return type

float

getAtomicPolarSASAGenerator(sidechain=False)

Returns a generator that yields the schrodinger.structure._Residue object and its calculated SASA for only the polar atoms in each residue in self.struct.

Parameters

sidechain (bool) – Only consider sidechain atoms when calculating SASA

Return type

generator

getResidueAtomicNonPolarSASA(residue, sidechain=False)

Returns SASA for only the nonpolar atoms in residue

Parameters
  • residue (structure._Residue) – Residue to get atomic nonpolar SASA contribution for

  • sidechain (bool) – Only consider sidechain atoms when calculating SASA

Return type

float

getAtomicNonPolarSASAGenerator(sidechain=False)

Returns a generator that yields the schrodinger.structure._Residue object and its calculated SASA for only the nonpolar atoms in each residue in self.struct.

Parameters

sidechain (bool) – Only consider sidechain atoms when calculating SASA

Return type

generator

getResidueSASA(residue, sidechain=False)

Returns the SASA for residue.

Parameters
  • residue (structure._Residue) – Residue to get SASA for

  • sidechain (bool) – Only consider sidechain atoms when calculating SASA

Return type

float

getSASAPolarGenerator(sidechain=False)

Returns a generator that yields the schrodinger.structure._Residue object and its calculated SASA for each polar residue in self.struct.

Parameters

sidechain (bool) – Only consider sidechain atoms when calculating SASA

Return type

generator

getTotalSASAPolar(sidechain=False)

Returns the total approximate solvent accessible surface area for all polar residues.

Parameters

sidechain (bool) – Only consider sidechain atoms when calculating SASA

Return type

float

getSASANonPolarGenerator(sidechain=False)

Returns a generator that yields the schrodinger.structure._Residue object and its calculated SASA for each nonpolar residue in self.struct.

Parameters

sidechain (bool) – Only consider sidechain atoms when calculating SASA

Return type

generator

getTotalSASANonPolar(sidechain=False)

Returns the total approximate solvent accessible surface area for all non-polar residues.

Parameters

sidechain (bool) – Only consider sidechain atoms when calculating SASA

Return type

float

getSASAGenerator(sidechain=False)

Returns a generator that yields the schrodinger.structure._Residue object and its calculated SASA for each residue in self.struct.

Parameters

sidechain (bool) – Only consider sidechain atoms when calculating SASA

Return type

generator

getTotalSASA(sidechain=False)

Returns the total approximate solvent accessible surface area for all residues.

Parameters

sidechain (bool) – Only consider sidechain atoms when calculating SASA

Return type

float

getResidueHydropathy(residue, sidechain=False)

Returns hydropathy value for residue

Parameters
  • residue (structure._Residue) – Residue to get hydropathy value for

  • sidechain (bool) – Only consider sidechain atoms when calculating SASA

Return type

float

getHydropathyGenerator(sidechain=False)

Returns a generator that yields the schrodinger.structure._Residue object and its calculated hydropathy for each residue in self.struct.

Parameters

sidechain (bool) – Only consider sidechain atoms when calculating SASA

Return type

generator

getTotalHydropathy(sidechain=False)

Returns the total calculated hydropathy value for all residues.

Parameters

sidechain (bool) – Only consider sidechain atoms when calculating SASA

Return type

float

getResidueRotatableBonds(residue)

Return the number of rotors for a residue.

Parameters

residue (structure._Residue) – Residue to get rotor count for

Return type

int

getRotatableBondsGenerator()

Returns a generator that yields the schrodinger.structure._Residue object and its number of rotors for each residue in self.struct.

Return type

generator

getTotalRotatableBonds()
Returns

Sum of rotors for all residues.

Return type

float

getTotalSurfComp()
Returns

Median of vdW surface complementarity values for all surface points for all residues.

Return type

float

getResidueSurfComp(residue)
Returns

Median of vdW surface complementarity values for all accounted points on the surface of this residue.

Return type

float

Parameters

residue (structure._Residue) – Residue to get the value for

calculateOverResidues(*properties)

Helper method that returns a generator which will calculate multiple properties for self.struct. All results will be returned in a tuple with the form ( structure._Residue, calc dict ). Here is a list of valid properties to calculate:

  • e_pot

  • e_internal

  • e_interaction

  • pka

  • sasa_polar

  • sasa_nonpolar

  • sasa_total

  • hydropathy

  • rotatable

  • vdw_surf_comp

Parameters

properties (str (see PropertyCalculator.RESIDUE_CALCULATIONS)) – Properties to calculate

Raises

KeyError – If a property passed in is invalid

Returns

Generator that yields structure._Residue and dict where keys are properties passed in and values are the total value of the property for the protein. e.g (_Residue, {‘e_pot’:1324.3})

Return type

generator

calculate(*properties)

Helper method to calculate multiple properties for self.struct. All results will be returned in a dict where the keys are each of the properties in properties, and their values are the values returned from their corresponding method. Here is a list of valid properties to calculate:

  • e_pot

  • sasa_polar

  • sasa_nonpolar

  • sasa_total

  • prime_energy

  • pka

  • hydropathy

  • rotatable

  • vdw_surf_comp

Parameters

properties (str (see PropertyCalculator.AGGREGATE_CALCULATIONS)) – Properties to calculate

Raises

KeyError – If a property passed in is invalid

Returns

Dict where keys are properties passed in and values are the total value of the property for the protein. e.g {‘e_pot’: 1324.3, ‘sasa_total’: 1846.9}

Return type

dict

getTotalAggregation()
getTotalSolubility()
getTotalComplementarity()
class schrodinger.application.bioluminate.protein.protein.Refiner(struct, residues=None)

Bases: object

Creates input files and runs calculations for protein refinement jobs using Prime and our schrodinger.structutils.minimize.Minimizer class.

Here is an example of how to refine a protein that just had a residue mutated. In this example only the residues within 7.0 angstroms of the mutated residue will be refined:

from schrodinger.structure import StructureReader
from schrodinger.structutils import build
from schrodinger.application.bioluminate import protein

# Get the structure
st = StructureReader('receptor.maegz')

# Atom number 30 is the alpha carbon of a GLU
ca = st.atom[30]

# Mutate GLU -> ASP
renum_map = build.mutate(st, ca.index, "ASP")

# Get the residue that was mutated
mutated_residue = None
for res in st.residue:
    ca_keys  = (ca.chain,  ca.resnum,  ca.inscode)
    res_keys = (res.chain, res.resnum, res.inscode)
    if ca_keys == res_keys:
        mutated_residue = res
        break

# We want to use the reference to gather the residues to refine
refine_residues = protein.get_residues_within(
    st,
    [mutated_residue],
    within = 7.0
)

# Create the refiner
refiner = protein.Refiner(st, residues=refine_residues)

# Run Prime minimization which returns the refined structure
refined_struct = refiner.runPrimeMinimization('my_refinement_jobname')
PYTHON_MINIMIZE = 'python_minimize'
PRIME_MINIMIZE = 'prime_minimize'
PRIME_RESIDUE = 'prime_residue'
PRIME_SIDECHAIN = 'prime_sidechain'
PRIME_SIDECHAIN_CBETA = 'prime_sidechain_cbeta'
PRIME_SIDECHAIN_BB = 'prime_sidechain_bb'
PRIME_LOOP_PRED = 'prime_loop_prediction'
PRIME_ANTIB_LOOP_PRED = 'prime_antibody_loop_prediction'
__init__(struct, residues=None)
Parameters
  • struct (schrodinger.structure.Structure) – The structure being refined

  • residues (None or list/tuple of structure.structure._Residue) – Residues to consider for refinement

setResidues(residues)

Set the residues to refine. This is a list of integers refering to the residue indices for the structure.

clean()

Remove all files created from the refinement job

writePrimeInput(refine_type, input_file, st_filename, **kwargs)

Writes the input file for a Prime refinement job.

Parameters
  • refine_type (str) – The type of Prime refinement to run (see class variables)

  • input_file (str) – Name of the input file for the refinement job

  • st_filename (str) – Filename of the structure to be refined

Raises

RuntimeError – If refine_type is not supported

Return type

None

refinePrime(refine_type, jobname, completed_callback=None, **kwargs)

Run a Prime refinement job through job control and return the refined output structure.

Parameters
  • refine_type (str) – The type of Prime refinement to run (see class variables)

  • jobname (str) – Jobname to use

  • completed_callback (callable) – Whether to start the job and wait, or call given function with Job object is parameter on completion.

Raises
  • RuntimeError – If refine_type is not supported

  • RuntimeError – If launching the refinement job fails

  • RuntimeError – If the refinement job fails

Returns

Refined structure

Return type

schrodinger.structure.Structure object or schrodinger.job.jobcontrol.Job

runPrimeMinimization(jobname)

Shortcut to run a Prime minimization job

See

Refiner.refinePrime documentation

runPrimeResidue(jobname)

Shortcut to run a Prime residue refinement job

See

Refiner.refinePrime documentation

runPrimeSidechain(jobname)

Shortcut to run a Prime sidechain refinement job

See

Refiner.refinePrime documentation

runPrimeSidechainCBeta(jobname)

Shortcut to run a Prime sidechain refinement job with CA-CB vector sampling. This will vary the orientation of the CA-CB bond by up to 30 degrees from the initial direction.

See

Refiner.refinePrime documentation

runPrimeSidechainBB(jobname)

Shortcut to run a Prime sidechain refinement job with backbone sampling. This will sample the backbone by running a loop prediction on a set of 3 residues centered on the residue for which the side chain is being refined.

See

Refiner.refinePrime documentation

runPrimeLoopPrediction(jobname, start_res=None, end_res=None)

Shortcut to run a Prime loop prediction refinement job..

See

Refiner.refinePrime documentation

runPythonMinimize(jobname)

Shortcut to run a schrodinger.structutils.minimize.Minimizer job.

Parameters

jobname (str) – Jobname to use

Returns

Minimized structure

Return type

schrodinger.structure.Structure object

runRefinement(refine_type, jobname, **kwargs)

Shortcut to run any of the available refinement jobs.

Parameters
  • refine_type (str) – The type of Prime refinement to run (see class variables)

  • jobname (str) – Jobname to use

Raises
  • RuntimeError – If refine_type is not supported

  • RuntimeError – If the refinement job fails

Returns

Refined structure

Return type

schrodinger.structure.Structure object

class schrodinger.application.bioluminate.protein.protein.Consensus(asl_map, minimum_number, dist_cutoff=2.0)

Bases: object

Access the atoms, residues, and molecules (or just their indices) that are considered to be consensus objects for a template structure and query structure. All properties are returned as an OrderedDict that maps the template objects to their consensus objects from the query structure.

Here is an example of how to get all the consensus waters between two protein structures. We define the cutoff here at 2 Angstroms:

from schrodinger.structure import StructureReader
from schrodinger.application.bioluminate import protein

pt = maestro.project_table_get()

# Create an ASL map for all ligands in the WS
asl_map = []
for row in pt.included_rows:
    st = row.getStructure()
    ligands = analyze.find_ligands(st)
    if not ligands:
        continue
    indices = []
    for ligand in ligands:
        indices.extend([str(i) for i in ligand.atom_indexes])

    asl = 'atom.n %s' % ','.join(indices)

    asl_map.append((st, asl))

# Create a consensus of all ligands, specifying that at least three
# structures must have a ligand atom within 2A from one another.
consensus = protein.Consensus(asl_map, 3, dist_cutoff=2)

# To get the atom objects
consensus_atoms = consensus.atoms

# To get the molecule objects
molecules = consensus.molecules
ASL_WATER = 'water and NOT (atom.ele H)'
ASL_WATER_NOZOB = 'water and NOT (atom.ele H) and NOT (withinbonds 1 (not water))'
ASL_IONS = 'ions'
ASL_LIGAND = '(((m.atoms 5-130)) and not ((ions) or (res.pt ACE ACT ACY BCT BME BOG CAC CIT CO3 DMS EDO EGL EPE FES FMT FS3 FS4 GOL HEC HED HEM IOD IPA MES MO6 MPD MYR NAG NCO NH2 NH3 NO3 PG4 PO4 POP SEO SO4 SPD SPM SUC SUL TRS )))'
__init__(asl_map, minimum_number, dist_cutoff=2.0)
Parameters
  • asl_map (tuple of (structure, ASL)) – List of structures and the ASL used to limit the atoms used when calculating the consensus

  • minimum_number (int) – The minimum number of matches within structures. An atom will be considered a “consensus” atom if it is within the dist_cutoff of at least minimum_number of structures in the list of passed in structures.

  • dist_cutoff (float) – Distance in Angstroms used to define a consensus match

Attention

The list of consensus atoms (or molecules, residues, indices, etc. depending on the property called, i.e. self.molecules) will all be unique and will depend on the ASL passed in. If the ASL is not specific enough you may end up with poor results.

getClosest(ref_atom, mob_atoms)

Gets the closest atom to the ref_atom from mob_atoms.

property atoms

Get the map of atom objects of consensus atoms.

Returns

Atoms of consensus atoms

Return type

OrderedDict of atom objects where the keys are the template atoms and their values are the consensus atoms from the query.

property atom_indices

Get the map of atom indices of consensus atoms.

Returns

Atom indices of consensus atoms

Return type

OrderedDict of ints where the keys are the template atom indices and their values are the consensus atom indices from the query.

property residues

Get the list of residue objects of consensus atoms for each structure in self.asl_map.

Returns

Residues of consensus atoms

Return type

list of unique consensus residue objects for each structure in self.asl_map. (Order is maintained)

property residue_indices

Get the map of residue indices of consensus atoms.

Returns

Residue indices of consensus atoms

Return type

list of unique consensus residue indices for each structure in self.asl_map. (Order is maintained)

property molecules

Get the map of molecule objects of consensus atoms.

Returns

Molecules of consensus atoms

Return type

list of unique consensus molecule objects for each structure in self.asl_map. (Order is maintained)

property molecule_indices

Get the map of molecule indices of consensus atoms.

Returns

Molecule indices of consensus atoms

Return type

list of unique consensus molecule indices for each structure in self.asl_map. (Order is maintained)