public List <XYPair> GetIMSScanProfileFromMSFeatures() { GetMinAndMaxScanIMS(out var scanIMSMinimum, out var scanIMSMaximum); var xyPairs = new List <XYPair>(); for (var imsScan = scanIMSMinimum; imsScan <= scanIMSMaximum; imsScan++) { float summedIntensityForIMSScan = 0; foreach (var imsMsFeature in imsMsFeatureList) { summedIntensityForIMSScan += imsMsFeature.MSFeatureList.Where(p => p.ScanIMS == imsScan).Select(p => (float)p.IntensityUnSummed).Sum //note: need float due overflow exception from value exceeding int32 (); } var pair = new XYPair(imsScan, summedIntensityForIMSScan); xyPairs.Add(pair); } ConformationDetection.PadXYPairsWithZeros(ref xyPairs, 5); return(xyPairs); }
public Peak(IList <double> xValues, IList <double> yValues) { if (xValues.Count != yValues.Count) { Logger.Log("The xValues and yValues Lists must be the same size to create a Peak"); throw new InvalidOperationException("The xValues and yValues Lists must be the same size to create a Peak"); } var xyPairList = new List <XYPair>(); for (var i = 0; i < xValues.Count; i++) { var xValue = xValues[i]; var yValue = yValues[i]; var xyPair = new XYPair(xValue, yValue); xyPairList.Add(xyPair); } XYPairList = xyPairList; }