private void setRetentionTimes() { // if retention time isn't included, do nothing if (includeRetentionTime) { // compute the retention times if not already computed if (peptideRetentionTimes == null) { peptideRetentionTimes = RetentionTimeUtil.calculateRetentionTime(peptides); if (GlobalVar.useMeasuredRT) { MealTimeMS.Tester.RandomTesterFunctions.LoadAndReplaceRT(ref peptideRetentionTimes); } } log.Debug("Setting retention times..."); log.Debug("Retention time window size: " + retentionTimeWindow); foreach (String peptideSequence in peptideRetentionTimes.Keys) { Peptide pep = getPeptide(peptideSequence); double rt = peptideRetentionTimes[peptideSequence]; pep.setRetentionTime( RetentionTimeUtil.convertDoubleToRetentionTime(rt, retentionTimeWindow, retentionTimeWindow)); } log.Debug("Done setting retention times."); } }
/*- * Reset the exclusion list and any scores in the database */ public void reset() { database.reset(); exclusionList.reset(); performanceEvaluator.clear(); includedSpectra.Clear(); excludedSpectra.Clear(); RetentionTimeUtil.resetRTOffset(); }
/* * Computes the difference between the predicted retention time and when we * actually observed this peptide. This difference is then used to calibrate the * retention time using the RetentionTimeCalibrator class by calculating a * retention time offset. This offset will shift all retention time windows by * this value. */ protected void calibrateRetentionTime(Peptide pep) //called when we observe a peptide that passes the xcorr threshold { bool isPredictedRT = pep.getRetentionTime().IsPredicted(); // if isPredictedRT is true, then that means this is the first time you observed it // if false, then you already have observed it and would have already // readjusted the offset, so no need to to it again. // isPredictedRT is false means that you have observed it before, excluded it, but then //it shows up again if (isPredictedRT) { // only calibrate RT prediction if it was a predicted peptide... // peptides which were observed should not affect RT prediction calibration double predictedRT = pep.getRetentionTime().getRetentionTimePeak(); double rtPredictionError = currentTime - predictedRT; double newOffset = RetentionTimeUtil.computeRTOffset(rtPredictionError, currentTime); RetentionTime.setRetentionTimeOffset(newOffset); performanceEvaluator.countPeptideCalibration(); } //changes the status of the peptide from isPredicted = true to false, because now you have observed it exclusionList.observedPeptide(pep, currentTime, database.getRetentionTimeWindow()); }