Exemple #1
0
        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.");
            }
        }
Exemple #2
0
        /*
         * These are from the experiment and will be removed if you call reset on the
         * graph
         */
        public Peptide addPeptideFromIdentification(IDs id, double currentTime)
        {
            String           peptideSequence         = id.getPeptideSequence();
            double           peptideMass             = id.getPeptideMass();
            HashSet <String> parentProteinAccessions = id.getParentProteinAccessions();
            Peptide          pep;

            if (containsPeptide(peptideSequence))
            {
                return(getPeptide(peptideSequence));
            }
            else
            {
                // Adds the peptide from the identification into the database
                pep = new Peptide(peptideSequence, peptideMass, false);
                // these peptides will be removed if reset() is called
                SequenceToPeptide.Add(peptideSequence, pep);
                peptides.Add(pep);

                if (includeRetentionTime)
                {
                    // TODO right now this takes the current time as the peak retention time...
                    // should we run it through RTCalc so we can better estimate our RT alignment?
                    // 2019-04-29 No, do not. Observed times are better than predicted
                    // pep.setRetentionTime(RetentionTimeUtil.convertDoubleToRetentionTime(rt,
                    // retentionTimeWindow,
                    // retentionTimeWindow));
                    RetentionTime rt = new RetentionTime(currentTime + retentionTimeWindow, retentionTimeWindow,
                                                         retentionTimeWindow, false);
                    pep.setRetentionTime(rt);
                }
            }
            // update its parent proteins
            foreach (String acc in parentProteinAccessions)
            {
                Protein parentProtein = AccesstionToProtein[acc];
                if (parentProtein != null)
                {
                    pep.addProtein(parentProtein);
                }
                else if (acc.Contains(GlobalVar.DecoyPrefix))
                {
                    log.Info("WARNINGin Decoy parent protein for this peptide was not found!!");
                    log.Info(acc);
                }
                else
                {
                    log.Warn("WARNINGin Non-decoy parent protein for this peptide was not found!!");
                    log.Warn(acc);
                }
            }

            return(pep);
        }