我必须从 php 运行脚本,从以下位置获取数据:
这是我的脚本:
library(pathview)
pv.out <- pathview(gene.data = gene.d,gene.idtype = geneid,cpd.data = cpd.d,cpd.idtype=cpdid,pathway.id = pathway,species = species,out.suffix = suffix,kegg.native = kegg,sign.pos =pos,same.layer = layer,keys.align = align,split.group = split,expand.node = expand,multi.state=multistate,match.data = matchd ,node.sum=nsum,key.pos = kpos,cpd.lab.offset= offset,limit = list(gene = glmt, cpd = clmt), bins = list(gene = gbins, cpd= cbins),low = list(gene = glow, cpd = clow),mid = list(gene = gmid, cpd = cmid), high = list(gene = ghigh, cpd =chigh),discrete = list(gene = gdisc, cpd = cdisc))
save.image("workenv.Rdata")
write.table(pv.out$plot.data.gene,file=paste(paste(paste("genedata.",species,sep=""),pathway,sep=""),".txt",sep=""),quote = FALSE)
write.table(pv.out$plot.data.cpd,file=paste(paste(paste("cpddata.",species,sep=""),pathway,sep=""),".txt",sep=""),quote = FALSE)
经过长时间的谷歌搜索和耐心,我找到了解决方案。首先要从服务器端加载库,您需要配置 Rserv.conf 文件。如果您没有 Rserv.conf 文件,您可以在 /etc 文件夹中创建
(/etc/Rserv.conf) 并写下面是我的配置
remote enable
encoding utf8
eval library(pathview)
source /home/ybhavnasi/Desktop/Script_Rserv.R
eval xx <- 1
port 6311
plaintext enable
并在 php 中使用 github 上的 php rserv 库(https://github.com/cturbelin/rserve-php)我能够在服务器加载的脚本上调用该函数。调用评估函数