/*
         * Pre-requisite: the peptide p was selected to be excluded from analysis, and
         * thus its mass is on the exclusion list Purpose: check if the sequence of
         * peptide p is truly on the exclusion list or not. If the sequence is not on
         * the exclusion list, then the peptide was incorrectly excluded. This is
         * because the mass is on the current exclusion list
         */
        public void evaluateExclusion(ExclusionList exclusionList, Peptide p)
        {
            log.Debug("Evaluating peptide mass exclusion...");

            //		// // sanity check for the pre-requisite
            //		if (!exclusionList.isExcluded(p.getMass())) {
            //			// log.Warn(
            //			// "ERROR: Theoretical peptide mass was found on the exclusion list, but was
            //			// excluded... the spectra mass does not match the mass of the theoretical
            //			// database.");
            //			numWarnings_EvaluateExclusion++;
            //			// return;
            //		}
#if WRITE_RT_TIME
            WriteRetention(String.Format("EX\t{0}\t{1}", exclusionList.getCurrentTime(), p.getRetentionTime().getRetentionTimeStart()));
#endif
            if (containsPeptideSequence(exclusionList.getExclusionList(), p))
            {
                if (isOnCurrentExclusionList(exclusionList, p))
                {
                    log.Debug("Peptide sequence was found on the exclusion list! This is what we want.");
                    incrementValue(Header.EvaluateExclusion_FoundOnCurrentExclusionList);
                }
                else if (isOnFutureExclusionList(exclusionList, p))
                {
                    log.Debug("Peptide sequence was found on the future exclusion list.");
                    incrementValue(Header.EvaluateExclusion_FoundOnFutureExclusionList);
                }
                else if (isOnPastExclusionList(exclusionList, p))
                {
                    log.Debug("Peptide sequence was found on the past exclusion list.");
                    incrementValue(Header.EvaluateExclusion_FoundOnPastExclusionList);
                }
                else if (isOnPastObservedExclusionList(exclusionList, p))
                {
                    log.Debug("Peptide sequence was found on the past observed exclusion list.");
                    // this means that this peptide sequence was excluded, but not anymore
                    incrementValue(Header.EvaluateExclusion_FoundOnPastObservedExclusionList);
                }
                else if (isOnCurrentObservedExclusionList(exclusionList, p))
                {
                    log.Debug("Peptide sequence was found on the observed exclusion list! This is what we want.");
                    incrementValue(Header.EvaluateExclusion_FoundOnCurrentObservedExclusionList);
                }
            }
            else
            {
                log.Debug("Peptide sequence was not found on any of the lists! It was wrongly excluded!");
                // TODO figure out why this is happening.........
                // Solved: if a peptide not on the ex list has a similar mass within ppm tolorence of a peptide that's supposed to be excluded, this will happen
                incrementValue(Header.EvaluateExclusion_NotFoundOnExclusionList);
            }
            incrementValue(Header.TotalNumEvaluateExclusion);
        }
        public void evaluateAnalysis(ExclusionList exclusionList, Peptide p)
        {
            log.Debug("Evaluating peptide analysis...");
#if WRITE_RT_TIME
            WriteRetention(String.Format("AN\t{0}\t{1}", exclusionList.getCurrentTime(), p.getRetentionTime().getRetentionTimeStart()));
#endif
            // // sanity check for the pre-requisite
            // if (exclusionList.isExcluded(p.getMass())) {
            // // log.Warn(
            // // "ERROR: Theoretical peptide mass was found on the exclusion list, but was
            // // analyzed... the spectra mass does not match the mass of the theoretical
            // // database.");
            // numWarnings_EvaluateAnalysis++;
            // }

            if (containsPeptideSequence(exclusionList.getExclusionList(), p))
            {
                if (isOnCurrentExclusionList(exclusionList, p))
                {
                    WriteEvaluation("Peptide sequence was found in the current exclusion list, but was analyzed anyways");
                    log.Debug("Peptide sequence was found in the current exclusion list, but was analyzed anyways");
                    log.Debug("Mass of peptide: " + p.getMass());
                    log.Debug("ppmTolerance: " + exclusionList.getPPMTolerance());
                    // this means the ppm mass tolerance is not high enough
                    // it's on the EL but not excluded this is a ppm tolerance problem
                    incrementValue(Header.EvaluateAnalysis_FoundOnCurrentExclusionList);
                }
                else if (isOnFutureExclusionList(exclusionList, p))
                {
                    WriteEvaluation("Peptide sequence was found on the future exclusion list.");
                    log.Debug("Peptide sequence was found on the future exclusion list.");
                    log.Debug("Retention time of peptide: " + p.getRetentionTime());
                    log.Debug("current_time: " + exclusionList.getCurrentTime());
                    // this means that this peptide sequence is to be excluded, but not rn
                    // this is a retention time prediction problem
                    incrementValue(Header.EvaluateAnalysis_FoundOnFutureExclusionList);
                }
                else if (isOnPastExclusionList(exclusionList, p))
                {
                    WriteEvaluation("Peptide sequence was found on the past exclusion list.");
                    log.Debug("Peptide sequence was found on the past exclusion list.");
                    log.Debug("Retention time of peptide: " + p.getRetentionTime());
                    log.Debug("current_time: " + exclusionList.getCurrentTime());
                    // this means that this peptide sequence was excluded, but not anymore
                    // this is a retention time prediction problem
                    incrementValue(Header.EvaluateAnalysis_FoundOnPastExclusionList);
                }
                else if (isOnPastObservedExclusionList(exclusionList, p))
                {
                    WriteEvaluation("Peptide sequence was found on the past observed exclusion list.");
                    log.Debug("Peptide sequence was found on the past observed exclusion list.");
                    // this means that this peptide sequence was excluded, but not anymore
                    incrementValue(Header.EvaluateAnalysis_FoundOnPastObservedExclusionList);
                }
                else if (isOnCurrentObservedExclusionList(exclusionList, p))
                {
                    WriteEvaluation("Peptide sequence was found on the observed exclusion list but was analyzed anyways.");
                    log.Debug("Peptide sequence was found on the observed exclusion list but was analyzed anyways.");
                    log.Debug("Retention time of peptide: " + p.getRetentionTime());
                    log.Debug("current_time: " + exclusionList.getCurrentTime());
                    log.Debug("Mass of peptide: " + p.getMass());
                    log.Debug("ppmTolerance: " + exclusionList.getPPMTolerance());
                    incrementValue(Header.EvaluateAnalysis_FoundOnCurrentObservedExclusionList);
                }
            }
            else
            {
                WriteEvaluation("Peptide sequence was not found on any of the lists!");
                log.Debug("Peptide sequence was not found on any of the lists!");
                incrementValue(Header.EvaluateAnalysis_NotFoundOnExclusionList);
            }
            incrementValue(Header.TotalNumEvaluateAnalysis);
            count++;
        }