In the current code, this seed argument is not used. Instead, a local variable Seed (capitalized) is defined and used to inform random number generation.
This means that the user-specified value will be ignored, and the simulation will be random every time.
This pull request removes this extra seed generation step, so that the --simu-seed can work as intended.
Dear maintainers,
Currently, the
--simu-seed
command line flag does not lead to identical results when running the simulation multiple times.As far as I can tell from the code, the intention in
option.cpp
is to use a randomly generated seed as a default. https://github.com/jianyangqt/gcta/blob/f22c624e6a6ca41577223da01756e58d569169e2/main/option.cpp#L98With the aforementioned command line flag, that value can then be overwritten with a user-defined value. https://github.com/jianyangqt/gcta/blob/f22c624e6a6ca41577223da01756e58d569169e2/main/option.cpp#L601-L604
The value stored in
simu_seed
is then passed toGWAS_simu
as theseed
argument. https://github.com/jianyangqt/gcta/blob/f22c624e6a6ca41577223da01756e58d569169e2/main/gwas_simu.cpp#L85In the current code, this
seed
argument is not used. Instead, a local variableSeed
(capitalized) is defined and used to inform random number generation.This means that the user-specified value will be ignored, and the simulation will be random every time.
This pull request removes this extra seed generation step, so that the
--simu-seed
can work as intended.