如何使用PHP Rserve使用(how to use Rserve usage with PHP)

2019-10-23 05:09发布

我必须要逃避的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)

长谷歌搜索和耐心后,我找到了解决办法。 首先从服务器端加载库,你需要cinfigure的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 )我能够调用由服务器加载脚本的功能。 调用eval函数

文章来源: how to use Rserve usage with PHP
标签: php web rserve