forgi.threedee.model.similarity module¶
-
class
forgi.threedee.model.similarity.
AdjacencyCorrelation
(reference_cg, distance=25.0, bp_distance=16)[source]¶ Bases:
future.types.newobject.newobject
A class used for calculating the ACC.
The adjacency correlation coefficient is calculated as the Matthews correlation coefficient of potential interactions, defined as nucleotides within 25 Angstrom from each other. See chapter 9.3 of Peter’s thesis.
This object is initialized with a reference structure and a distance for interactions. The evaluate() method is used for calculating this correlation matrix.
This is significantly faster than the confusion_matrix function, if many structures will be compared to the same reference structure.
-
evaluate
(cg)[source]¶ Calculate the true_positive, false_positive, true_negative and false_negative rate for the tertiary distances of the elements of cg and the reference structure stored in this class.
Parameters: cg – The coarse grain model with which self.reference_cg should be compared. Note: The result is only meaningful, if both coarse grained models correspond to the same RNA. Returns: A dictionary like this: {"tp": tp, "tn": tn, "fp": fp, "fn": fn}
-
-
forgi.threedee.model.similarity.
cg_rmsd
(cg1, cg2)[source]¶ Calculate the RMSD between two Coarse Grain models using their set of virtual residues.
Parameters: - cg1 – The first coarse grain model.
- cg2 – The second coarse-grain model.
Returns: The RMSD
-
forgi.threedee.model.similarity.
rmsd
(crds1, crds2, is_centered=False)¶ Center the coordinate vectors on their centroid and then calculate the rmsd.
-
forgi.threedee.model.similarity.
drmsd
(coords1, coords2)[source]¶ Calculate the dRMSD measure.
This should be the RMSD between all of the inter-atom distances in two structures.
Parameters: - coords1 – The vectors of the ‘atoms’ in the first structure.
- coords2 – The vectors of the ‘atoms’ in the second structure.
Returns: The dRMSD measure.