schrodinger.protein.assignment module

Module for optimizing hydroxyl, thiol and water orientiations, Chi-flips of asparagine, glutamine and histidine, and protonation states of aspartic acid, glutamic acid, and histidine.

Usage: ProtAssign(st)

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.protein.assignment.get_annotated_atom(residue)[source]

Returns annotated atom of residue _StructureAtom or None

schrodinger.protein.assignment.get_annotated_atom_property(residue)[source]

Returns property dict of annotated atom or an empty dict if atom is not present

schrodinger.protein.assignment.get_pka(residue)[source]

Return predicted pKa of residue

schrodinger.protein.assignment.set_pka(residue, pka)[source]

Set predicted pKa of residue

schrodinger.protein.assignment.shift_pka(residue, amount)[source]

Shift the predicted pKa of residue

schrodinger.protein.assignment.get_interaction_label(label, suffix)[source]

Create property label for a given interaction.

schrodinger.protein.assignment.set_interaction_label(residue, label, suffix=None)[source]

Set a label of the annoted atom of residue to True

schrodinger.protein.assignment.has_interaction_label(residue, label, suffix=None)[source]

Check if the annotated atom of the residue has a label

schrodinger.protein.assignment.residue_to_label(residue_or_atom)[source]

Create string from residue or atom.

schrodinger.protein.assignment.log_interaction(residue1, residue2, name, distance=None, angle=None)[source]

Log the interaction between two residues and its distance and angle optionally

schrodinger.protein.assignment.get_bulk_solvent_accessible_atoms(st, radius=2.5, radius2=3.0, spacing=0.5, include_water=False)[source]

Return bulk solvent accessible atoms.

Bulk solvent accessible atoms are determined by creating a grid and setting occupied voxels to 1 using a fixed radius for each atom and then checking if any non-occupied voxels are present within a slightly larger radius.

Parameters
  • st (Structure) – Structure to determine bulk solvent accessible atoms. The atom property BULK_SOLVENT_ACCESSIBLE_PROPERTY will be set for each atom.

  • radius (float) – Initial radius

  • radius2 (float) –

  • spacing (float) – Spacing of grid. Lower spacing makes the calculation more accurate but requires more compute time and memory.

  • include_water (bool) – Whether to keep waters or not when calculating bulk solvent accessible atoms.

Returns

List of atom indices that are bulk solvent accessible

Return type

List[int]

schrodinger.protein.assignment.get_unsatisfied_donors(st, include_bsa=True)[source]

Return unsatisfied buried donors

Parameters
  • st (Structure) – Structure to analyze

  • include_bsa (bool) – Include bulk solvent accessible atoms

Returns

List of unsatisfied donor atoms

Return type

List[_StructureAtom]

schrodinger.protein.assignment.get_carboxyl_atoms(residue)[source]

Get carboxyl atom groups from residue. Returns multiple groups if multiple are present. The first atom will be the carbon. It specifically adds Glu and Asp even if they are protonated and uses a SMARTS pattern otherwise to extract the carboxyl group.

Parameters

residue (_Residue) – Residue to check

Returns

List of carboxyl atoms

Return type

List[List[_StructureAtom]]

schrodinger.protein.assignment.get_residue_neighborhoods(st, residues, distance_cell)[source]
schrodinger.protein.assignment.protonate_histidine(histidine)[source]
schrodinger.protein.assignment.charge_arginine_sidechains(st)[source]

Make arginine sidechains charged. Assumes bond orders have been assigned correctly.

Looks for the nitrogen that has a double bond to the CZ atom, and changes the formal charge to 1 and retypes atom.

class schrodinger.protein.assignment.HistidinepKaPredictor[source]

Bases: object

Empirical histidine pKa predictor

INTERNAL_PKA = 6.5
METAL_PKA_SHIFT = -4.0
STATIC_DONOR_PKA_SHIFT = -3.0
FORCED_ACCEPTOR_PKA_SHIFT = -3.0
PI_CATION_PKA_SHIFT = -1.0
PI_PI_PKA_SHIFT = 1.0
CARBOXYLIC_ACID_PKA_SHIFT = 1.0
DOUBLE_SIDED_HBOND_PKA_SHIFT = 1.0
MAX_STATIC_DONOR_INTERACTION_DISTANCE = 3.0
MIN_STATIC_DONOR_INTERACTION_ANGLE = 120
MAX_STATIC_ACCEPTOR_INTERACTION_DISTANCE = 2.5
MIN_STATIC_ACCEPTOR_INTERACTION_ANGLE = 120
MAX_METAL_INTERACTION_DISTANCE = 3.5
MAX_PI_PI_INTERACTION_DISTANCE = 4.5
MAX_PI_PI_INTERACTION_ANGLE = 30
MAX_PI_CATION_INTERACTION_DISTANCE = 4.5
MAX_PI_CATION_INTERACTION_ANGLE = 30
MAX_PI_ARG_INTERACTION_DISTANCE = 5.5
MAX_CARBOXYLIC_ACID_INTERACTION_DISTANCE = 3.8
MIN_CARBOXYLIC_ACID_INTERACTION_ANGLE = 140
NITROGEN_PDBNAMES = {' ND1', ' NE2'}
CARBON_PDBNAMES = {' CD2', ' CE1'}
SIDECHAINS_PDBNAMES = {' CD2', ' CE1', ' CG ', ' ND1', ' NE2'}
predict(st, protassign=None, flip=False)[source]

Predict histidine pKa with empirical rules. Currently this requires the structure being annotated by ProtAssign.

Parameters

Returns None but annotates ANNOTATED_ATOM of each histidine with found interactions and predicted pKa

metal_interactions()[source]
cation_pi_interactions()[source]
arginine_interactions()[source]
pi_pi_interactions()[source]

Check if histidine is involved in pi-pi interaction

carboxyl_interactions()[source]

Check if histidine is interacting with a carboxyl group.

static_donor_interactions()[source]

Check if histidine is interacting with a static donor

identify_forced_amide_states()[source]

Identify amide residues that are forced in a state due to them interacting with a static donor. This is done in a single pass and not iteratively.

static_acceptor_interactions()[source]

Check if histidine is interacting with a static acceptor

class schrodinger.protein.assignment.AsparticAcidpKaPredictor[source]

Bases: schrodinger.protein.assignment._CarboxylicAcidpKaPredictor

Aspartic acid emperical pKa predictor

INTERNAL_PKA = 3.4
PDBRES_NAMES = {'ASH ', 'ASP '}
CARBON_PDBNAME = ' CG '
OXYGEN_PDBNAMES = [' OD1', ' OD2']
SIDECHAIN_PDBNAMES = [' OD1', ' OD2', ' CG ']
CARBOXYLIC_ACID_PKA_SHIFT = 4.0
MAX_CARBOXYLIC_ACID_INTERACTION_DISTANCE = 3.8
MAX_METAL_INTERACTION_DISTANCE = 3.5
MAX_STATIC_ACCEPTOR_INTERACTION_DISTANCE = 3.5
METAL_PKA_SHIFT = -3.0
MIN_CARBOXYLIC_ACID_INTERACTION_ANGLE = 150
MIN_STATIC_ACCEPTOR_INTERACTION_ANGLE = 150
STATIC_ACCEPTOR_PKA_SHIFT = 4.0
carboxyl_interactions()

Check if histidine is interacting with a carboxyl group.

metal_interactions()
predict(st)
static_acceptor_interactions()

Check if histidine is interacting with a static acceptor

class schrodinger.protein.assignment.GlutamicAcidpKaPredictor[source]

Bases: schrodinger.protein.assignment._CarboxylicAcidpKaPredictor

Glutamic acid emperical pKa predictor

INTERNAL_PKA = 4.2
PDBRES_NAMES = {'GLH ', 'GLU '}
CARBON_PDBNAME = ' CD '
OXYGEN_PDBNAMES = [' OE1', ' OE2']
SIDECHAIN_PDBNAMES = [' OE1', ' OE2', ' CD ']
CARBOXYLIC_ACID_PKA_SHIFT = 4.0
MAX_CARBOXYLIC_ACID_INTERACTION_DISTANCE = 3.8
MAX_METAL_INTERACTION_DISTANCE = 3.5
MAX_STATIC_ACCEPTOR_INTERACTION_DISTANCE = 3.5
METAL_PKA_SHIFT = -3.0
MIN_CARBOXYLIC_ACID_INTERACTION_ANGLE = 150
MIN_STATIC_ACCEPTOR_INTERACTION_ANGLE = 150
STATIC_ACCEPTOR_PKA_SHIFT = 4.0
carboxyl_interactions()

Check if histidine is interacting with a carboxyl group.

metal_interactions()
predict(st)
static_acceptor_interactions()

Check if histidine is interacting with a static acceptor

exception schrodinger.protein.assignment.PropKaException(value)[source]

Bases: Exception

__init__(value)[source]
args
with_traceback()

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

schrodinger.protein.assignment.report(message_level=1, message='')[source]
schrodinger.protein.assignment.measure(ct, atom1=None, atom2=None, atom3=None, atom4=None, use_xtal=False, max_dist=10.0)[source]
schrodinger.protein.assignment.calculate_interaction_matrix(ct, iatoms, distance, use_xtal=False)[source]

Create an interaction matrix based on the changeable_index atom property

Parameters
  • ct (structure.Structure) – Structure with annotated atoms having set the i_pa_changeable_index corresponding the the index of the changeable

  • iatoms (List[int]) – List of atom indices which take part in interaction

  • distance (float) – Max distance between interacting atoms

  • use_xtal – Take into account crystal symmetry mates

  • use_xtal – bool

Returns

interaction matrix allowing double indexing: interact[i][j]

Return type

defaultdict(lambda: defaultdict(bool))

schrodinger.protein.assignment.annotate_structure_interactors(ct, acceptors, donors, clashers)[source]

Set atom property for each interactor class

Parameters
  • ct (Structure) – Structure to annotate

  • acceptors (List[int]) – List of acceptor atom indices

  • donors (List[tuple[int, int]]) – List of donor pair atom indices

  • clashers (List[int]) – List of clasher atom indices

Returns

None but sets atom properties

Return type

NoneType

schrodinger.protein.assignment.generate_annotated_ct(ct, donors, acceptors, clashers, use_xtal=False)[source]

Generate an annotated Structure that contains crystal mates. The annotated heavily speeds up the self scoring step for large and xtal structures

Parameters
  • ct (Structure) – Structure to annotate

  • donors (List[Tuple[int, int]]) – List of donor pairs

  • acceptors (List[int]) – List of acceptor atom indices

  • clashers (List[int]) – List of clasher atom indices

  • use_xtal (bool) – Create crystal mates in annotated output structure

Returns

New annotated structure with property ANNOTATED_PROPERTY set to True

Return type

Structure

schrodinger.protein.assignment.check_residue_flip_state(res: schrodinger.structure._structure._Residue) tuple[source]

Determine whether a residue cannot be flipped, is, or is not flipped.

Parameters

res – a protein residue

Returns

a tuple of (state, msg), where state describes whether the residue is flipped (True), is not flipped (False), or cannot be flipped (None); if None, msg will contain an explanation

Return type

tuple[bool or NoneType, str]

schrodinger.protein.assignment.get_residue_flip_state(res: schrodinger.structure._structure._Residue) Optional[bool][source]

Return the flip state of a protein residue.

A truncated version of check_residue_flip_state().

Parameters

res – a protein residue

Returns

the flip state of a residue

schrodinger.protein.assignment.get_residue_string(residue_or_atom) str[source]

Return a string describing a residue from a residue or atom.

The string will match the format

<chain>:<residue PDB code> <residue number>[<insertion code>]

Parameters

residue_or_atom (_Residue or _StructureAtom) – a residue or atom

Returns

a string describing the residue

schrodinger.protein.assignment.get_atom_string(atom)[source]

Return a string describing atom

schrodinger.protein.assignment.get_heavy_neighbors(atom: schrodinger.structure._structure._StructureAtom) list[source]
Parameters

atom – an atom

Returns

a list of heavy (non-H) atoms covalently bound to atom

Return type

list[structure._StructureAtom]

schrodinger.protein.assignment.get_residue_from_changeable(ct, changeable)[source]
class schrodinger.protein.assignment.WaterStateEnumerator(ct, oxygen, acceptors, donors)[source]

Bases: object

Enumerate discrete water states that are hydrogen bonding with nearby acceptors and donors

The goal is to sample likely states while also limiting the number of states as solving the combinatorial problem gets harder with more and more states.

OH_LENGTH = 1.0
HOH_ANGLE = 109.5
MIN_HYDROGEN_NONSTATIC_DONOR_DISTANCE = 2.5
__init__(ct, oxygen, acceptors, donors)[source]
Parameters
  • ct (Structure) – Annotated structure with donor/acceptor and static flags.

  • oxygen (_StructureAtom) – Oxygen atom of water

  • acceptors (List[int]) – List of acceptor atom indices

  • donors (List[Tuple[int, int]]) – List of donor atom indices

enumerate_acceptor_acceptor_states()[source]

Enumerate states where water is donating to two acceptors at the same time

Returns

List of water states

Return type

List[_WaterState]

enumerate_donor_donor_states()[source]

Enumerate states where water is accepting from two donors at the same time

Returns

List of water states

Return type

List[_WaterState]

enumerate_acceptor_states()[source]

Enumerate states where water is donating to a single acceptor

Returns

List of water states

Return type

List[_WaterState]

enumerate_donor_states()[source]

Enumerate states where water is accepting from a single donor

Returns

List of water states

Return type

List[_WaterState]

rotate_hydrogens_along_axis(axis, angle)[source]

Rotate the water hydrogens along an axis by an angle. Does not return anything but moves hydrogens in place.

Parameters
  • axis (3 floats) – Axis along to rotate to

  • angle (float) – Angle to rotate in degrees

class schrodinger.protein.assignment.NetworkSolver(cluster, interact, upper_bound)[source]

Bases: object

Wrapper around toulbar2 that exactly solves the hydrogen bond network problem

PRECISION = 5
MAX_TIME = 120
TOULBAR2 = 'toulbar2'
__init__(cluster, interact, upper_bound)[source]
Parameters
  • cluster (ProtAssign.hbond_cluster) – Hydrogen bond network cluster that will be optimized

  • interact (Dict[int, Dict[int, bool]]) – Changeable interaction lookup table.

  • upper_bound (float) – Upper energy bound for the network energy. Required for toulbar2

setup_toulbar2_inputs()[source]

Setup the input file for toulbar2. Essentially the file contains data on the variables involved, and the self and pair scores, all in a json file.

parse_and_delete_output_file(out)[source]

Parse and then delete toulbar2 output file that contains the chosen state for each changeable

Parameters

out (str) – File name of output file

Returns

List of chosen state of each changeable

Return type

List[List[int]]

optimal_solution()[source]

Run toulbar2 to get the optimal solution

Returns

Optimal state combination. If toulbar2 fails returns None

Return type

List[int] or None

explore_solutions(upper_bound=None, number=1000)[source]

Run toulbar2 to greedily obtain a number of solutions with an energy below a certain upper bound. Note that there are no guarantees here about diversity, though each solution will be unique.

Parameters
  • upper_bound (float) – upper bound energy. All solutions will have an energy lower than this

  • number (int) – Max number of solutions to find

Returns

List of state combinations

Return type

List[List[int]]

class schrodinger.protein.assignment.ProtAssign(ct, interactive=False, do_flips=True, asl='', noprot_asl='', atoms=[], use_xtal=False, torsion_penalty=False, sample_waters=True, sample_acids=True, freeze_existing=False, include_initial=False, max_comb=10000, num_sequential_cycles=30, max_cluster_size=None, logging_level=1, quiet_flag=False, debug_flag=False, add_labels=True, label_pkas=False, pH='neutral', use_propka=True, propka_pH=7.0, user_states=[], minimize=False)[source]

Bases: object

class changeable(ct, iatom)[source]

Bases: object

asl = 'none'
max_hbond_distance = 3.5
hbond_min_angle = 150.0
hbond_heavy_min_angle = 80.0
hbond_heavy_max_angle = 140.0
__init__(ct, iatom)[source]
pre_treat_1(ct)[source]
pre_treat_2(ct)[source]
pre_treat(ct)[source]
enumerate_states(ct, acceptors, donors, pH, do_flips=True, include_initial=False)[source]
lock_protonation()[source]
add_current_to_states(ct)[source]
assign_state(ct, istate, add_labels=True, label_pkas=False, state_gap=None, verbose=False)[source]
assign_state_gap(atom, state_gaps, report_gaps=True)[source]

Write the Gap in energy between the lowest energy state and the state with different protonation states or heavy atom positions to the output ct

Parameters
  • atom (structure.StructureAtom) – The atom that should have properties written to it

  • state_gaps (A dictionary where the keys are strings (state names) and the values are floats (energy in kcals of the lowest energy combination that has that state)) – The energy gaps between states for a given changeable position.

  • report_gaps (bool) – Whether to report the gaps to the log file as well

update_atom_indices(ct, new_indices)[source]
get_new_index(ct, atom_index, new_indices)[source]
get_view_atoms()[source]
swap_atoms(ct, atom1, atom2)[source]
get_penalty(istate)[source]
get_adjustable_atoms()[source]
change_pka(pka, propka_pH)[source]
change_empirical_pka(pH)[source]
get_dihedral_atoms(ct, h)[source]
get_close_interactors(ct, dcell)[source]

Return acceptors, donors and clashers that are close to this changeable heavy atoms.

Parameters
  • ct (Structure) – Structure with annotated atoms signfying interaction class

  • dcell (DistanceCell) – Distance cell to query for neighboring atoms

Returns

List of acceptors, donor heavy-hydrogen pairs, and clashers atom indices

Return type

tuple[list[int], list[tuple[int, int]], list[int]]

class amide_changeable(ct, iatom)[source]

Bases: schrodinger.protein.assignment.ProtAssign.changeable

This is the primary amide -NH2 group of ASN and GLN residues.

asl = '((res.ptype "ASN " AND atom.ptype " CG ") OR (res.ptype "GLN " AND atom.ptype " CD "))'
OXYGEN_PDBNAMES = [' OD1', ' OE1']
NITROGEN_PDBNAMES = [' ND2', ' NE2']
CARBON_PDBNAMES = [' CG ', ' CD ']
__init__(ct, iatom)[source]
pre_treat_2(ct)[source]
enumerate_states(ct, acceptors, donors, pH, do_flips=True, include_initial=False)[source]

Generate states for amides

Max 2 states are generated by swapping the oxygen and nitrogen and readjusting the hydrogens to the nitrogen.

Parameters
  • ct (Structure) – Structure to generate states for

  • do_flips (bool) – Include the flipped state of the amide

Other parameters are not used

set_state_coordinates(ct, istate)[source]

Set coordinates of nitrogen, oxygen, and hydrogens to pre-calculated state coordinates.

assign_state(ct, istate, add_labels=True, label_pkas=False, state_gaps=None, verbose=False)[source]

Assign state to amide residue.

The state is changed by setting the coordinates of the nitrogen, oxygen and 2 hydrogens to pre-calculated positions.

Parameters
  • ct (Structure) – Structure to change

  • istate (int) – State index to assign

  • add_labels (bool) – Add labels to the carbon atom to indicate flip

  • state_gaps (List[float]) – List of state gaps

  • verbose – Does nothing

  • verbose – bool

update_atom_indices(ct, new_indices)[source]
get_heavies()[source]
get_state_sites(ct, istate)[source]

Return state sites consisting of acceptors, donors, clashers and charge.

Returns

List of acceptor, donor, clasher atom indices and charge

Return type

Tuple[List[int], List[int, int], List[int], float]

get_view_atoms()[source]
get_penalty(istate)[source]
get_adjustable_atoms()[source]
add_current_to_states(ct)
assign_state_gap(atom, state_gaps, report_gaps=True)

Write the Gap in energy between the lowest energy state and the state with different protonation states or heavy atom positions to the output ct

Parameters
  • atom (structure.StructureAtom) – The atom that should have properties written to it

  • state_gaps (A dictionary where the keys are strings (state names) and the values are floats (energy in kcals of the lowest energy combination that has that state)) – The energy gaps between states for a given changeable position.

  • report_gaps (bool) – Whether to report the gaps to the log file as well

change_empirical_pka(pH)
change_pka(pka, propka_pH)
get_close_interactors(ct, dcell)

Return acceptors, donors and clashers that are close to this changeable heavy atoms.

Parameters
  • ct (Structure) – Structure with annotated atoms signfying interaction class

  • dcell (DistanceCell) – Distance cell to query for neighboring atoms

Returns

List of acceptors, donor heavy-hydrogen pairs, and clashers atom indices

Return type

tuple[list[int], list[tuple[int, int]], list[int]]

get_dihedral_atoms(ct, h)
get_new_index(ct, atom_index, new_indices)
hbond_heavy_max_angle = 140.0
hbond_heavy_min_angle = 80.0
hbond_min_angle = 150.0
lock_protonation()
max_hbond_distance = 3.5
pre_treat(ct)
pre_treat_1(ct)
swap_atoms(ct, atom1, atom2)
class histidine_changeable(ct, iatom)[source]

Bases: schrodinger.protein.assignment.ProtAssign.changeable

Imidazole group of Histidine residues.

asl = '((res.ptype "HIS ","HID ","HIE ","HIP ")) AND ((atom.ptype " CG "))'
__init__(ct, iatom)[source]
pre_treat_1(ct)[source]
pre_treat_2(ct)[source]
enumerate_states(ct, acceptors, donors, pH, do_flips=True, include_initial=False)[source]

Enumerate histidine states and create penalties for certain states.

Parameters
  • ct (Structure) – Structure to generate states for

  • acceptors (List[int]) – List of acceptor atom indices

  • donors (List[Tuple[int, int]]) – List of donor pair atom indices

  • pH (float) – pH of system to determine pH-related penalties

  • do_flips (bool) – Include flipped histidine states in pool

  • include_initial – Does nothing here

lock_protonation()[source]
assign_state(ct, istate, add_labels=True, label_pkas=False, state_gaps=None, verbose=False)[source]
update_atom_indices(ct, new_indices)[source]
get_heavies()[source]
get_state_sites(ct, istate)[source]
get_view_atoms()[source]
get_penalty(istate)[source]
get_adjustable_atoms()[source]
change_pka(pka, propka_pH)[source]
change_empirical_pka(pH)[source]
add_current_to_states(ct)
assign_state_gap(atom, state_gaps, report_gaps=True)

Write the Gap in energy between the lowest energy state and the state with different protonation states or heavy atom positions to the output ct

Parameters
  • atom (structure.StructureAtom) – The atom that should have properties written to it

  • state_gaps (A dictionary where the keys are strings (state names) and the values are floats (energy in kcals of the lowest energy combination that has that state)) – The energy gaps between states for a given changeable position.

  • report_gaps (bool) – Whether to report the gaps to the log file as well

get_close_interactors(ct, dcell)

Return acceptors, donors and clashers that are close to this changeable heavy atoms.

Parameters
  • ct (Structure) – Structure with annotated atoms signfying interaction class

  • dcell (DistanceCell) – Distance cell to query for neighboring atoms

Returns

List of acceptors, donor heavy-hydrogen pairs, and clashers atom indices

Return type

tuple[list[int], list[tuple[int, int]], list[int]]

get_dihedral_atoms(ct, h)
get_new_index(ct, atom_index, new_indices)
hbond_heavy_max_angle = 140.0
hbond_heavy_min_angle = 80.0
hbond_min_angle = 150.0
max_hbond_distance = 3.5
pre_treat(ct)
swap_atoms(ct, atom1, atom2)
class carboxyl_changeable(ct, iatom)[source]

Bases: schrodinger.protein.assignment.ProtAssign.changeable

asl = '(res.ptype "ASP ","ASH " AND atom.ptype " CG ") OR (res.ptype "GLU ","GLH " AND atom.ptype " CD ")'
__init__(ct, iatom)[source]
pre_treat_1(ct)[source]
pre_treat_2(ct)[source]
enumerate_states(ct, acceptors, donors, pH, do_flips=True, include_initial=False)[source]
lock_protonation()[source]
assign_state(ct, istate, add_labels=True, label_pkas=False, state_gaps=None, verbose=False)[source]
update_atom_indices(ct, new_indices)[source]
get_heavies()[source]
get_state_sites(ct, istate)[source]
get_view_atoms()[source]
get_penalty(istate)[source]
get_adjustable_atoms()[source]
change_pka(pka, propka_pH)[source]
change_empirical_pka(pH)[source]
add_current_to_states(ct)
assign_state_gap(atom, state_gaps, report_gaps=True)

Write the Gap in energy between the lowest energy state and the state with different protonation states or heavy atom positions to the output ct

Parameters
  • atom (structure.StructureAtom) – The atom that should have properties written to it

  • state_gaps (A dictionary where the keys are strings (state names) and the values are floats (energy in kcals of the lowest energy combination that has that state)) – The energy gaps between states for a given changeable position.

  • report_gaps (bool) – Whether to report the gaps to the log file as well

get_close_interactors(ct, dcell)

Return acceptors, donors and clashers that are close to this changeable heavy atoms.

Parameters
  • ct (Structure) – Structure with annotated atoms signfying interaction class

  • dcell (DistanceCell) – Distance cell to query for neighboring atoms

Returns

List of acceptors, donor heavy-hydrogen pairs, and clashers atom indices

Return type

tuple[list[int], list[tuple[int, int]], list[int]]

get_dihedral_atoms(ct, h)
get_new_index(ct, atom_index, new_indices)
hbond_heavy_max_angle = 140.0
hbond_heavy_min_angle = 80.0
hbond_min_angle = 150.0
max_hbond_distance = 3.5
pre_treat(ct)
swap_atoms(ct, atom1, atom2)
class rotatable_changeable(ct, iatom)[source]

Bases: schrodinger.protein.assignment.ProtAssign.changeable

asl = '((res.ptype "CYS ","CYT ") AND (atom.ptype " SG ") AND (atom.formal -1)) OR ((res.ptype "TYR ") AND (atom.ptype " OH ") AND (atom.formal -1)) OR (( atom.ele H AND not /C0-H0/ AND not /N0-H0/ ) AND NOT (res.ptype "HOH","DOD","SPC","ASH","GLH","ASP","GLU" ))'
__init__(ct, iatom)[source]
pre_treat_1(ct)[source]
pre_treat_2(ct)[source]
enumerate_states(ct, acceptors, donors, pH, do_flips=True, include_initial=False)[source]
lock_protonation()[source]
add_current_to_states(ct)[source]
assign_state(ct, istate, add_labels=True, label_pkas=False, state_gaps=None, verbose=False)[source]
update_atom_indices(ct, new_indices)[source]
get_heavies()[source]
get_state_sites(ct, istate)[source]
get_view_atoms()[source]
get_penalty(istate)[source]
get_adjustable_atoms()[source]
change_pka(pka, propka_pH)[source]
change_empirical_pka(pH)[source]
assign_state_gap(atom, state_gaps, report_gaps=True)

Write the Gap in energy between the lowest energy state and the state with different protonation states or heavy atom positions to the output ct

Parameters
  • atom (structure.StructureAtom) – The atom that should have properties written to it

  • state_gaps (A dictionary where the keys are strings (state names) and the values are floats (energy in kcals of the lowest energy combination that has that state)) – The energy gaps between states for a given changeable position.

  • report_gaps (bool) – Whether to report the gaps to the log file as well

get_close_interactors(ct, dcell)

Return acceptors, donors and clashers that are close to this changeable heavy atoms.

Parameters
  • ct (Structure) – Structure with annotated atoms signfying interaction class

  • dcell (DistanceCell) – Distance cell to query for neighboring atoms

Returns

List of acceptors, donor heavy-hydrogen pairs, and clashers atom indices

Return type

tuple[list[int], list[tuple[int, int]], list[int]]

get_dihedral_atoms(ct, h)
get_new_index(ct, atom_index, new_indices)
hbond_heavy_max_angle = 140.0
hbond_heavy_min_angle = 80.0
hbond_min_angle = 150.0
max_hbond_distance = 3.5
pre_treat(ct)
swap_atoms(ct, atom1, atom2)
class amine_changeable(ct, iatom)[source]

Bases: schrodinger.protein.assignment.ProtAssign.changeable

asl = '((res.ptype "LYS ","LYN ") AND (atom.ptype " NZ "))'
__init__(ct, iatom)[source]
pre_treat_1(ct)[source]
pre_treat_2(ct)[source]
enumerate_states(ct, acceptors, donors, pH, do_flips=True, sample_neutral_states=False, include_initial=False)[source]

Generate states for lysines.

States are generated by rotating hydrogens for acceptor/donor interactions and by optionally including the neutral state.

Parameters
  • ct (Structure) – Structure to generate states for

  • acceptors (List[int]) – List of acceptor atom indices

  • donors (List[(int, int)]) – List of donor atom indices

  • pH (float) – pH of system

  • do_flips (bool) – Does nothing

  • sample_neutral_states (bool) – Include neutral states. Since PROPKA’s pKa prediction is unreliable for Lys, currently we have no method of confidently assess whether it is neutral. So it’s turned off by default.

  • include_initial (bool) – Include the initial state of the Lys

lock_protonation()[source]
assign_state(ct, istate, add_labels=True, label_pkas=False, state_gaps=None, verbose=False)[source]
update_atom_indices(ct, new_indices)[source]
get_heavies()[source]
get_state_sites(ct, istate)[source]
get_view_atoms()[source]
get_penalty(istate)[source]
change_pka(pka, propka_pH)[source]
change_empirical_pka(pH)[source]
add_current_to_states(ct)
assign_state_gap(atom, state_gaps, report_gaps=True)

Write the Gap in energy between the lowest energy state and the state with different protonation states or heavy atom positions to the output ct

Parameters
  • atom (structure.StructureAtom) – The atom that should have properties written to it

  • state_gaps (A dictionary where the keys are strings (state names) and the values are floats (energy in kcals of the lowest energy combination that has that state)) – The energy gaps between states for a given changeable position.

  • report_gaps (bool) – Whether to report the gaps to the log file as well

get_adjustable_atoms()
get_close_interactors(ct, dcell)

Return acceptors, donors and clashers that are close to this changeable heavy atoms.

Parameters
  • ct (Structure) – Structure with annotated atoms signfying interaction class

  • dcell (DistanceCell) – Distance cell to query for neighboring atoms

Returns

List of acceptors, donor heavy-hydrogen pairs, and clashers atom indices

Return type

tuple[list[int], list[tuple[int, int]], list[int]]

get_dihedral_atoms(ct, h)
get_new_index(ct, atom_index, new_indices)
hbond_heavy_max_angle = 140.0
hbond_heavy_min_angle = 80.0
hbond_min_angle = 150.0
max_hbond_distance = 3.5
pre_treat(ct)
swap_atoms(ct, atom1, atom2)
class water_changeable(ct, iatom)[source]

Bases: schrodinger.protein.assignment.ProtAssign.changeable

asl = '(water) AND (atom.ele O)'
redundancy_tolerance = 0.5
__init__(ct, iatom)[source]
property nstates

Return number of enumerated states

enumerate_states(ct, acceptors, donors, pH, do_flips=True, include_initial=False)[source]

Generate discrete states for water, where a state is defined by the coordinates of its two hydrogens.

Parameters
  • ct (Structure) – Structure

  • acceptors (List[int]) – Acceptor atom indices

  • donors (List[Tuple(int, int)]) – Donor heavy-hydrogen atom indices

  • pH (float) – Does nothing here

  • do_flips (bool) – Does nothing here

  • include_initial (bool) – Include the current water orientation in the state list

add_current_to_states(ct)[source]
assign_state(ct, istate, add_labels=True, label_pkas=False, state_gaps=None, verbose=False)[source]
update_atom_indices(ct, new_indices)[source]
get_heavies()[source]
get_state_sites(ct, istate)[source]
get_view_atoms()[source]
get_penalty(istate)[source]
get_adjustable_atoms()[source]
assign_state_gap(atom, state_gaps, report_gaps=True)

Write the Gap in energy between the lowest energy state and the state with different protonation states or heavy atom positions to the output ct

Parameters
  • atom (structure.StructureAtom) – The atom that should have properties written to it

  • state_gaps (A dictionary where the keys are strings (state names) and the values are floats (energy in kcals of the lowest energy combination that has that state)) – The energy gaps between states for a given changeable position.

  • report_gaps (bool) – Whether to report the gaps to the log file as well

change_empirical_pka(pH)
change_pka(pka, propka_pH)
get_close_interactors(ct, dcell)

Return acceptors, donors and clashers that are close to this changeable heavy atoms.

Parameters
  • ct (Structure) – Structure with annotated atoms signfying interaction class

  • dcell (DistanceCell) – Distance cell to query for neighboring atoms

Returns

List of acceptors, donor heavy-hydrogen pairs, and clashers atom indices

Return type

tuple[list[int], list[tuple[int, int]], list[int]]

get_dihedral_atoms(ct, h)
get_new_index(ct, atom_index, new_indices)
hbond_heavy_max_angle = 140.0
hbond_heavy_min_angle = 80.0
hbond_min_angle = 150.0
lock_protonation()
max_hbond_distance = 3.5
pre_treat(ct)
pre_treat_1(ct)
pre_treat_2(ct)
swap_atoms(ct, atom1, atom2)
class hbond_cluster[source]

Bases: object

__init__()[source]
setup_xtal(ct, interact, clustering_distance)[source]
optimize(ct, interact, static_donors, static_acceptors, static_clashers, max_comb, num_sequential_cycles, use_propka, propka_pH=7.0, annotated_ct=None)[source]

Optimize hydrogen bond network and protonation states of changeables in this cluster

Parameters
  • ct (Structure) – Structure containing changeables to optimize

  • interact (Dict[Dict[bool]]) – Interaction lookup dict for changeable-changeable interactions

  • static_donors (List[int]) – List of static donor atom indices

  • static_acceptors – List of static acceptor atom indices

  • static_clashers – List of static clasher atom indices

  • max_comb (int) – Maximum number of combinations at which an exhaustive search is performed.

  • num_sequential_cycles (int) – Number of optimization cycles when using heuristic search.

  • use_propka (bool) – Use PROPKA to determine pKa values of changeables

  • propka_pH (float) – pH of system when using PROPKA for pKa determination

  • annotated_ct (Structure) – Annotated structure that may contain xtal mates for faster optimization. Passing this, skips the creation of crystal mates and structure annotation during the self-scoring phase.

solve_network_exact_and_diversify(ct, interact, ncombinations, delta_energy=2.0)[source]

Solve the network exact

Parameters
  • ct (structure.Structure) – Structure

  • interact (Dict[int, Dict[int, bool]]) – Changeable interaction lookup table

  • ncombinations (int) – Number of maximum combinations to return

  • delta_energy (float) – Maximum energy difference of combinations generated compared to the global minimum

Returns

List of combinations with first element being the global optimum combination or empty list if no optimum found

Return type

List[List[int]]

score_combination(ct, interact, states)[source]
single_point(ct, interact, static_donors, static_acceptors, static_clashers, xtal_ct=None)[source]
setup_local_static_alt(ct, static_acceptors, static_donors, static_clashers)[source]
setup_local_static(ct, static_acceptors, static_donors, static_clashers)[source]
initialize_score_storage()[source]
pre_score_self(ct)[source]

Calculate the self score for each state. Interactions are calculated between the changeable and its static environment.

pre_score_pairs(ct, interact)[source]
score_pair(ct, iacceptors, idonors, iclashers, icharge, jacceptors, jdonors, jclashers, jcharge, use_xtal=False)[source]
score_donor_acceptor(ct, donor_heavy, donor_hydrogen, acceptor_heavy, use_xtal=False)[source]
static calculate_distance_term(distance)[source]

Return distance dependent part of the hydrogen-bond potential functions.

static calculate_angle_term(angle)[source]

Return angle dependent part of the hydrogen bond potential.

Parameters
  • angle – Angle in degrees formed by H-D-A, with Hydrogen, Donor and Acceptor

  • angle – float

Returns

Score

Return type

float

static calculate_clash_term(distance, cutoff)[source]

Return clash term

score_exhaustively(ct, interact, find_all_solutions=True, tolerate_clashes=False)[source]
score_sequentially(ct, interact, num_sequential_cycles)[source]

This routine uses an algorithm similar to Prime’s iteration to convergence. Starting from a random configuration, each species is optimized in turn, keeping the others fixed in their current state. This continues until the system reaches convergence (no more changes in the most optimal state for all residues).

Parameters
  • ct (schrodigner.Structure) – input/output structure, will be modified

  • interact

    ??

  • num_sequential_cycles (int) – Number of cycles of randomization and optimization to conduct

expand_solutions(ct, interact)[source]

This takes an existing set of good solutions and generates more by deconverging them and then iterating them back to convergence. Generates at least 10 new solutions.

recombine_solutions(ct, interact)[source]

This is similar to score_sequentially, but begins with some pre-existing good solutions in self.combinations, and then creates hybrids to try to improve on them.

deconverge(ct, interact, comb, problem_cutoff=50.0)[source]

This starts with what is assumed to be a good solution, and then randomizes the states, but not to anything that produces a problem.

iterate_to_convergence(ct, interact, comb, problem_cutoff=50.0)[source]

This iterates the combination ‘comb’ to convergence. Maximum of 10 cycles.

create_hybrid(local_combinations, interact, random_scaffold=False)[source]

This takes the lowest energy solution, and for each problematic region it searches other solutions (in random order) for any which may have had better luck for just that part of the overall cluster. It then splices those solutions into the lowest energy one. If random_scaffold, then it selects a random solution as the basis in stead of the lowest energy one.

trim_redundant_combinations()[source]
assign_combination(ct, icombination, add_labels, label_pkas, verbose=False)[source]

Assign a given combination to this cluster

Parameters
  • ct (schrodinger.Structure) – The structure to operate on

  • icombination – The index of the combination to assign or if this number is larger then the stored combinations, just keep the current state

  • add_labels (bool) – Whether to add labels to atoms to be seen in maestro with the current protonation state

  • label_pka (bool) – Whether to add labels for the pKa of each residue

  • verbose (bool) – Whether to report additional information to the log file about the combination chosen

determine_gap(icombination, ichangeable)[source]

Create a dictionary with the energy gaps to each of the various states. States that differ by only a hydrogen rotation are not considered unique

Parameters
  • icombination (integer) – the combination to use as the zero point. In most situations this will be the lowest energy combination ( 0 when sorted)

  • ichangeable (integer) – The residue number ( or position number) within the cluster which will be analyzed

Rparam

dictionary where the key is the name of the state or “Default” when the state is one of the staggers

Return type

dictionary with a key of string and value of a float

__init__(ct, interactive=False, do_flips=True, asl='', noprot_asl='', atoms=[], use_xtal=False, torsion_penalty=False, sample_waters=True, sample_acids=True, freeze_existing=False, include_initial=False, max_comb=10000, num_sequential_cycles=30, max_cluster_size=None, logging_level=1, quiet_flag=False, debug_flag=False, add_labels=True, label_pkas=False, pH='neutral', use_propka=True, propka_pH=7.0, user_states=[], minimize=False)[source]
fix_elements(ct)[source]
freeze_existing_hydrogens(ct)[source]
setup(ct)[source]
empirical_pka_predictor(ct)[source]

Predict pKa of histidine and Asp/Glu based on empirical rules

remove_zero_order_bonds(ct)[source]
extend_targeted_to_hyds(ct)[source]
delete_atoms(ct, atoms)[source]
run_propka(changeables, ct, use_xtal=False)[source]
generate_mates(ct)[source]
apply_pkas(changeables, changes, propka_pH)[source]
find_protonation_state_changes(ct, clusters='all')[source]
identify_species(ct)[source]
identify_all_hbonders(ct)[source]
annotate_structure(ct)[source]

Annotate atoms in structure by their interaction class and whether or not they are static

Internally updates the acceptors, donors and clashers attributes

enumerate_changeable_states(ct)[source]

Enumerate all states for each changeable. Crystal symmetry mates are taken into account if requested.

lock_protonation_states(ct)[source]
remove_changeables_from_hbonders()[source]
cluster(ct)[source]

Cluster changeables based on their heavies.

set_user_states(ct)[source]
assign_state_of_changeable(ct, ichangeable, istate)[source]
increment_state_of_changeable(ct, ichangeable)[source]
decrement_state_of_changeable(ct, ichangeable)[source]
record_current_indices(ct)[source]
assign_best_combinations(ct, last_time=False)[source]

Assign the best combinations to the ct and report output

Parameters
  • ct (schrodinger.Structure) – The structure to operate on

  • last_time (bool) – Whether or not this is the last time through when we should be extra verbose

assign_cluster_combination(ct, icluster, icombination)[source]
single_point_cluster(ct, icluster)[source]
optimize_cluster(ct, icluster, assign=True)[source]
optimize(ct)[source]
recalculate_empirical_pkas(ct, iteration)[source]

Only recalculate pKa’s of histidines for forced acceptor interactions

recalculate_propka_pkas(ct)[source]
minimize_hydrogens(ct)[source]
restore_zobs(ct)[source]
cleanup(ct)[source]
summarize_pkas()[source]