scantwo permutation - parallelization

39 views
Skip to first unread message

Tiago Ribeiro

unread,
Sep 25, 2022, 7:03:42 PM9/25/22
to R/qtl discussion
Hi,

I ran scantwo and saved the image after it was done to be able to load it in separate instances and perform permutations in parallel. However, the results of the permutations always return the same from one job to another. 

This is the code for the scantwo step:
rd_genoprob2 <- calc.genoprob(ril_data,step=0, err=0.001)
data_s2 <- scantwo(rd_genoprob2, verbose = FALSE, pheno.col=2)
save.image(file = "scan2.RData"))


Then, I load the image in separate jobs and ask for 10 permutations in each job. 

perm_data_s2 <- scantwo(rd_genoprob2, pheno.col=2, n.perm=10)

But the lod scores for each of the 10 permutations repeated themselves in each job. For example, if LODfull was 14.090159 for the 1st permutation, then 9.073651 for the second. These would be the results for the 1st and 2nd permutation in each of the jobs I ran. Is it an issue with how the permutations are seeded? How could I parallelize this?

Best,

Karl Broman

unread,
Sep 25, 2022, 7:55:21 PM9/25/22
to rqtl...@googlegroups.com
You need to make sure that each run gets a different seed. What I do is use set.seed() with a large number + 1, 2, 3, …

karl

On Sep 25, 2022, at 6:03 PM, Tiago Ribeiro wrote:

Hi,
Reply all
Reply to author
Forward
0 new messages