private List <double> ListApes(TracerDef tracerDef) { var apes = new List <double>(); if (_stepsize != 0) { double ape1 = Math.Min(tracerDef.InitialApe, tracerDef.FinalApe); double ape2 = Math.Max(tracerDef.InitialApe, tracerDef.FinalApe); for (double ape = ape1; ape < ape2; ape += _stepsize) { apes.Add(ape); } apes.Add(ape2); } else { apes.Add(tracerDef.InitialApe); for (int i = 0; i < _intermediateLevels; i++) { var ape = (tracerDef.InitialApe * (_intermediateLevels - i) + tracerDef.FinalApe * (i + 1)) / (_intermediateLevels + 1); apes.Add(ape); } apes.Add(tracerDef.FinalApe); apes.Sort(); } var result = new List <double>(); foreach (double ape in apes) { double apeInt = Math.Floor(ape); if (result.Count == 0 || apeInt != result[result.Count - 1]) { result.Add(apeInt); } } return(result); }
private double GetTracerPercent(TracerDef tracerDef, IDictionary<TracerFormula, double> distribution) { int maxTracerCount = tracerDef.GetMaximumTracerCount(PeptideFileAnalysis.Peptide.Sequence); if (maxTracerCount == 0) { return 0; } double result = 0; foreach (var entry in distribution) { result += entry.Key.GetElementCount(tracerDef.Name) * 100.0 / maxTracerCount * entry.Value; } return result; }