-
Notifications
You must be signed in to change notification settings - Fork 0
/
makeTableRanksFitness.R
61 lines (41 loc) · 1.44 KB
/
makeTableRanksFitness.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
##### As it says, this obtains a table for genotypes' weights-
## Launch as
## nohup R --vanilla --slave -f input.R &> input.Rout &
## This is so fast (< 5 seconds in Draco) that can run interactively
rm(list = ls())
source("oncoFunctions.R")
## Change paths as needed
dirsSims <- c("/Disk2/ramon/No-Backuppc/selected-simulations-A",
"/Disk2/ramon/No-Backuppc/selected-simulations-B")
## ## For playing
## dirsSampled <- "~/tmp"
## dirsSims <- "~/tmp"
## filesSim give the "true probabilities" of genotypes
## filesSample4000 are used to obtain the probabilities of genotypes under
## the sampling regime (4000 * 5 = 20000, and that is where we get
## the probabilities from)
filesSim <- list.files(dirsSims, pattern = glob2rx("landscape_ID_*.rds"),
full.names = TRUE)
length(filesSim)
date()
## Warm up compiler and check
null <- dplyr::bind_rows(
lapply(filesSim[1:5],
fitness_rank_genotypes)
)
null
rm(null)
gc()
## Do for real
pboptions(type = "txt")
cat("\n Doing sampled \n")
outRanksFitness <- pbmclapply(filesSim,
fitness_rank_genotypes,
mc.cores = detectCores())
save(file = "outRanksFitness.RData", outRanksFitness,
compress = FALSE)
date()
outRanksFitness <- dplyr::bind_rows(outRanksFitness)
save(file = "outRanksFitness.RData", outRanksFitness,
compress = FALSE)
date()