/// <summary> /// Constructor for the <see cref="IsotopePatternRule"/> object. /// </summary> public IsotopePatternRule() { isotopeGe = new IsotopePatternGenerator(0.01); isotopePatternSimilarity = new IsotopePatternSimilarity { Tolerance = toleranceMass }; }
/// <summary> /// Validate the isotope pattern of this <see cref="IMolecularFormula"/>. Important, first /// you have to add with the <see cref="Parameters"/> a <see cref="IMolecularFormulaSet"/> /// which represents the isotope pattern to compare. /// </summary> /// <param name="formula">Parameter is the <see cref="IMolecularFormula"/></param> /// <returns>A double value meaning 1.0 True, 0.0 False</returns> public double Validate(IMolecularFormula formula) { Trace.TraceInformation("Start validation of ", formula); IsotopePatternGenerator isotopeGe = new IsotopePatternGenerator(0.1); IsotopePattern patternIsoPredicted = isotopeGe.GetIsotopes(formula); IsotopePattern patternIsoNormalize = IsotopePatternManipulator.Normalize(patternIsoPredicted); return(isotopePatternSimilarity.Compare(pattern, patternIsoNormalize)); }