2017-06-05 81 views
0

当我在R studio中运行“send2cy”函数时,出现错误。send2cy在Rstudio中不起作用〜Cyrest,Cyotoscape

# Basic setup 
library(igraph) 
library(RJSONIO) 
library(httr) 
dir <- "/currentdir/" 
setwd(dir) 
port.number = 1234 
base.url = paste("http://localhost:", toString(port.number), "/v1", sep="") 
print(base.url) 

# Load list of edges as Data Frame 
network.df <- read.table("./data/eco_EM+TCA.txt") 

# Convert it into igraph object 
network <- graph.data.frame(network.df,directed=T) 

# Remove duplicate edges & loops 
g.tca <- simplify(network, remove.multiple=T, remove.loops=T) 

# Name it 
g.tca$name = "Ecoli TCA Cycle" 

# This function will be published as a part of utility package, but not ready yet. 
source('./utility/cytoscape_util.R') 

# Convert it into Cytosccape.js JSON 
cygraph <- toCytoscape(g.tca) 

send2cy(cygraph, 'default%20black', 'circular') 

Error in file(con, "r") : cannot open the connection 
Called from: file(con, "r") 

但是当我使用“send2cy”功能从终端R(运行R.从终端只是“R”呼叫)我没有发现错误。

欢迎任何建议。

回答

0

我使用网络数据和实用程序脚本的本地副本以及更新的文件路径测试了您的脚本。这个脚本在R Studio中运行得很好。

鉴于您看到的错误消息“文件错误...”我怀疑问题是与您的本地文件和文件路径......以某种R Studio特定的方式?

供参考:Cytoscape的R脚本的更新,整合和更新集可在此处获得:https://github.com/cytoscape/cytoscape-automation/tree/master/for-scripters/R。我认为任何事情都没有发生重大变化,但也许尝试在新的背景下解决您所面临的问题。

相关问题