Package schrodinger :: Package application :: Module prepwizard
[hide private]
[frames] | no frames]

Module prepwizard

Shared functionality between PrepWizard GUI and command-line PrepWizard.

Copyright Schrodinger, LLC. All rights reserved.

Classes [hide private]
  _CommonProblemsFixer
Class for fixing common structure problems.
Functions [hide private]
 
_count_bonds(a)
Count number of bonds to the given StructureAtom (double bonds = 2 bonds), zero-order bonds are not counted.
 
fix_common_structure_mistakes(st)
Fixes common problems in structures and returns a list of correction strings that are to be reported to the user.
 
check_st_valences(st)
Will raise a RuntimeError if any atom in the specified structure has more bonds than is allowed for that element.
 
atomsasl(atoms)
Generates an ASL expression for the specified atoms.
 
create_disulfide_bonds(st, dist=3.2, verbose=False)
Create bonds between proximal Sulfurs, deleting any hydrogens on them.
 
convert_selenomethionines(st)
Convert MSE residues to METs.
 
_set_oxygen_orders(st, mainatom, double, single, charge)
Sets the orders of phosphate-oxygen or sulfate-oxygen bonds.
 
_generate_phosphate_states(st, atoms)
Returns a list of structures (expanded states)
 
_generate_sulfate_states(st, atoms)
Returns a list of structures (expanded states)
 
count_phosphates_and_sulfurs(st)
 
extend_phosphate_states(st)
For specified structure, generates phosphate states, and returns list of output structures.
 
extend_sulfate_states(st)
For specified structure, generates sulfate states, and returns list of output structures.
 
get_chain_sequences(st, remove_tails=True)
Will read the PDB sequences from the sequence block, and will return a dictionary (keys: chain names; values: sequence strings).
 
write_sequences_to_fasta(pdbid, sequences_dict, fastafile)
 
_run_prime_job(st, keywords, prime_jobname, app=None)
Run the Prime job specified by the keywords on the <st> with jobname <prime_jobname>.
 
fill_missing_loops(st, fasta_file, prime_jobname, build_tail=False, app=None)
st - Input Structure object fasta_file - Associated .fasta file prime_jobname - Job name to use for the Prime job.
 
does_res_have_missing_side_chains(residue)
Given a _Residue object, returns True if the residue is missing side-chain atoms.
 
do_any_residues_have_missing_side_chains(st)
Returns True if at least one of the residue in the given structure has missing side-chain atoms (backbone atoms are ignored).
 
fill_missing_side_chains(st, prime_jobname, app=None)
st - Input Structure object prime_jobname - Job name to use for the Prime job.
 
fix_sulfur_charges(st)
Post process by fixing the charge on zero-order-bonded Sulfurs Gives -1 or -2 charge to Sulfurs as appropriate.
 
prepare_for_epik(st, het_asls, app=None)
Extract the structures to run Epik on from the input complex CT.
List of structure.Structure
filter_undesired_states(orig_st, state_sts)
Returns a subset of state structures, which excludes metal-binding states for hets that are not within 5A of a metal.
 
find_ppw_atom(st, anum)
Find the atom in the given structure whose i_ppw_anum property is set to the given value.
(dict, list)
apply_state(complex_st, state_st)
Modify the het in complex_st complex (protein/ligand) structure such that its ionization state matches the output that we got from Epik (state_st).
(float, float/None, str)
apply_state_and_calc_score(complex_st, state_st)
Apply the state <state_st> to <complex_st>, and return the score for the state in the context of the protein complex.
 
_generate_metal_states(st)
Ionize the metal atom in st (only one, if exists) and return a list of ionized sts
 
generate_special_states(sts, app=None)
 
_find_waters(st)
Return a list of water atoms.
 
get_bridging_waters(st, min_hbonds=3)
Return a list of all waters in the specified structure that make at least <min_hbonds> number of H-bonds (H-bonds to other waters excluded).
list of ints.
hydrogen_neighbors(st, atoms)
Returns the list of neighbor (bonded) atoms that are hydrogens.
 
get_pdb_id(st)
Returns the PDB ID of the given structure.
 
get_het_name(st, het_atoms)
Return the het "name" to display for the user for the given het.
 
add_prepared_props(st)
Adds "prepared" and "prepared with version" properties to the given structure.
Variables [hide private]
  maestro = schrodinger.get_maestro()
  maxvalence = [0, 1, 1, 1, 2, 6, 4, 4, 2, 1, 1, 1, 2, 8, 8, 8, ...
  EPIK_EXCLUSION_LIST = ['HEM', 'HEC']
  STATE_PANELTY_PROP = 'r_epik_State_Penalty'
  METAL_PENALTY_PROP = 'r_epik_Metal_State_Penalty'
  HBOND_ENERGY = 1.0
  PDBNAME_ELEMENT_DICT = {' CD ': 'C', ' CD2': 'C', ' CE1': 'C',...
  metal_charges = {11: [1], 12: [2], 19: [1], 20: [2], 25: [2, 3...
  __package__ = 'schrodinger.application'
  pdbname = ' CE1'
Function Details [hide private]

check_st_valences(st)

 

Will raise a RuntimeError if any atom in the specified structure has more bonds than is allowed for that element. Het groups in the PDB sometimes have this issue.

create_disulfide_bonds(st, dist=3.2, verbose=False)

 

Create bonds between proximal Sulfurs, deleting any hydrogens on them. If verbose is True, prints log info to the termnal. Returns a list of (atom1, atom2) for ever added bond.

convert_selenomethionines(st)

 

Convert MSE residues to METs. Returns a list of residue strings that were converted.

_set_oxygen_orders(st, mainatom, double, single, charge)

 

Sets the orders of phosphate-oxygen or sulfate-oxygen bonds.

mainatom - atom number of the phosphate or sulfur

double - list of atom numbers of the oxygens to double-bond to

single - list of atom numbers of oxygens to single-bond to, and set charge to <charge>.

extend_phosphate_states(st)

 

For specified structure, generates phosphate states, and returns list of output structures. Ev:78688

NOTE: Output structure has no hydrogens.

extend_sulfate_states(st)

 

For specified structure, generates sulfate states, and returns list of output structures. Ev:82634

get_chain_sequences(st, remove_tails=True)

 

Will read the PDB sequences from the sequence block, and will return a dictionary (keys: chain names; values: sequence strings).

If remove_tails is True, will chop off tails that are not existent in the CT, but will leave in the missing loop sections.

Will raise RuntimeError on an error, or mmerror on mmct failure.

_run_prime_job(st, keywords, prime_jobname, app=None)

 

Run the Prime job specified by the keywords on the <st> with jobname <prime_jobname>. If app is not None, the job is ran in background without freezing the GUI.

fill_missing_loops(st, fasta_file, prime_jobname, build_tail=False, app=None)

 

st - Input Structure object fasta_file - Associated .fasta file prime_jobname - Job name to use for the Prime job. build_tail - whether to build tails.

Will return a fixed Structure on success, and will raise a RuntimeError on failure.

does_res_have_missing_side_chains(residue)

 

Given a _Residue object, returns True if the residue is missing side-chain atoms. If at least one backbone atom is (also) missing, False is returned.

Basically only residues for which Prime missing-side-chains job can be run will return True.

fill_missing_side_chains(st, prime_jobname, app=None)

 

st - Input Structure object prime_jobname - Job name to use for the Prime job.

Will return a fixed Structure on success, and will raise a RuntimeError on failure.

fix_sulfur_charges(st)

 

Post process by fixing the charge on zero-order-bonded Sulfurs Gives -1 or -2 charge to Sulfurs as appropriate. Deletes a hydrogen from Sulfurs coordinating with metals (Ev:61622)

prepare_for_epik(st, het_asls, app=None)

 

Extract the structures to run Epik on from the input complex CT. Atoms in the original structure will be marked with i_ppw_anum property, to make it possible to match Epik output with the input structure.

filter_undesired_states(orig_st, state_sts)

 

Returns a subset of state structures, which excludes metal-binding states for hets that are not within 5A of a metal.

Parameters:
Returns: List of structure.Structure
List of filtered structures.

find_ppw_atom(st, anum)

 

Find the atom in the given structure whose i_ppw_anum property is set to the given value. ValueError exception is raised if such atom is not found.

apply_state(complex_st, state_st)

 

Modify the het in complex_st complex (protein/ligand) structure such that its ionization state matches the output that we got from Epik (state_st).

Parameters:
  • complex_st (structure.Structure) - Original complex structure (receptor + het)
  • state_st (structure.Structure) - Epik output for the het group. May include some atoms from the receptor if the ligand is covalently-bound.
Returns: (dict, list)
Dict mapping state_st heavy atoms to complex_st, and list of atom indices in complex_st that are part of the het.

apply_state_and_calc_score(complex_st, state_st)

 

Apply the state <state_st> to <complex_st>, and return the score for the state in the context of the protein complex.

Parameters:
  • complex_st (structure.Structure) - Original complex structure (receptor + het)
  • state_st (structure.Structure) - Epik output for the het group. May include some atoms from the receptor if the ligand is covalently-bound.
Returns: (float, float/None, str)
Tuple of state score, Epik penalty, and information string. Epik penalty will be None for metal states.

_find_waters(st)

 

Return a list of water atoms. Each item in the list is a tuple of 3 water atoms.

get_bridging_waters(st, min_hbonds=3)

 

Return a list of all waters in the specified structure that make at least <min_hbonds> number of H-bonds (H-bonds to other waters excluded). The list contains both oxygen and hydrogen atoms (if present).

hydrogen_neighbors(st, atoms)

 

Returns the list of neighbor (bonded) atoms that are hydrogens.

Parameters:
  • st (structure.Structure) - Structure where atoms are from.
  • atoms (list of ints) - List of atom indices for the heavy atoms.
Returns: list of ints.
List of hydrogen atom indices

get_pdb_id(st)

 

Returns the PDB ID of the given structure. If the property does not exist, returns the string "unknown".

get_het_name(st, het_atoms)

 

Return the het "name" to display for the user for the given het.
Example outputs:
    A:HEM (123a)
    A:GLY-VAL-PRO

@param st: Structure containing the het
@type st: L{structure.Structure}

@param het_atoms: Atoms from this het.
@type het_atoms: list of ints


Variables Details [hide private]

maxvalence

Value:
[0,
 1,
 1,
 1,
 2,
 6,
 4,
 4,
...

PDBNAME_ELEMENT_DICT

Value:
{' CD ': 'C',
 ' CD2': 'C',
 ' CE1': 'C',
 ' CG ': 'C',
 ' ND1': 'N',
 ' ND2': 'N',
 ' NE2': 'N',
 ' OD1': 'O',
...

metal_charges

Value:
{11: [1],
 12: [2],
 19: [1],
 20: [2],
 25: [2, 3, 4, 5, 6, 7],
 26: [2, 3],
 27: [2, 3],
 28: [2, 3],
...