Closed AlexanderPico closed 1 year ago
Without the CYS file, it's hard to say for sure. But my guess is that KEGGParser app makes a few non-network objects (like those labels and ovals) that cannot be converted to graphNEL.
Troubleshooting idea:
Also, what are you trying to accomplish overall? Maybe there is another suggested route.
I'm unsure which components break the conversion, thus I probably can not pinpoint which components to specifically delete to prevent the error.
I'm trying to manually create pathways (or edit existing KEGG pathways to add in new interactions etc.), somehow import them into R and convert into a graphNEL object, convert it to a boolean network (already have a R script for that), and then use another script from one of my collaborators to run different computational analysis on it.
Got it.
In order to determine with components break the conversion, simply delete everything but a few nodes in your KEGG network and try. If it works, then try second time with fewer components deleted. Repeat until it doesn't work, then you'll have the answer.
Regarding strategy. You might try exporting the KEGG as something simple, like SIF file. Then import the sif and convert that to graphNEL. Somehow you need to strip away the "extra" non-graph stuff that KEGG is importing.
For example, the WikiPathways app allows you import pathways "as networks" which does exactly this, making them easy to work with as graph objects. You could try using that instead of KEGGParser.
I am familiar with working with KEGG data and may be able to help in some way with this case. I do not know where to find the KEGGParser app at first. Could you tell me the website for the KEGGParser app?
@kozo2 Surely you know where to find Cytoscape apps! :) https://apps.cytoscape.org/apps/cykeggparser
@AlexanderPico Thank you for your comment. I was wondering if Jordan intended another app since https://apps.cytoscape.org/apps/cykeggparser has stopped updating. Anyway I will investigate Jordan's issue.
@kozo2 Thanks for offering to help. Yes, I am using the latest version of cykeggparser (think 2017). I downloaded the cykeggparser app within Cytoscape and imported a kegg pathway from there.
@jordlang01 By the way, which KEGG pathway did you import using cykeggparser?
@kozo2 the leukocyte transendothelial migration pathway
@jordlang01 OK. I took it to be https://www.genome.jp/pathway/hsa04670 .
@kozo2 Yes
@AlexanderPico I deleted many nodes from the KEGG graph (only 3-4 left), but I still received the same error when trying to convert it from graph to graphNEL.
@AlexanderPico Also, when I downloaded the wikipathways app in Cytoscape; I was unable to access it, as in it wasn't under the "apps" tab in the Cytoscape tool bar. I've tried restarting, uninstalling and installing the app a few times, but it still does not appear. I am specifically interested in KEGG rather than wikipathways. I also tried creating my own small (3 nodes and 2 edges) pathway in Pathvisio, saved it as a gpml, and tried to import in in Cytoscape (as a network not pathway), but I obtained the error.
Ah, it doesn't add anything to the "app" tab. It works as a network search tool (upper left of control panel)
More details here: https://apps.cytoscape.org/apps/wikipathways
Remember to try "import as network" if you find an interesting pathway.
@AlexanderPico Ok, now I remember that is where the wikipathways app is found, thanks. Any additional thoughts on my previous comment, where I deleted many nodes from an imported KEGG pathway in Cytoscape, tried to run the creategraphfromnetwork function in r, but I still obtained the same error?
Another test: Select 2 or 3 connected nodes and create a new subnetwork. Then try to convert that.
If that also fails, then there is something inherent to how nodes and/or edges are named by the CyKEGGParser app that is breaking convention.
@AlexanderPico I did try your suggestion but it didn't work unfortunately. Creating a smaller network using Cytoscape's default node and edge styles does allow the conversion to work, just unsure why it doesn't for KEGG pathways, which would be the preferable place to begin when it comes to manually editing existing pathways and then converting it vs creating one from scratch using Cytoscape's default and then converting it.
Do you possibly know of any other Cytoscape apps that works with KEGG pathways or another software/program in general where the user can import KEGG pathways and edit them, figuring out a way to transfer the file to R as a graphNEL object etc?
Some ideas:
Thanks for the input. On NDEx, can you also edit existing pathways yourself before reading them into R, in case you want to add/remove interactions that may/may not be present for one's research?
NDEx is a database for Cytoscape networks in CX format. So, you could start with an NDEx network, then import it into Cytoscape, edit, then export back to NDEx, then read into R.
Or, you could try starting with a KEGG network in Cytoscape, exporting to NDEx, then read into R.
These steps can all be done in R using RCy3 and NDExR packages.
@AlexanderPico I was able to successfully export the pathway to NDEx, created an account and uploaded the network/pathway to the site, but now I'm having trouble reading it into R. I've gone through the ndexR into R, logged into my account in R, but I'm unable to import my own network into R. I'm able to import other networks from NDEx into R, but from my own personal account, I'm having some trouble.
Believe it or not, you are pioneering new workflows that I haven't seen others do yet, nor have I done them myself. So, I can suggest things to try, but in the end, it might not be possible or there might be a bug in ndexr or something else beyond my control.
I don't have a suggestion for your current NDEx to R import issue. You could contact NDEx support or file a bug with the ndexr package? Or kozo might have other suggestions?
That is very hard to believe but thanks! I was able to figure out how to import the KEGG pathway from NDex into R. I just went back to the vignette and made a couple of adjustments to my code.
@AlexanderPico Sorry I know you closed this comment, but I just realized something. When I imported the KEGG pathway to NDex, the graph went from directed to undirected. Is there a way to maintain those directed connections during conversion or is this hard coded in the Cytoscape system?
That’s probably an NDEx question. As far as I know all cytoscape networks are directed since there is always a source and target.
Ok, thank you.
From Jordan: