public void Select(SrmTransition trans) { var intensities = (from s in trans.Intensities where s.Intensity > 0 orderby s.Intensity select s.Intensity).ToList(); if (intensities.Count > 0) { int selectedCount = (int)(intensities.Count * this.lowestPercentageForBaseline); if (selectedCount > 0) { trans.Noise = intensities.Take(selectedCount).Average(); var minIntensity = trans.Noise * minFactor; trans.Intensities.ForEach(m => m.Enabled = m.Intensity >= minIntensity); trans.KeepHighestContig(); return; } else { trans.Noise = intensities.Average(); } } else { trans.Noise = 1.0; } trans.Intensities.ForEach(m => m.Enabled = false); }
public void Select(SrmTransition trans) { var maxIntensity = trans.Intensities.Max(m => m.Intensity); if (maxIntensity > 0) { double minIntensity = maxIntensity * percentage; trans.Intensities.ForEach(m => m.Enabled = m.Intensity >= minIntensity); trans.KeepHighestContig(); } else { trans.Intensities.ForEach(m => m.Enabled = false); } }