Skip to content
Prev 7573 / 21312 Next

[Bioc-devel] reproducible with mclapply?

There are different ways set.seed can be used.  The way it is suggested on
the aforementioned stackoverflow post is basically a two stage process.
First seed is provided by a user (set.seed(1)).  That is user can change
the outcome from run to run.  Based on that seed, a vector of randomized
seeds is generated (seeds <- sample.int(length(input), replace=TRUE)).
Those seeds are basically arguments to the function under mclapply/lapply
that help to control random number generation for each iteration (set.seed(
seeds[idx])).
There are two different roles of set.seed. First left the user to control
random number generation and the second (within the function) makes sure
that it is the same for individual iterations regardless how the loop is
executed.
Does that make sense?
On Wed, Jun 3, 2015 at 7:07 PM, Yu, Guangchuang <gcyu at connect.hku.hk> wrote: