cytoscape / RCy3

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

Cannot Create network from graphNel/igraph object, generated from kgml #220

Closed Naadir-Ganief closed 1 month ago

Naadir-Ganief commented 8 months ago

Hi,

below is the code i was trying, I tried both the graphNel and igraph objects, both return the same error : "Error in FUN(X[[i]], ...) : environments cannot be coerced to other types"

parsed.kgml <- KEGGlincs::get_KGML(pathwayid = pathIds[[1]], get_if_no_edges = F)

graphNel <- KEGGgraph::parseKGML2Graph(file = kgml, genesOnly = T, expandGenes = F)

igraph <- graph_from_graphnel(graphNEL = graphNel)

plot(igraph)

RCy3::createNetworkFromIgraph(
  igraph,
  title = "From graph",
  collection = "My GraphNEL Network Collection"

)

Thanks

AlexanderPico commented 1 month ago

Duplicate? https://support.bioconductor.org/p/9159835/

I'm not surprised that this fails. Not all GraphNELs nor igraphs are the same, so these chains of conversions are fraught with peril. Assuming the goal is creating the network in Cytoscape (given the final lines you shared), here are some shorter routes: