-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakeTableObservedFreqs.R
56 lines (43 loc) · 1.35 KB
/
makeTableObservedFreqs.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
##### As it says, this obtains a table for genotypes' weights-
## Launch as
## nohup R --vanilla --slave -f input_name.R &> input_name.Rout &
rm(list = ls())
source("oncoFunctions.R")
## library(dplyr)
## library(parallel)
## library(OncoSimulR)
## Change paths as needed
dirsSampled <- "/home/ramon/No-Backuppc/cpm-analyzed-all-selected"
## ## For playing
## dirsSampled <- "~/tmp"
## dirsSims <- "~/tmp"
filesSampled <- list.files(dirsSampled,
pattern = glob2rx("ANALYZED__ID*.rds"),
full.names = TRUE)
length(filesSampled)
## When we parallelized, do not have patterns of all easy early, etc.
filesSampled <- sample(filesSampled)
date()
## Warm up compiler and check
null <- dplyr::bind_rows(
lapply(filesSampled[1:5],
obs_freqs_in_sample))
null
rm(null)
gc()
pboptions(type = "txt")
cat("\n Doing sampled \n")
system.time(
outObsFreqs <- pbmclapply(filesSampled,
obs_freqs_in_sample,
## No: just reorder input
## mc.preschedule = FALSE,
mc.cores = detectCores())
)
save(file = "outObsFreqs.RData", outObsFreqs,
compress = FALSE)
date()
outObsFreqs <- dplyr::bind_rows(outObsFreqs)
save(file = "outObsFreqs.RData", outObsFreqs,
compress = FALSE)
date()