schrodinger.protein.protassign.changeables module

Module containing the “changeable” classes of ProtAssign and associated functions.

Usage: ProtAssign(st)

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.protein.protassign.changeables.get_dihedral_atoms(ct: schrodinger.structure._structure.Structure, h: int) List[int]

Get atoms to define a dihedral angle given a hydrogen atom index Return list is smaller than 4 elements if dihedral cannot be determined.

schrodinger.protein.protassign.changeables.annotate_ligand_atoms(ligand_sts: List[schrodinger.structure._structure.Structure], ligand_id: str)

Annotate atoms of ligand structures with an ID and state ID

schrodinger.protein.protassign.changeables.update_ligand_rotatables_annotation(ct, iatoms: List[int])

Update atom properties of rotatable hydrogens in the ligand reindexing them

schrodinger.protein.protassign.changeables.add_ligand_sts(ct, ligand_sts: List[schrodinger.structure._structure.Structure])

Extend structure with ligand states

Checks if a ligand state is already part of the structure to determine whether to add based on specific atom properties.

schrodinger.protein.protassign.changeables.get_ligand_atom_indices(ct, ligand_id: str) List[int]

Return atom indices annotated by ligand_id

schrodinger.protein.protassign.changeables.further_annotate_ligand_atoms(ct, iatoms: List[int])

Further annotate ligand atoms notably hydrogen Assumes ligand atoms are annotated already with s_pa_ligand_id and i_pa_ligand_het

schrodinger.protein.protassign.changeables.group_ligand_het_states(ct, iatoms: List[int]) Dict[int, List[int]]

Return ligand atom indices grouped by het

schrodinger.protein.protassign.changeables.identify_all_hbonders(ct)

Identify all acceptor, donors and clashers in a structure

schrodinger.protein.protassign.changeables.get_ligand_interactors(ct, iatoms: List[int])

Get ligand interactors while excluding shared acceptors/donors

schrodinger.protein.protassign.changeables.annotate_ligand_rotatable_hydrogens(ct, ligand_iatoms: List[int])

Annotate rotatable hydrogens and oxygens of the ligand.

These are either hydrogens that are shared with a rotatable_changeable or rotatable in a subset of ligand states. In case it is only rotatable in a subset of the ligand we also annotate the oxygen.

schrodinger.protein.protassign.changeables.annotate_structure_interactors(ct: schrodinger.structure._structure.Structure, interactors: schrodinger.protein.protassign.utils.Interactors) None

Set atom property for each interactor class

Parameters
  • ct – Structure to annotate

  • interactors – All interactors to annotate

Returns

None but sets atom properties

schrodinger.protein.protassign.changeables.get_heavy_neighbors(atom: schrodinger.structure._structure.StructureAtom) list
Parameters

atom – an atom

Returns

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

Return type

list[structure._StructureAtom]

class schrodinger.protein.protassign.changeables.changeable(ct, iatom)

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)
pre_treat_1(ct)
pre_treat_2(ct)
pre_treat(ct)
enumerate_states(ct, interactors: schrodinger.protein.protassign.utils.Interactors, pH, do_flips=True, include_initial=False)
lock_protonation()
add_current_to_states(ct)
assign_state(ct, istate, add_labels=True, label_pkas=False, state_gap=None, verbose=False)
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

update_atom_indices(ct: schrodinger.structure._structure.Structure, new_indices: Dict[int, int])
get_new_index(ct: schrodinger.structure._structure.Structure, atom_index: int, new_indices: Dict[int, int])
get_view_atoms()
swap_atoms(ct, atom1, atom2)
get_penalty(istate)
get_adjustable_atoms()
change_pka(pka, pH)
change_empirical_pka(pH)
get_close_interactors(ct: schrodinger.structure._structure.Structure, dcell) schrodinger.protein.protassign.utils.Interactors

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

Parameters
  • ct – 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

class schrodinger.protein.protassign.changeables.ligand_changeable(ct, iatom)

Bases: schrodinger.protein.protassign.changeables.changeable

type = 'LIGAND'
__init__(ct, iatom)
property nstates
pre_treat_1(ct)

Add all the protonation states to the ct. After this method the ct is a superposition of ligand states.

pre_treat_2(ct)

Further annotates structure and stores data for bookkeeping and improved computational performance. Assumes pre_treat_1 has been called before.

add_protonation_state(ligand_st)
get_heavies()
get_adjustable_atoms()
get_view_atoms()
enumerate_states(ct, interactors: schrodinger.protein.protassign.utils.Interactors, pH, do_flips=True, include_initial=False)

Enumerate ligand states

The input structure is supposed to have its different protonation states available as a superposition, i.e. all protonation states of the ligand are fully integrated into the structure.

A ligand state is a protonation state of the ligand and a combination of non-shared hydrogen coordinates. A non-shared hydrogen is a rotatable hydrogen that is only present in a subset of ligand protonation states.

get_het_from_state(istate: int) int

Get the protonation state index from the state index.

get_rotatable_id_to_atom(ct, hetid: int) Dict[int, int]

Return a dictionary that maps a rotatable index to its atom index

update_hydrogen_xyz_from_state(ct, istate: int)

Update the non-shared rotatable hydrogen coordinates for a specific state.

Returns None but updates xyz coordinates of non-shared rotatable hydrogens.

get_state_sites(ct, istate: int) Tuple[List[int], List[Tuple[int, int]], List[int], int]

Updates non-shared rotatable hydrogen positions and returns atom indices for acceptors, donors, clashers and (unused) charge

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

Sets the ligand to a certain state and internally updates atom indices. Returns list of atom indices that need to be deleted to obtain the right state.

update_atom_indices(ct, new_indices: Dict[int, int])

Update stored atom indices for bookkeeping.

get_penalty(istate: int) float

Get penalty for ligand state, which is currently fully defined by the ligand protonation state. Return 0 if no penalty.

class schrodinger.protein.protassign.changeables.amide_changeable(ct, iatom)

Bases: schrodinger.protein.protassign.changeables.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)
pre_treat_2(ct)
enumerate_states(ct: schrodinger.structure._structure.Structure, interactors: schrodinger.protein.protassign.utils.Interactors, pH, do_flips: bool = True, include_initial=False)

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 to generate states for

  • do_flips – Include the flipped state of the amide

Other parameters are not used

set_state_coordinates(ct, istate)

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)

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)
get_heavies()
get_state_sites(ct, istate)

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()
get_penalty(istate)
get_adjustable_atoms()
class schrodinger.protein.protassign.changeables.histidine_changeable(ct, iatom)

Bases: schrodinger.protein.protassign.changeables.changeable

Imidazole group of Histidine residues.

asl = '((res.ptype "HIS ","HID ","HIE ","HIP ")) AND ((atom.ptype " CG "))'
__init__(ct, iatom)
pre_treat_1(ct)
pre_treat_2(ct)
enumerate_states(ct, interactors: schrodinger.protein.protassign.utils.Interactors, pH: Optional[float], do_flips=True, include_initial=False)

Enumerate histidine states and create penalties for certain states.

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

  • interactors – Interactor atom indices

  • pH – pH of system to determine pH-related penalties. Set to None if using a pKa-predictor

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

  • include_initial – Does nothing here

lock_protonation()
assign_state(ct, istate, add_labels=True, label_pkas=False, state_gaps=None, verbose=False)
update_atom_indices(ct, new_indices)
get_heavies()
get_state_sites(ct, istate)
get_view_atoms()
get_penalty(istate)
get_adjustable_atoms()
change_pka(pka, pH)
change_empirical_pka(pH)
class schrodinger.protein.protassign.changeables.carboxyl_changeable(ct, iatom)

Bases: schrodinger.protein.protassign.changeables.changeable

asl = '(res.ptype "ASP ","ASH " AND atom.ptype " CG ") OR (res.ptype "GLU ","GLH " AND atom.ptype " CD ")'
__init__(ct, iatom)
pre_treat_1(ct)
pre_treat_2(ct)
enumerate_states(ct, interactors: schrodinger.protein.protassign.utils.Interactors, pH, do_flips=True, include_initial=False)
lock_protonation()
assign_state(ct, istate, add_labels=True, label_pkas=False, state_gaps=None, verbose=False)
update_atom_indices(ct, new_indices)
get_heavies()
get_state_sites(ct, istate)
get_view_atoms()
get_penalty(istate)
get_adjustable_atoms()
change_pka(pka, pH)
change_empirical_pka(pH)
class schrodinger.protein.protassign.changeables.rotatable_changeable(ct, iatom)

Bases: schrodinger.protein.protassign.changeables.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" ))'
type = 'ROTATABLE'
__init__(ct, iatom)
pre_treat_1(ct)
pre_treat_2(ct)
enumerate_states(ct, interactors: schrodinger.protein.protassign.utils.Interactors, pH, do_flips=True, include_initial=False)
lock_protonation()
add_current_to_states(ct)
assign_state(ct, istate, add_labels=True, label_pkas=False, state_gaps=None, verbose=False)
update_atom_indices(ct, new_indices)
get_heavies()
get_state_sites(ct, istate)
get_view_atoms()
get_penalty(istate)
get_adjustable_atoms()
change_pka(pka, pH)
change_empirical_pka(pH)
class schrodinger.protein.protassign.changeables.amine_changeable(ct, iatom)

Bases: schrodinger.protein.protassign.changeables.changeable

asl = '((res.ptype "LYS ","LYN ") AND (atom.ptype " NZ "))'
type = 'AMINE'
__init__(ct, iatom)
pre_treat_1(ct)
pre_treat_2(ct)
enumerate_states(ct: schrodinger.structure._structure.Structure, interactors: schrodinger.protein.protassign.utils.Interactors, pH: float, do_flips: bool = True, sample_neutral_states: bool = False, include_initial: bool = False)

Generate states for lysines.

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

Parameters
  • ct – Structure to generate states for

  • interactors – Interactor atom indices

  • pH – pH of system

  • do_flips – Does nothing

  • sample_neutral_states – 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()
assign_state(ct, istate, add_labels=True, label_pkas=False, state_gaps=None, verbose=False)
update_atom_indices(ct, new_indices)
get_heavies()
get_state_sites(ct, istate)
get_view_atoms()
get_penalty(istate)
change_pka(pka, pH)
change_empirical_pka(pH)
class schrodinger.protein.protassign.changeables.WaterStateEnumerator(ct, oxygen, interactors: schrodinger.protein.protassign.utils.Interactors)

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, interactors: schrodinger.protein.protassign.utils.Interactors)
Parameters
  • ct (Structure) – Annotated structure with donor/acceptor and static flags.

  • oxygen (_StructureAtom) – Oxygen atom of water

  • acceptors – Interactor atom indices

enumerate_acceptor_acceptor_states()

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()

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()

Enumerate states where water is donating to a single acceptor

Returns

List of water states

Return type

List[_WaterState]

enumerate_donor_states()

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)

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.protassign.changeables.water_changeable(ct, iatom)

Bases: schrodinger.protein.protassign.changeables.changeable

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

Return number of enumerated states

enumerate_states(ct: schrodinger.structure._structure.Structure, interactors: schrodinger.protein.protassign.utils.Interactors, pH: float, do_flips: bool = True, include_initial: bool = False)

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

Parameters
  • ct – Structure

  • interactors – Interactor atom indices

  • pH – Does nothing here

  • do_flips – Does nothing here

  • include_initial – Include the current water orientation in the state list

add_current_to_states(ct)
assign_state(ct, istate, add_labels=True, label_pkas=False, state_gaps=None, verbose=False)
update_atom_indices(ct, new_indices)
get_heavies()
get_state_sites(ct, istate)
get_view_atoms()
get_penalty(istate)
get_adjustable_atoms()
schrodinger.protein.protassign.changeables.identify_ligand_changeables(ct, ligand_sts: List[schrodinger.structure._structure.Structure]) List[schrodinger.protein.protassign.changeables.ligand_changeable]

Identify ligand changeables given a list of structures.

Ligand changeables are identified by comparing the residue ID of given ligand structures with residues that are present in the Structure.

schrodinger.protein.protassign.changeables.identify_species(ct, species: List[Type], target_atoms) List[schrodinger.protein.protassign.changeables.changeable]

Identify all changeables, i.e. elements in the network that can be changed apart from ligand changeables.

schrodinger.protein.protassign.changeables.identify_nonshared_rotatable(ct, ligand_changeables: List[schrodinger.protein.protassign.changeables.ligand_changeable], changeable: schrodinger.protein.protassign.changeables.changeable) bool

Check if changeable is part of ligand and whether it can be its own changeable or needs to be sampled within the ligand states.

Returns

True if changeable is a non-shared rotatable across ligand states, False otherwise

schrodinger.protein.protassign.changeables.update_rotatable_changeable_indices(ct, iatoms: List[int], changeables: List[schrodinger.protein.protassign.changeables.rotatable_changeable])

Update the atom indices of the shared changeables, in this case specifically for rotatables.

Parameters

ct – Structure

Current_state_indices

Ligand atom indices of current state

schrodinger.protein.protassign.changeables.filter_nonshared_rotatables(ct, changeables: List[schrodinger.protein.protassign.changeables.changeable]) List[schrodinger.protein.protassign.changeables.changeable]

Given a list of changeables, filter rotatable_changeable instances if they are not shared across all ligand states, as these nonshared rotatables will be dealed with by the ligand_changeable itself.

schrodinger.protein.protassign.changeables.pre_treat_changeables(st: schrodinger.structure._structure.Structure, changeables: List[schrodinger.protein.protassign.changeables.changeable]) None

Pre-treat changeables that are not yet treated

This is faster than pre-treating each changeable by itself as hydrogens are added only once.

schrodinger.protein.protassign.changeables.get_residue_from_changeable(ct, changeable)
schrodinger.protein.protassign.changeables.remove_changeable_interactors(changeables: List[schrodinger.protein.protassign.changeables.changeable], interactors: schrodinger.protein.protassign.utils.Interactors) schrodinger.protein.protassign.utils.Interactors

Remove changeable interactors from given interactors

schrodinger.protein.protassign.changeables.identify_changeables(ct, ligand_sts, species, target_atoms)