Package schrodinger :: Package test :: Package stu :: Package outcomes :: Module prime_workups
[hide private]
[frames] | no frames]

Module prime_workups

Functions [hide private]
 
partial_structure_reader(filename, frames_to_check=None)
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.
 
convert_plop_name_to_asl(input_str)
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.
 
get_moved_residues(ct, ref_ct, tolerance)
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.
 
get_phi_psi(ct)
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
 
get_modified_backbone_angles(ct, ref_ct, tolerance)
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
 
check_moved_residues(filename, reference_fn, moved_residues, tolerance=0.01, check_backbone_dihedrals=False, frames_to_check=None)
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.
 
check_protein_health(filename, frames_to_check=None, steric_delta=0.3, bond_length_deviation=0.15, protein_health_kwargs=None)
Use the featurs in structurecheck to identify potential problems in the structure.
 
measure_distance(ct1, name1, ct2, name2)
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.
 
check_distance(filename, name1, name2, distance, tolerance, frames_to_check=None)
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.
 
check_torsion(filename, name1, name2, name3, name4, value, tolerance=10, frames_to_check=None)
STU workup 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.
 
check_for_residue_list(filename, residues, frames_to_check=None)
STU workup...
 
check_structure_counts(filename, atoms=None, residues=None, molecules=None, frames_to_check=None)
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.
 
determine_truth_table(filename, property, reference_property, cutoff=None, reverse=False, frames_to_check=None)
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.
 
check_prime_accuracy(min_accuracy, filename, property, reference_property, cutoff=None, reverse=False, frames_to_check=None)
STU Workup that will check if the accuracy of a predictors is more than some cutoff value and raise an assertion error otherwise usage: min_accuracy {float 0.0 - 1.0}, filename {string with path of file readable by StructureReader} property{string with the property name of predicted value stored as ct-level property in the structures within filename } reference property{string with the property name of the reference value stored as ct-level property filename} cufoff=cutoff { variable that supports >= on property (usually int or float} reverse=reverse { Boolean} frame_to_check {string with the 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.
 
check_F1_score(min_F1, filename, property, reference_property, cutoff=None, reverse=False, frames_to_check=None)
STU Workup that will check if the F1 Score of a predictors is more than some cutoff value and raise an assertion error otherwise usage: min_f1 {float 0.0 -1.0), filename {string with path of file readable by StructureReader} property{string with the property name of predicted value stored as ct-level property in the structures within filename } reference property{string with the property name of the reference value stored as ct-level property filename} cufoff=cutoff { variable that supports >= on property (usually int or float)} reverse=reverse {Boolean) frame_to_check {string with the 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.
 
check_ct_property(filename, property_name, value, tolerance='=', frames_to_check=None)
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 "<=" than use that operation instead of equals.
 
check_ct_property_unique(filename, property_name, tolerance=1e-05, frames_to_check=None)
Raise an assertion error if there are entries with duplicated values of a given ct-level property.
Variables [hide private]
  __package__ = 'schrodinger.test.stu.outcomes'
Function Details [hide private]

partial_structure_reader(filename, frames_to_check=None)

 

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.

convert_plop_name_to_asl(input_str)

 

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.

check_moved_residues(filename, reference_fn, moved_residues, tolerance=0.01, check_backbone_dihedrals=False, frames_to_check=None)

 

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

check_protein_health(filename, frames_to_check=None, steric_delta=0.3, bond_length_deviation=0.15, protein_health_kwargs=None)

 

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.

measure_distance(ct1, name1, ct2, name2)

 

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.

check_distance(filename, name1, name2, distance, tolerance, frames_to_check=None)

 

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)

check_torsion(filename, name1, name2, name3, name4, value, tolerance=10, frames_to_check=None)

 

STU workup
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_.

check_for_residue_list(filename, residues, frames_to_check=None)

 

STU workup
For the specified structure frames in a filename {string} return True
if the residues match the residues listed in residues {string,
   space separted 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)

check_structure_counts(filename, atoms=None, residues=None, molecules=None, frames_to_check=None)

 

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)

determine_truth_table(filename, property, reference_property, cutoff=None, reverse=False, frames_to_check=None)

 

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

check_prime_accuracy(min_accuracy, filename, property, reference_property, cutoff=None, reverse=False, frames_to_check=None)

 

STU Workup that will check if the accuracy of a predictors is more
than some cutoff value and raise an assertion error otherwise
usage:
    min_accuracy {float 0.0 - 1.0},
    filename {string with path of file readable by StructureReader}     
    property{string with the property name of predicted value stored as
       ct-level property in the structures within filename }
    reference property{string with the property name of the reference value 
       stored as ct-level property filename}
    cufoff=cutoff { variable that supports >= on property (usually int or 
        float}
    reverse=reverse { Boolean}
    frame_to_check {string with the 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)

check_F1_score(min_F1, filename, property, reference_property, cutoff=None, reverse=False, frames_to_check=None)

 

STU Workup that will check if the F1 Score of a predictors is more
than some cutoff value and raise an assertion error otherwise
usage:
    min_f1 {float 0.0 -1.0),
    filename {string with path of file readable by StructureReader}     
    property{string with the property name of predicted value stored as
       ct-level property in the structures within filename }
    reference property{string with the property name of the reference value 
       stored as ct-level property filename}
    cufoff=cutoff { variable that supports >= on property (usually int or 
        float)}
    reverse=reverse {Boolean) 
    frame_to_check {string with the 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)

check_ct_property(filename, property_name, value, tolerance='=', frames_to_check=None)

 

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 "<=" 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.

check_ct_property_unique(filename, property_name, tolerance=1e-05, frames_to_check=None)

 

Raise an assertion error if there are entries with duplicated values
of a given ct-level property.
Inputs:
    filename {string} Maestro formated structure file to read
    property_name {string} 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 integers} check these frames in filename
       as described in partial structure reader