-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstep7-regMatVsDERs.R
38 lines (33 loc) · 1.2 KB
/
step7-regMatVsDERs.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
## Helper script for comparing ER-level DERs vs single base-level DERs
library('getopt')
library('rmarkdown')
library('knitr')
## Specify parameters
spec <- matrix(c(
'run', 'r', 1, "character", "Name of the run, for example 'run1-v0.0.42'",
'wdir', 'w', 1, 'character', 'Path to working directory',
'maindir', 'm', 1, 'character', 'Path to main directory',
'rootdir', 'd', 1, 'character', 'Path to root directory',
'cutoff', 'c', 1, 'numeric', 'Cutoff used in the regionMatrix analysis',
'help' , 'h', 0, "logical", "Display help"
), byrow=TRUE, ncol=5)
opt <- getopt(spec)
## if help was asked for print a friendly message
## and exit with a non-zero error code
if (!is.null(opt$help)) {
cat(getopt(spec, usage=TRUE))
q(status=1)
}
analysisPath <- opt$wdir
load(paste0(opt$maindir, '/regionMatrix/regionMat-cut', opt$cutoff, '.Rdata'))
proc.time()
load(file.path(opt$maindir, 'derAnalysis', opt$run, 'fullRegions.Rdata'))
proc.time()
opts_chunk$set(dev = 'CairoPNG')
render(file.path(opt$rootdir, 'step7-regMatVsDERs.Rmd'),
output_file= file.path(opt$wdir, 'step7-regMatVsDERs.html'), clean = FALSE)
## Reproducibility info
proc.time()
message(Sys.time())
options(width = 120)
devtools::session_info()