/// <summary> /// Handle a single SpectrumIdentificationResult element and child nodes /// Called by ReadSpectrumIdentificationList (xml hierarchy) /// </summary> /// <param name="result">PSM result</param> /// <param name="psmResults"></param> private void ProcessSpectrumIdentificationResult(SimpleMZIdentMLReader.SpectrumIdItem result, ICollection <IdentData> psmResults) { var data = new IdentData { NativeId = result.NativeId, ScanId = (ulong)result.ScanNum, ScanTimeSeconds = result.ScanTimeMinutes * 60, CalcMz = result.CalMz, ExperMz = result.ExperimentalMz, Charge = result.Charge, ThresholdValue = result.SpecEv // MS-GF:SpecEValue }; //data.MassError = data.ExperMz - data.CalcMz; //data.PpmError = (data.MassError / data.CalcMz) * 1.0e6; if (IdentProg == IdentProgramType.MyriMatch && result.AllParamsDict.TryGetValue("MyriMatch:MVH", out var valueText) && double.TryParse(valueText, out var value)) { data.ThresholdValue = value; } if (PassesThreshold(data) && PassesWindows(data)) { psmResults.Add(data); } if (data.ScanTimeSeconds > 0) { HaveScanTimes = true; } }
private bool PassesThreshold(IdentData data) { if (IdentProg == IdentProgramType.MSGFPlus) { return(data.ThresholdValue <= _specEValueThreshold); } if (IdentProg == IdentProgramType.MyriMatch) { return(data.ThresholdValue >= _mvhThreshold); } // If neither, return everything return(true); }
private bool PassesWindows(IdentData data) { return(-IsotopeErrorFilterWindow < data.MassError && data.MassError < IsotopeErrorFilterWindow && -PpmErrorFilterWindow < data.PpmError && data.PpmError < PpmErrorFilterWindow); }