private void AddIsotopesToPlots() { if (this.CurrentFeature == null) { return; } var precursor = new Feature(this.CurrentFeature.Statistics); var precursorBoundary = precursor.GetBoundary(); foreach (var isotopeEntry in this.IsotopeFeaturesDictionary) { var isotopeName = isotopeEntry.Key; foreach (var featureBlob in isotopeEntry.Value) { var feature = new Feature(featureBlob.Statistics); var boundary = feature.GetBoundary(); var intersection = Rectangle.Intersect(precursorBoundary, boundary); // Ignore features that do not intersect at all if (intersection.IsEmpty) { continue; } AddToLcPlot(featureBlob, isotopeName, OxyColors.DeepSkyBlue); AddToImsPlot(featureBlob, isotopeName, OxyColors.DeepSkyBlue); } } }
private void MatchPrecursorToFragments() { if (this.CurrentFeature == null) { return; } var precursor = new Feature(this.CurrentFeature.Statistics); var precursorBoundary = precursor.GetBoundary(); foreach (var kvp in this.FragmentFeaturesDictionary) { var ionTypeTuple = kvp.Key; // Skip any fragments that do not meet the UI filter criteria if (!ShouldShowFragment(ionTypeTuple)) { continue; } var residueNumber = ionTypeTuple.Item2; var fragmentName = ionTypeTuple.Item1.GetName(residueNumber); var fragmentFeatureList = kvp.Value; foreach (var fragmentFeature in fragmentFeatureList) { var feature = new Feature(fragmentFeature.Statistics); var fragmentBoundary = feature.GetBoundary(); var intersection = Rectangle.Intersect(precursorBoundary, fragmentBoundary); // Ignore fragment features that do not intersect at all if (intersection.IsEmpty) { continue; } AddToLcPlot(fragmentFeature, fragmentName, OxyColors.Red); AddToImsPlot(fragmentFeature, fragmentName, OxyColors.Red); } } }