Example #1
0
        /// <summary>
        /// Constructor, using an explicit threshold
        /// </summary>
        /// <param name="setThreshold"></param>
        public MzIdentMLReader(double setThreshold)
        {
            IdentProg = IdentProgramType.Unset;

            // Disable threshold stepping by setting currentSteps beyond maxSteps
            _currentSteps = _maxSteps + 1;

            _specEValueThreshold = setThreshold;
            _mvhThreshold        = setThreshold;
            HaveScanTimes        = false;
        }
Example #2
0
        /// <summary>
        /// Read the MZIdentML file and cache the data
        /// </summary>
        /// <param name="path">Path to *.mzid/mzIdentML file</param>
        /// <returns>List of ScanData</returns>
        public List <IdentData> Read(string path)
        {
            var psmResults = new List <IdentData>();

            // Read in the file
            var mzIdentMLData = new SimpleMZIdentMLReader().Read(path);

            HaveScanTimes = false;

            IdentProg = mzIdentMLData.AnalysisSoftware switch
            {
                "MyriMatch" => IdentProgramType.MyriMatch,
                "MS-GF+" => IdentProgramType.MSGFPlus,
                _ => IdentProgramType.Unset
            };

            while (true)
            {
                psmResults.Clear();

                // Filter and process the data
                foreach (var result in mzIdentMLData.Identifications)
                {
                    ProcessSpectrumIdentificationResult(result, psmResults);
                }

                if (psmResults.Count >= 500)
                {
                    OnStatusEvent("  {0:N0} PSMs passed the filters", psmResults.Count);
                    break;
                }

                OnStatusEvent("  Fewer than 500 PSMs passed the filters ({0})", psmResults.Count);

                // Loosen the filters and try again (up to 3 times)
                if (!AdjustThreshold())
                {
                    if (psmResults.Count == 0)
                    {
                        OnWarningEvent("  No PSMs passed the filters");
                    }
                    else
                    {
                        OnStatusEvent("  Plotting errors using these PSMs");
                    }
                    break;
                }

                OnStatusEvent("  Loosening thresholds and trying again");
            }

            return(psmResults);
        }
Example #3
0
        // ReSharper disable once UnusedMember.Global

        /// <summary>
        /// Constructor, using default thresholds
        /// </summary>
        public MzIdentMLReader()
        {
            IdentProg     = IdentProgramType.Unset;
            _currentSteps = 0;
        }