/// <summary> /// Calculates the Root-Mean-Squared Deviation(RMSD) between the two proteins using alpha carbons. /// The RMSD is the square root of the mean of the distance between a set of points. /// The set of points it examines comprise the alpha carbon backbone of the proteins. This exludes the side atoms. /// It calls Nearest(int) to populate the list that it uses to determine RMSD and sums the squared of the returned distance. /// It divides that by the number of alpha carbons to get the mean, which is the then rooted to get the RMSD. /// Also marks the atom pair with the greatest distance. /// </summary> /// <returns>The RMSD between the two proteins' alpha carbon backbone.</returns> private double RMSD() { RMSDDictClear(); int count = 0; double SumDist = 0; for(int i = 0; i < Protein1.Count; i++) { if (Protein1.Atoms[i].CA) { double dist = Nearest(i); SumDist += dist*dist; count++; } } m_maxDistPair = m_CAPair.Max(); return Math.Sqrt(SumDist/ count); }
/// <summary> /// Clears the list associated with finding RMSD. Resets the value of the ResNumPair with the greatest distance. /// </summary> private void RMSDDictClear() { m_CAPair.Clear(); m_maxDistPair = new ResNumPair(); }