示例#1
0
        protected void evaluateIdentification(IDs id)
        {
            // check if the peptide is identified or not
            if (id == null)
            {
                performanceEvaluator.countMS2UnidentifiedAnalyzed();
                return;
            }

            Peptide pep = getPeptideFromIdentification(id);             // id is null, it already returned

            // add decoy or non-existent protein connections
            // database.AddProteinFromIdentification(pep, id.getParentProteinAccessions());

            Double xCorr = id.getXCorr();
            Double dCN   = id.getDeltaCN();

            pep.addScore(xCorr, dCN);
#if (!DONTEVALUATE)
            performanceEvaluator.evaluateAnalysis(exclusionList, pep);
#endif

            // exclude this peptide for analysis if the xCorr score is above a threshold
            const double XCORR_THRESHOLD = 2.5;
            // add the peptide to the exclusion list if it is over the xCorr threshold
            if ((xCorr > XCORR_THRESHOLD))
            {
                performanceEvaluator.countPeptidesExcluded();
                log.Debug("xCorrThreshold passed. Peptide added to the exclusion list.");
                exclusionList.addPeptide(pep);
                // calibrates our retention time alignment if the observed time is different
                // from the predicted only if it passes this threshold
                calibrateRetentionTime(pep);
            }

            // Add all the peptides corresponding to the parent protein, if the parent
            // protein is deemed confidently identified by the logisitc regression
            // classifier
            Dictionary <String, Boolean> identificationPredictions = IdentificationFeatureExtractionUtil
                                                                     .assessProteinIdentificationConfidence(pep.getProteins(), lrAccord);

            List <Protein> proteinsToExclude = new List <Protein>();
            foreach (Protein parentProtein in pep.getProteins())
            {
                // prevents repeated exclusion of a protein already excluded
                if ((!parentProtein.IsExcluded()))
                {
                    // determine if parent protein is confidently identified
                    bool isConfidentlyIdentified = identificationPredictions[parentProtein.getAccession()];
                    if (isConfidentlyIdentified)
                    {
                        // exclude all peptides of that protein
                        parentProtein.setExcluded(true);
                        log.Debug("Parent protein " + parentProtein.getAccession() + " is identified confidently "
                                  + parentProtein.getNumDB() + " times!");
                        performanceEvaluator.countProteinsExcluded();
                        proteinsToExclude.Add(parentProtein);
                    }
                }
            }
            exclusionList.addProteins(proteinsToExclude);
        }
        protected void evaluateIdentification(IDs id)
        {
            // check if the peptide is identified or not
            if (id == null)
            {
                performanceEvaluator.countMS2UnidentifiedAnalyzed();
                return;
            }

            Peptide pep = getPeptideFromIdentification(id); // id is null, it already returned

            //log.Info("Peptide Observed Time: {0}\tPredicted Time: {1} -----------------", id.getScanTime(),pep.getRetentionTime().getRetentionTimeStart());


            // add decoy or non-existent protein connections
            // database.AddProteinFromIdentification(pep, id.getParentProteinAccessions());

            Double xCorr = id.getXCorr();
            double dCN   = id.getDeltaCN();

            pep.addScore(xCorr, dCN);
#if (!DONTEVALUATE)
            performanceEvaluator.evaluateAnalysis(exclusionList, pep);
#endif

            //RetentionTime rt = pep.getRetentionTime();
            //if (!rtCalcPredictedRT.Keys.Contains(pep.getSequence()))
            //{
            //	rtCalcPredictedRT.Add(pep.getSequence(), rt.getRetentionTimePeak());
            //}
            //double[] values = new double[] { id.getScanTime(), id.getXCorr(), rt.getRetentionTimePeak(), rt.getRetentionTimeStart() + GlobalVar.retentionTimeWindowSize, RetentionTime.getRetentionTimeOffset(), rtCalcPredictedRT[pep.getSequence()], rt.IsPredicted() ? 1 : 0 };

            // exclude this peptide for analysis if the xCorr score is above a threshold
            const double XCORR_THRESHOLD = 2.5;
            // add the peptide to the exclusion list if it is over the xCorr threshold
            if ((xCorr > XCORR_THRESHOLD))
            {
                performanceEvaluator.countPeptidesExcluded();
                log.Debug("xCorrThreshold passed. Peptide added to the exclusion list.");
                exclusionList.addPeptide(pep);
                // calibrates our retention time alignment if the observed time is different
                // from the predicted only if it passes this threshold
                calibrateRetentionTime(pep);
            }

            // Add all the peptides corresponding to the parent protein, if the parent
            // protein is deemed confidently identified by the logisitc regression
            // classifier
            Dictionary <String, Boolean> identificationPredictions = IdentificationFeatureExtractionUtil
                                                                     .assessProteinIdentificationConfidence(pep.getProteins(), lrAccord);

            List <Protein> proteinsToExclude = new List <Protein>();
            foreach (Protein parentProtein in pep.getProteins())
            {
                // prevents repeated exclusion of a protein already excluded
                if ((!parentProtein.IsExcluded()))
                {
                    // determine if parent protein is confidently identified
                    bool isConfidentlyIdentified = identificationPredictions[parentProtein.getAccession()];
                    if (isConfidentlyIdentified)
                    {
                        // exclude all peptides of that protein
#if TRACKEXCLUDEDPROTEINFEATURE
                        excludedProteinFeatureList.Add(parentProtein.vectorize().ItemArray);
#endif
                        parentProtein.setExcluded(true);
                        log.Debug("Parent protein " + parentProtein.getAccession() + " is identified confidently "
                                  + parentProtein.getNumDB() + " times!");
                        performanceEvaluator.countProteinsExcluded();
                        proteinsToExclude.Add(parentProtein);
                    }
                }
            }
            exclusionList.addProteins(proteinsToExclude);
        }