我运行 hicpipe 工具,它在执行过程中返回此错误。它的错误是:
Rsge temp files: tmp/Rsge.test_cluster.binned.*
Error in if (trace) cat("Running locally \n") :
argument is of length zero
Calls: compute.total.counts -> model.predict.split -> sge.parRapply
Execution halted
Error: error in total_expected_counts_wrapper.r
Execution halted
make[1]: *** [/home/dashti/hicpipe/output/test_cluster/test_cluster.nm]
Error 1
make[1]: Leaving directory `/home/dashti/hicpipe'
make: *** [all] Error 1
它运行了下面的 Rscript 代码:
Rscript R/total_expected_counts_wrapper.r /home/dashti/hicpipe/output/test_cluster/test_cluster /home/dashti/hicpipe/models/map_len_gc.mdl trans 1e+06 0 200
total_expected_counts_wrapper.r 的代码是:
options(warn=1)
# get script name
all.args = commandArgs(F)
fn.arg = "--file="
script.name = sub(fn.arg, "", all.args[grep(fn.arg, all.args)])
args = commandArgs(T)
if (length(args) == 1) {
cat(sprintf("usage: %s <input prefix> <model file> <filter> <cis.threshold> <use cluster> <max jobs on cluster>\n",
script.name))
q(status=1)
}
ifn.prefix = args[1]
model.ifn = args[2]
filter = args[3]
cis.threshold = as.numeric(args[4])
cluster = (args[5] == "1")
max.njobs = as.numeric(args[6])
mtable = read.delim(model.ifn)
mfields = mtable$field
maxvals = mtable$size
if (cluster) {
cat("Using Sun Grid Engine cluster\n")
} else {
cat("Not using Sun Grid Engine cluster, running sequentially on local machine\n")
}
source("R/model_predict.r")
compute.total.counts(prefix=ifn.prefix, cluster=cluster, max.njobs=max.njobs, ofields=mfields, max.vals=maxvals, filter=filter, cis.threshold=cis.threshold)
q(status=0)
我该怎么办?我看到其他 .R 文件,但在其中找不到任何跟踪变量。我向作者发送了电子邮件,但没有收到任何回复。
source("R/model_predict.r")
在 model_predict.r 中,加载了 Rsge 库
173 library(Rsge)
174 sge.options(sge.save.global=F)
175 sge.prefix = paste("tmp/Rsge.", get.short.fn(fends.fn), ".", sep="")
176 cat(sprintf("Rsge temp files: %s*\n", sge.prefix))
177 sge.options(sge.file.prefix=sge.prefix)
178
179 result = sge.parRapply(ranges, model.predict, lib.dir=lib.dir,
180 njobs=njobs, join.method=c, cluster=cluster,
181 fends.fn=fends.fn, log.dir=log.dir,
182 prior=prior, mfields=mfields, mfields.maxvals=mfields.maxvals, mfields.fns=mfields.fns,
183 filter=filter, cis.threshold=cis.threshold, ofields.x=ofields.x, ofields.y=ofields.y,
184 function.savelist=c("get.short.fn", "get.ofield.args"))
185 if (class(result) == "list" && class(result[[1]]) == "try-error")
186 return (-1)
而且 Rsge 似乎无法正常工作。
我通过编辑 Rsge/sge.parApply.R 代码来解决问题
(设置变量值等于Rsge/sge.optionR)
并重新安装 Rsge。
1
2 # $Id: sge.parRapply.R,v 1.2 2006/12/15 15:21:23 kuhna03 Exp $
3
4 sge.apply <- function(X, MARGIN, FUN, ...,
5 join.method=cbind,
6 njobs,
7 batch.size=options('sge.block.size'),
8 packages=NULL,
9 global.savelist=NULL,
10 function.savelist=NULL,
11 cluster=options('sge.use.cluster'),
12 #trace=options('sge.trace'),
13 trace=TRUE,
14 #debug=options('sge.debug'),
15 debug=FALSE,
16 file.prefix=options('sge.file.prefix')
17 ) {