cole-trapnell-lab / cufflinks

Boost Software License 1.0
310 stars 116 forks source link

Random generators are using default seed #30

Open BenLangmead opened 9 years ago

BenLangmead commented 9 years ago

There seem to be many places where boost random number generators are instantiated (e.g. boost::mt19937 rng; in simulate_count_covariance) but without a specified seed. So the default seed for the generator is used. Seems like they should be seeded with some function of the user-defined --seed value. I noticed this because I see some isoforms for which the coverage estimate varies a lot when the BAM is perturbed slightly, but which do not vary when --seed is varied.

Ben

BenLangmead commented 9 years ago

It turned out that the variability I was seeing was probably because of the empirical read/fragment length distribution and a problem with how it's used in the bias correction code:

https://github.com/cole-trapnell-lab/cufflinks/pull/32

But the random number generator seeding issue stands.

kotoroshinoto commented 9 years ago

would there be any value in using the built-in RNG available with c++11 or newer standards? I think it provides for seed generation.

http://en.cppreference.com/w/cpp/numeric/random