-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Description
Hi,
As part of MS²Rescore, which uses Mokapot, which uses Triqler for PEP calculation, we received an error report with a non-descriptive IndexError (CompOmics/ms2rescore#165 (comment)). This occurred because the input score distribution only contain 0 and 100. It therefore makes sense that PEP values could not be calculated. Perhaps a more descriptive error message could be produced?
Here's the relevant part of the stack trace:
File mokapot/confidence.py:476, in LinearConfidence._assign_confidence(self, desc)
474 LOGGER.info("Assiging PEPs to %s...", level)
475 try:
--> 476 _, pep = qvality.getQvaluesFromScores(
477 scores[targets], scores[~targets], includeDecoys=True
478 )
479 except SystemExit as msg:
480 if "no decoy hits available for PEP calculation" in str(msg):
File triqler/qvality.py:80, in getQvaluesFromScores(targetScores, decoyScores, includePEPs, includeDecoys, tdcInput, pi0, plotRegressionCurve, numBins)
77 if plotRegressionCurve:
78 scoresForPlot = evalScores.copy()
---> 80 probs = factor * np.exp(splineEval(evalScores, medians, variables))
81 probs = monotonize(probs)
83 if plotRegressionCurve:
File triqler/qvality.py:334, in splineEval(scores, medians, variables)
325 derr = (g[1] - g[0]) / (medians[1] - medians[0]) - (
326 medians[1] - medians[0]
327 ) / 6 * gamma[0]
328 scores[rights == 0] = (
329 g[0] - (medians[0] - scores[rights == 0]) * derr
330 ) # reuse "scores" array to save memory
332 derl = (g[-1] - g[-2]) / (medians[-1] - medians[-2]) + (
333 medians[-1] - medians[-2]
--> 334 ) / 6 * gamma[-3]
335 scores[rights == n] = g[-1] + (scores[rights == n] - medians[-1]) * derl
337 idxs = np.where((rights > 0) & (rights < n))
IndexError: index -3 is out of bounds for axis 0 with size 1Thanks!
Ralf
Metadata
Metadata
Assignees
Labels
No labels