forked from Danko-Lab/dREG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_dREG.R
25 lines (17 loc) · 884 Bytes
/
run_dREG.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require(dREG)
## Process command arguments
args <- commandArgs(trailingOnly=TRUE)
## Load the model. Do this before loading ps_plus_path, just in case those are saved in the model file.
dreg_model <- args[4]
load(dreg_model) ## Should have (by default) gdm and asvm.
## Read PRO-seq data.
ps_plus_path <- args[1]
ps_minus_path <- args[2]
outfile <- args[3]
ncores <- as.integer(args[5])
## Now scan all positions in the genome ...
inf_positions <- get_informative_positions(ps_plus_path, ps_minus_path, depth= 0, step=50, use_ANDOR=TRUE, use_OR=FALSE) ## Get informative positions.
pred_val<- eval_reg_svm(gdm, asvm, inf_positions, ps_plus_path, ps_minus_path, batch_size= 10000, ncores=ncores)
final_data <- data.frame(inf_positions, pred_val)
options("scipen"=100, "digits"=4)
write.table(final_data, file=outfile, row.names=FALSE, col.names=FALSE, quote=FALSE, sep="\t")