public void TestSelectingMF() { var is_ = new IsotopePatternSimilarity(); IsotopePattern spExp = new IsotopePattern(new[] { new IsotopeContainer(156.07770, 1), new IsotopeContainer(157.07503, 0.0101), new IsotopeContainer(157.08059, 0.074), new IsotopeContainer(158.08135, 0.0024), }); spExp.MonoIsotope = spExp.Isotopes[0]; spExp.Charge = 1; double score = 0; string mfString = ""; string[] listMF = { "C4H8N6O", "C2H12N4O4", "C3H12N2O5", "C6H10N3O2", "CH10N5O4", "C4H14NO5" }; for (int i = 0; i < listMF.Length; i++) { IMolecularFormula formula = MolecularFormulaManipulator.GetMajorIsotopeMolecularFormula(listMF[i], builder); IsotopePatternGenerator isotopeGe = new IsotopePatternGenerator(0.01); IsotopePattern patternIsoPredicted = isotopeGe.GetIsotopes(formula); IsotopePattern patternIsoNormalize = IsotopePatternManipulator.Normalize(patternIsoPredicted); double tempScore = is_.Compare(spExp, patternIsoNormalize); if (score < tempScore) { mfString = MolecularFormulaManipulator.GetString(formula); score = tempScore; } } Assert.AreEqual("C6H10N3O2", mfString); }
public void TestIsotopePatternSimilarity() { IsotopePatternSimilarity is_ = new IsotopePatternSimilarity(); Assert.IsNotNull(is_); }