public void CZE_RetentionTime_Test() { CZE testCZE = new CZE(1, 1); double expElutionTime = 1; double expMu = Math.Round(testCZE.ExperimentalElectrophoreticMobility(expElutionTime), 0); Assert.AreEqual(expMu, 16666667); double theoreticalElutionTime = testCZE.TheoreticalElutionTime(expMu); Assert.AreEqual(Math.Round(expElutionTime, 5), Math.Round(theoreticalElutionTime, 5)); for (int i = 0; i < _peptidesCZE.GetLength(0); i++) { var peptide = new PeptideWithSetModifications((string)_peptidesCZE[i, 0], new Dictionary <string, Modification>()); object obj = _peptidesCZE[i, 1]; double expected = (double)_peptidesCZE[i, 1]; double actual = CZE.PredictedElectrophoreticMobility(peptide.BaseSequence, peptide.MonoisotopicMass); // Round the returned value to match the values presented // in the supporting information of the SSRCalc 3 publication. // First cast to float, since the added precision of the double // caused the double representation of 12.805 to round to 12.80 // instead of 12.81. When diffed with 12.81 the result was // 0.005000000000002558. double actualRound = Math.Round((float)actual, 2); // Extra conditional added to improve debugging of issues. if (Math.Abs(expected - actual) > 0.005) { Assert.AreEqual(expected, actualRound, "Peptide {0}", peptide); } } }
public static void TestElectrophoreticMobilityPredictions() { CZE testCZE = new CZE(); double expMu = Math.Round(testCZE.ExperimentalElectrophoreticMobility(1, 1, 1), 0); Assert.AreEqual(expMu, 16666667); double predMu = Math.Round(testCZE.PredictedElectrophoreticMobility("ATPATEESTVPATQSSALPAAK", 2127.0708), 0); Assert.AreEqual(predMu, 12); }