//Called by DataProcessor, entry point to Alex's program public bool evaluate(Spectra spec) { currentTime = spec.getStartTime(); updateExclusionList(spec); if (spec.getMSLevel() == 1) { log.Debug("Evaluating ms1 scan"); processMS1(spec); } else if (spec.getMSLevel() == 2) { log.Debug("evaluating ms2 scan"); if (spec.getIndex() % GlobalVar.ScansPerOutput == 0) { #if SIMULATION double progressPercent = spec.getIndex() / GlobalVar.ExperimentTotalScans * 100; log.Info("Progress: {0:F2}% Processing ID: {1}\t ScanNum: {2} \t Excluded: {3}", progressPercent, spec.getIndex(), spec.getScanNum(), excludedSpectra.Count); #else log.Info("Progress: {0}\t{1} excluded------------------------", spec.getIndex(), excludedSpectra.Count); log.Info("ExclusionListSize: {0}\tRTOffset: {1}", exclusionList.getExclusionList().Count, RetentionTime.getRetentionTimeOffset()); #endif } return(processMS2(spec)); } else { log.Debug("unrecognized msScan"); } return(true); }
protected bool processMS2(Spectra spec) { performanceEvaluator.countMS2(); log.Debug(spec); IDs id = performDatabaseSearch(spec); Boolean isExcluded = false; if (id != null) { Peptide pep = getPeptideFromIdentification(id); isExcluded = exclusionList.containsPeptide(pep); } if (isExcluded) { #if SIMULATION //log.Debug("Mass " + spectraMass + " is on the exclusion list. Scan " + spec.getScanNum() + " excluded."); evaluateExclusion(id); WriterClass.LogScanTime("Excluded", (int)spec.getIndex()); #endif performanceEvaluator.countExcludedSpectra(); excludedSpectra.Add(spec.getScanNum()); return(false); } else { performanceEvaluator.countAnalyzedSpectra(); //log.Debug("Mass " + spectraMass + " was not on the exclusion list. Scan " + spec.getScanNum() + " analyzed."); evaluateIdentification(id); includedSpectra.Add(spec.getScanNum()); // calibrate peptide if the observed retention time doesn't match the predicted //WriterClass.LogScanTime("Processed", (int)spec.getIndex()); return(true); } }
public static void parseMZML() { String mzmlPath = "/Users/lavalleelab/Desktop/JoshLab/Temp/60minMZML.csv"; MZMLFile mzml = Loader.parseMZMLCSV(mzmlPath); for (int i = 0; i < 7000; i++) { if (i % 500 == 0) { Spectra spec = mzml.getSpectraArray()[i]; Console.WriteLine("ID {0} scanNum{1} RT{2} Mass{3} MSLevel{4}", spec.getIndex(), spec.getScanNum(), spec.getStartTime(), spec.getCalculatedPrecursorMass(), spec.getMSLevel()); } } }
protected bool processMS2(Spectra spec) { performanceEvaluator.countMS2(); log.Debug(spec); IDs id = performDatabaseSearch(spec); // check if mass is on exclusion list Boolean isExcluded = false; if (id != null) { Peptide pep = getPeptideFromIdentification(id); isExcluded = exclusionList.containsPeptide(pep); //checks if the mass should've been excluded, //in a real experiment, this should never equal to true //since the mass should not have been scanned in the first place //if MS exclusion table was updated correctly through API if (!peptideRT.Keys.Contains(pep.getSequence())) { peptideRT.Add(pep.getSequence(), spec.getStartTime()); } } if (isExcluded) { #if SIMULATION //log.Debug("Mass " + spectraMass + " is on the exclusion list. Scan " + spec.getScanNum() + " excluded."); evaluateExclusion(id); WriterClass.LogScanTime("Excluded", (int)spec.getIndex()); #endif performanceEvaluator.countExcludedSpectra(); excludedSpectra.Add(spec.getScanNum()); return(false); } else { performanceEvaluator.countAnalyzedSpectra(); //log.Debug("Mass " + spectraMass + " was not on the exclusion list. Scan " + spec.getScanNum() + " analyzed."); evaluateIdentification(id); includedSpectra.Add(spec.getScanNum()); // calibrate peptide if the observed retention time doesn't match the predicted //WriterClass.LogScanTime("Processed", (int)spec.getIndex()); return(true); } }
protected virtual bool processMS2(Spectra spec) { performanceEvaluator.countMS2(); log.Debug(spec); // check if mass is on exclusion list double spectraMass = spec.getCalculatedPrecursorMass(); Boolean isExcluded = exclusionList.isExcluded(spectraMass); //checks if the mass should've been excluded, //in a real experiment, this should never equal to true //since the mass should not have been scanned in the first place //if MS exclusion table was updated correctly through API if (isExcluded) { #if (SIMULATION) IDs id = performDatabaseSearch(spec); log.Debug("Mass " + spectraMass + " is on the exclusion list. Scan " + spec.getScanNum() + " excluded."); evaluateExclusion(id); WriterClass.LogScanTime("Excluded", (int)spec.getIndex()); #endif performanceEvaluator.countExcludedSpectra(); excludedSpectra.Add(spec.getScanNum()); return(false); } else { IDs id = performDatabaseSearch(spec); performanceEvaluator.countAnalyzedSpectra(); log.Debug("Mass " + spectraMass + " was not on the exclusion list. Scan " + spec.getScanNum() + " analyzed."); evaluateIdentification(id); includedSpectra.Add(spec.getScanNum()); // calibrate peptide if the observed retention time doesn't match the predicted //WriterClass.LogScanTime("Processed", (int)spec.getIndex()); return(true); } }