예제 #1
0
        /// <summary>
        /// Return a list of peaks, where each peak has the maximum score in its transition group,
        /// and its q-value is less than the cutoff value.
        /// </summary>
        /// <param name="qValueCutoff">Cutoff q-value.</param>
        /// <param name="lambda">Optional p-value cutoff for calculating Pi-zero.</param>
        /// <param name="decoyScoredGroupPeaks">Decoy transition groups.</param>
        /// <returns>List of peaks the meet the criteria.</returns>
        public List <ScoredPeak> SelectTruePeaks(double qValueCutoff, double?lambda, ScoredGroupPeaksSet decoyScoredGroupPeaks)
        {
            // Get max peak score for each transition group.
            var targetScores = GetMaxScores();
            var decoyScores  = decoyScoredGroupPeaks.GetMaxScores();

            // Calculate statistics for each set of scores.
            var statDecoys = new Statistics(decoyScores);
            var statTarget = new Statistics(targetScores);

            // Calculate q values from decoy set.
            var pvalues = statDecoys.PvaluesNorm(statTarget);
            var qvalues = new Statistics(pvalues).Qvalues(lambda);

            // Select max peak with q value less than the cutoff from each target group.
            var truePeaks = new List <ScoredPeak>(_scoredGroupPeaksList.Count);

            for (int i = 0; i < _scoredGroupPeaksList.Count; i++)
            {
                if (qvalues[i] <= qValueCutoff)
                {
                    truePeaks.Add(_scoredGroupPeaksList[i].MaxPeak);
                }
            }
            return(truePeaks);
        }
예제 #2
0
        private double[] CalcPValues(ScoredGroupPeaksSet decoyScoredGroupPeaks, bool nonParametric = false)
        {
            // Get max peak score for each transition group.
            var targetScores = GetMaxScores();
            var decoyScores  = decoyScoredGroupPeaks.GetMaxScores();

            // Calculate statistics for each set of scores.
            var statDecoys = new Statistics(decoyScores);
            var statTarget = new Statistics(targetScores);

            return(nonParametric
                ? statDecoys.PvaluesNull(statTarget)
                : statDecoys.PvaluesNorm(statTarget));
        }