This will fail if some intervals don't contain any p-values, for example if the largest p-value is 0.93 the first entry will be NA and then the whole cumsum will be NA, it can be fixed with:
How is this completed? We sometimes have tens of thousands of p-values not covering all intervals. Either way, the code shouldn’t produce NAs here in the first place
https://github.com/StoreyLab/qvalue/blob/9b3f9a8af4dc8b680a6914d1fcc106e041b7c7a0/R/pi0est.R#L111
This will fail if some intervals don't contain any p-values, for example if the largest p-value is 0.93 the first entry will be NA and then the whole cumsum will be NA, it can be fixed with: