schrodinger.test.stu.outcomes.prime_workups module

schrodinger.test.stu.outcomes.prime_workups.partial_structure_reader(filename, frames_to_check=None)[source]

Iterator that returns the specified frames of the structures in filename {structure} By default return all frames, but if frames_to_check { list, set or anything with an “__in__” method” of integers} is set then the only frames for which their index (starting with 0) are in frames to check are returned. Note that even if a list is passed with integers out of order, the frames will always be yielded in the order that they are in the file.

schrodinger.test.stu.outcomes.prime_workups.convert_plop_name_to_asl(input_str)[source]

Convert a string specifying a residue or atom into an asl expresion Input should be in the form <chain>:<resnum><inscode> or <chain>:<resnum><inscore>:<pdb atom name>

<chain> is the chain id or a _ or no character if space <resnum> is the residue number (possibly negative) <inscode> is the pdb insertion code <pdb atom name> The 4 letter pdb atom name. Either spaces or _ can be used for padding to get to 4 characters. Examples A:12 :23A B:-1 _:12

The output is a ASL expression stored as a string that corresponds to the same atom(s) in the input.

schrodinger.test.stu.outcomes.prime_workups.get_moved_residues(ct, ref_ct, tolerance)[source]

For a given ct {structure.Stucture} and ref_ct {structure.Structure} with the same number of atoms in the same order, return a sorted list with all the residue names (__str__() evaluation of their associated structure._Residue class) that contains atoms that moved more than a tolerance {float} in Angstroms.

schrodinger.test.stu.outcomes.prime_workups.get_phi_psi(ct)[source]

Return a dictionary with the key being the name of each residues and the value being a 2 member list containing the PHI and PSI angles of that residue

schrodinger.test.stu.outcomes.prime_workups.get_modified_backbone_angles(ct, ref_ct, tolerance)[source]

For a given ct {structure.Stucture} and ref_ct {structure.Structure} with the same number of atoms in the same order, return a sorted list with all the residue names (__str__() evaluation of their associated structure._Residue class) that contains atoms that moved either phi or psi angles more than tolerance {float} in degrees

schrodinger.test.stu.outcomes.prime_workups.check_moved_residues(filename, reference_fn, moved_residues, tolerance=0.01, check_backbone_dihedrals=False, frames_to_check=None)[source]

STU workup that will check to see if a list of moved residues { string the residue names (__str__() evaluation of the structure._Residue class) separated by spaces} corresponds to the list of all residue that have an an atom that moved more than tolerance {float} between any of the frames_to_check in filename (see partial_structure_reader) and the first structure frame in reference_fn. Returns True if the lists match, False if they dont if check_bacbone_dihedrals{logical} is True then check use the residues that either their phi or psi angle moved by more than tolerance degrees are used instead of distance in cartesian space

schrodinger.test.stu.outcomes.prime_workups.check_protein_health(filename, frames_to_check=None, steric_delta=0.3, bond_length_deviation=0.15, protein_health_kwargs=None)[source]

Use the featurs in structurecheck to identify potential problems in the structure. By default this will find any instances where there is a steric clash of more than 30% of the vdW radius (set by steric delta {float}) or any bond length deviations of more than 0.15 angstroms (set by bond_length_deviation {float}) The number of allowable clashes, bond length deviations and other structual properties can be set by passing a dictionary into protein_health_kwargs {dict} as decirbed in the help for structurecheck.ProteinReportCheck. frames_to_check is descirbed above Note that protein_health_kwargs needs to have a dictionary passed to it to be useful as a STU test. Currently STU does not allow this.

schrodinger.test.stu.outcomes.prime_workups.measure_distance(ct1, name1, ct2, name2)[source]

For a given structure ct1 {structure.Structure} and the Plop residue or atom name name1 {string, described convert_plop_name_to_asl} and a second ct2 {structure.Structure}, name2 {string} pair following the same convention, return the minimum distance between the two. If either name matches no values in the structure then None is returned.

schrodinger.test.stu.outcomes.prime_workups.check_distance(filename, name1, name2, distance, tolerance, frames_to_check=None)[source]

STU workup For the specified structure frames in a filename {string} return True if the minimum distance between the atom or residue name1 {string} is distance {float} +- tolerance{float} Angstroms. Otherwise return false (see partial_structrue_reader for description of frames_to check)

schrodinger.test.stu.outcomes.prime_workups.check_torsion(filename, name1, name2, name3, name4, value, tolerance=10, frames_to_check=None)[source]

For the specified structure frames in a filename {string} return True if the torsion between atoms with names name1-4 {string} is value {float} +- tolerance{float} degrees. Otherwise return false (see partial_structure_reader for description of frames_to check) The format for name is <chain>:<residue number>:<pdb atom name> where a _ is replaced with a space (note that the <pdb atom name> should be 4 characters and padded with _ for spaces ie A:12:_CA_.

schrodinger.test.stu.outcomes.prime_workups.check_for_residue_list(filename, residues, frames_to_check=None)[source]

For the specified structure frames in a filename {string} return True if the residues match the residues listed in residues {string, space seperated list of residue names as given by the __str__ operator of structure._Residue} then return True. (see partial_structrue_reader for description of frames_to check)

schrodinger.test.stu.outcomes.prime_workups.check_structure_counts(filename, atoms=None, residues=None, molecules=None, frames_to_check=None)[source]

STU workup For the specified structure frames in a filename {string} return True if all contain the specified numbers of atoms{integer}, residues{integer}, and molecules{integer}, If any of these are not set then that test is skipped. Otherwise return False. (see partial_structrue_reader for description of frames_to check)

schrodinger.test.stu.outcomes.prime_workups.determine_truth_table(filename, property, reference_property, cutoff=None, reverse=False, frames_to_check=None)[source]

Return a truth table as a dictionary with keys tp, tn, fp, fn & “no prediction” with the number of frames where the prediction is a True Positive, True Negative, False Positive, False Negative, or no prediction was provided.

For an input filename{string} containing one or more structures readable by StructureReader.

property{string} the property name of predicted value stored as ct-level property filename

referecne property{string} the property name of true value stored as ct-level property filename

By default the value in property will be converted to a boolean, however the cutoff {variable that supports >=} is defined then a predicted value of True will given whenever the value is greater than this cutoff.

If reverse is True then the predicted value will be reversed (this makes the most sense when cutoff is also used)

frame_to_check is passed to partial_structure_reader

schrodinger.test.stu.outcomes.prime_workups.check_prime_accuracy(min_accuracy, filename, property, reference_property, cutoff=None, reverse=False, frames_to_check=None)[source]

STU Workup that will check if the accuracy of a predictors is more than some cutoff value and raise an assertion error otherwise usage:

Parameters
  • min_accuracy (float) – 0.0 - 1.0

  • filename (str) – path of file readable by StructureReader

  • property (str) – property name of predicted value stored as ct-level property in the structures within filename

  • reference_property (str) – property name of the reference value stored as ct-level property filename

  • cutoff (int or float) – variable that supports >= on property

  • frame_to_check – indicies of frames within filename to process

By default the value in property will be converted to a boolean, however the cutoff {variable that supports >=} is defined then a predicted value of True will given whenever the value is greater than this cutoff.

If reverse is True then the predicted value will be reversed (this makes the most sense when cutoff is also used).

schrodinger.test.stu.outcomes.prime_workups.check_F1_score(min_F1, filename, property, reference_property, cutoff=None, reverse=False, frames_to_check=None)[source]

STU Workup that will check if the F1 Score of a predictors is more than some cutoff value and raise an assertion error otherwise

Parameters
  • min_f1 (float) – 0.0 -1.0

  • filename (str) – path of file readable by StructureReader

  • property (str) – property name of predicted value stored as ct-level property in the structures within filename

  • reference_property (str) – property name of the reference value stored as ct-level property filename

  • cufoff – cutoff variable that supports >= on property

  • reverse (bool) – reverse

  • frame_to_check – indicies of frames within filename to process

By default the value in property will be converted to a boolean, however the cutoff {variable that supports >=} is defined then a predicted value of True will given whenever the value is greater than this cutoff.

If reverse is True then the predicted value will be reversed (this makes the most sense when cutoff is also used)

schrodinger.test.stu.outcomes.prime_workups.check_ct_property(filename, property_name, value, tolerance='=', frames_to_check=None)[source]

STU Workup For a specified structure in a filename {string} return True if the property named property_name{string} is equal to value {any type} If tolerance is “>”, “<”, “>=”, “<=” or “in” than use that operation instead of equals. Otherwise is tolerance is provided and not in the above list than return True iff all frames are within tolerance of value.

schrodinger.test.stu.outcomes.prime_workups.check_ct_property_unique(filename, property_name, tolerance=1e-05, frames_to_check=None)[source]

Raise an AssertionError if there are entries with duplicated values of a given ct-level property.

Parameters
  • filename (str) – Maestro formated structure file to read

  • property_name – ct-level property name. This should start with r_ or i_

  • tolerance (float) – Values within this tolerance are considered equal

  • frames_to_check (list of int) – check these frames in filename as described in partial structure reader

schrodinger.test.stu.outcomes.prime_workups.check_hbond(filename, name1, name2, frames_to_check=None, distance_max=2.5, donor_angle=120, acceptor_angle=90)[source]

Return True if the atom pair specified by name1 and name2 is a hydrogen bond in every frame in a structure file.

For example, check_hbond('some_file.maegz', 'A:1:H', 'A:4:O')

Parameters

frames_to_check (list(int)) – Only cts in filename for which their index (starting with 0) are in frames_to_check are returned.

For example, check_hbond('some_file.maegz', 'A:1:H', 'A:4:O', "[0, 6, 2]") will check_hbonds in cts zero, six, and two. All selected cts must have the defined hbond for this check to return True

If this argument is not set, then all cts in filename are checked.

distance_max, donor_angleh, acceptor_angle: See description in schrodinger.structutils.interactions.hbond.match_hbond

schrodinger.test.stu.outcomes.prime_workups.check_position(filename, name, target_x, target_y, target_z, tolerance, frames_to_check=None)[source]

For the specified structures in a filename string return True if the specified residue or atom identified by name is within tolerance of the coordinate at target_x, target_y, target_z.

If a residue is given, then any atom within tolerance of the target coordinates will return True.

The distance must be less than or equal to the tolerance.

For example:

check_position('some_file.maegz', 'A:1', 2.38, 0.91, 3.79, 1.0)
Parameters

frames_to_check (Only cts in filename for which their index (starting with 0) are in frames_to_check are returned.) – list(int)

For example:

check_position('some_file.maegz', 'A:1', 2.38, 0.91, 3.79, 1.0,
               "[0, 6, 2]")

will check the position of residue A:1 in cts zero, six, and two. All selected cts must individually return True for check_position to return True.

If this argument is not set, then all cts in filename are checked.

schrodinger.test.stu.outcomes.prime_workups.check_sequence(filename, chain, sequence)[source]

Check that the first structure in a file has a given 1-letter sequence inputs:

Parameters
  • filename (str) – Maestro formatted file to check

  • chain (str (string of length 1 character)) – Chain name to check

  • sequence (str of upper-case single character protein codes) – protein sequence to check for. The sequence given here must match that in the structure file exactly to pass. Any chain breaks (no matter the length in sequence space (ie A:2 - A:3 or A:2 to A:103)) are represented by a “-“

Returns

True is returned if this criteria is met, An AssertionError is raised if this criteria is not met.

Return type

bool