jhkorhonen / MOODS

MOODS: Motif Occurrence Detection Suite
Other
95 stars 12 forks source link

adding precision argument to threshold_from_p #16

Closed fabio-t closed 5 years ago

fabio-t commented 7 years ago

We are finishing migration from Biopython to MOODS, and the only remaining bit was the possibility to specify arbitrary precision when calculating FPR thresholds with thresholds_from_p. This pull request implements that.

Since the function is already overloaded, I could not cleanly keep the existing PVAL_DP_MULTIPLIER as a default (unless using C++'s default arguments which I, however, am not familiar with). So I've had to add 2000.0 to all code calling thresholds_from_p.

I believe that is better to leave the choice to the user as to which precision to set, rather than hardcoding. Computing capabilities vary a lot (for us, 10000 is a good compromise - for others, 2000 is already too much). But I bow to your judgment :)

There are probably better ways of doing this, but I bet they involve some refactoring.

jhkorhonen commented 7 years ago

Sounds like a good change – this was one of the things I did not get around to refactoring in the last major update. I'll see if I can make the implementation slightly cleaner using default parameters, and include this in the next update (once I survive the next impeding deadline on another project...)

fabio-t commented 7 years ago

Great news! :) and good luck with your project.