lehtiolab / proteogenomics-analysis-workflow

IPAW: a Nextflow workflow for proteogenomics
24 stars 9 forks source link

FDR calculation: ZeroDivisionError: division by zero #5

Closed husensofteng closed 5 years ago

husensofteng commented 5 years ago

I get the following error when manually running the svmToTSV script, It is related to the number of decoys with the given svm score: Command error: psms[psm[0]] = {'decoy': pdecoy, 'svm': psm[1], 'qval': decoys[True]/decoys[False]} # T-TDC ZeroDivisionError: division by zero

Command output (Manual) of print(psm[1], decoys) is 0.867, {True: 1, False: 0} since there is no decoy for this svm score the devision is by zero.

An option is setting the FDR to 0.0 in such cases.

glormph commented 5 years ago

It's actually opposite, there are no target scores. Catching this exception would instead set the FDR to 1.0. Sounds like a good idea!

husensofteng commented 5 years ago

yeah, you are right, I read it the opposite. I will make a request.

glormph commented 5 years ago

Fixed with #6