I'm trying to replicate assign-confidence's q-values (mainly so I can make sure I understand how q-value is calculated). I am using the default "tdc" method. I'm using these two papers for reference:
- "Assigning Significance to Peptides Identified by Tandem Mass Spectrometry Using Decoy Databases" (2007) Kall, Noble, et al
- "Statistical significance for genomewide studies" (2003) Storey & Tibshirani
The q-value results I'm getting do not match crux assign-confidence's q-values. I'm implementing the algorithm in the appendix of the Storey & Tibshirani paper (screenshot below). I run separate target and decoy searches. I ignore those spectra for which the decoy score beats the target score. Then I set the p-value for PSM i with target score t to be: p_i = #(decoys with score > t) / #decoys. So, the PSMs with target scores greater than any decoy score have p_i = 0 which (by the q-value equations in steps 5 & 6 of the Storey & Tibshirani algorithm) would make q_i = 0 as well. But none of the crux computed q-values are 0. So I must be missing something.
Any help is greatly appreciated. Thanks all!
- Erik