This is actually from a dependency DelayedArray which, on load, calls
DelayedArray::setAutoBPPARAM, which calls BiocParallel::MulticoreParam(), which
uses the random number generator to select a random port for connection.
A different approach would be for DelayedArray to respect the user's
configuration and use bpparam(), or perhaps look at the class of bpparam() and
tell the user they should, e.g., BiocParallel::register(SerialParam()) if
that's appropriate, or use registered("MulticoreParam") or
registered("SerialParam") if available (they are by default) rather than
creating an ad-hoc instance.
Martin
On 4/11/19, 10:17 AM, "Bioc-devel on behalf of Steffi Grote"
<[email protected] on behalf of [email protected]> wrote:
Hi all,
I found out that example code for my package GOfuncR yields a different
result the first time it's executed, despite setting a seed. All the following
executions are identical.
It turned out that loading the database package 'Homo.sapiens' changed the
random numbers:
set.seed(123)
runif(1)
# [1] 0.2875775
set.seed(123)
suppressWarnings(suppressMessages(require(Homo.sapiens)))
runif(1)
# [1] 0.7883051
set.seed(123)
runif(1)
# [1] 0.2875775
Is that known or expected behaviour?
Should I not load a package inside a function that later uses random
numbers?
Thanks in advance,
Steffi
_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel
_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel