cytoscape / RCy3

New version of RCy3, redesigned and collaboratively maintained by Cytoscape developer community
MIT License
48 stars 20 forks source link

Calling createGraphFromNetwork fails #96

Closed sshechte closed 3 years ago

sshechte commented 4 years ago

I extract info from STRING DB for a gene of interest (*.cys) I then imported into CytoScape I then wanted to calc the shortest path between two genes I used the code :

library(RBGL) # install from Bioconductor
# Convert a sample Cytoscape network to a graph object
openSession()
g <- createGraphFromNetwork()
# Identify start and finish nodes (styling is optional)
start <- "YNL216W"
finish <- "YER040W"
setNodeBorderWidthBypass(c(start, finish), 20)
setNodeBorderColorBypass(start, "#00CC33")
setNodeBorderColorBypass(finish, "#CC00CC")
# Use RBGL to perform shortest path calculation
shortest <- sp.between(g, start, finish)
shortest$`YNL216W:YER040W`$length
#[1] 6
shortest.path <- shortest$`YNL216W:YER040W`$path_detail
# Visualize results in Cytoscape
selectNodes(shortest.path, "name")
setNodeBorderWidthBypass(shortest.path, 20)
createSubnetwork()

and got the following error: Error in igraph::graph_from_data_frame(cyedges2, directed = TRUE, vertices = cynodes2) : Some vertex names in edge list are not listed in vertex data frame

What is the best way to determine the missing vertex names or is there a way to find the shortest path in another way

AlexanderPico commented 4 years ago

I can't troubleshoot this issue without a problematic example. Can you provide your .cys file and two example nodes that you want calculate the path on.

htcdmrn commented 2 years ago

Hi I have similar problem, do you mind if you help me about it. Error in [<-.data.frame(*tmp*, i, col, value = character(0)) : column name "" cannot match any column