Cy3: associating data to CyNodes in the session

44 views
Skip to first unread message

Aurélien Naldi

unread,
Aug 12, 2011, 11:54:16 AM8/12/11
to cytoscap...@googlegroups.com
Hi,

I am associating some extra data to network nodes in cytoscape 3
(complex types which can not be stored in a CyTable). It works well as
long as cytoscape is open, I can also save it into the session, but I
am not sure how to restore it: I do get the event but the IDs I used
to recognise nodes seem to be messed-up.

* the long used as SUID change completely (esp if I open a session
after having worked a bit already)
* indices are the same but seem to be in another order

as far as I can guess, the session is properly restored using SUIDs,
so I guess some mapping between SUIDs as saved in the file and SUIDs
in the newly loaded network is built somewhere. Can I get it from the
SessionLoadedEvent object?


I have one more question about the data model: it is easy to get the
CyRows corresponding to a given CyNode (or CyEdge), but I may need to
get the CyNode corresponding to a given CyRow (i.e. to a given suid).
For now I work with small networks, so I can test each CyNode, but a
convenience method to do this (possibly relying on a cached mapping)
would be nice.


Best regards.

--
Aurélien Naldi

Christian Forst

unread,
Aug 16, 2011, 12:06:44 PM8/16/11
to cytoscap...@googlegroups.com
Is there a way to repair a Cytoscape session file, or do I have to start
from scratch.
I have an apparently corrupt session file inducing the following java
exceptions:

java.lang.NullPointerException: Colors cannot be null
at java.awt.GradientPaint.<init>(GradientPaint.java:71)
at
cytoscape.visual.ui.editors.continuous.CyGradientTrackRenderer.drawGradient(CyGradientTrackRenderer.java:271)
at
cytoscape.visual.ui.editors.continuous.CyGradientTrackRenderer.drawIcon(CyGradientTrackRenderer.java:407)
at
cytoscape.visual.ui.editors.continuous.CyGradientTrackRenderer.getTrackGraphicIcon(CyGradientTrackRenderer.java:339)
at
cytoscape.visual.ui.editors.continuous.GradientEditorPanel.getIcon(GradientEditorPanel.java:154)
at
cytoscape.visual.ui.editors.continuous.ContinuousMappingEditorPanel.getIcon(ContinuousMappingEditorPanel.java:157)
at
cytoscape.visual.ui.VizMapperMainPanel.buildProperty(VizMapperMainPanel.java:1377)
at
cytoscape.visual.ui.VizMapperMainPanel.setPropertyFromCalculator(VizMapperMainPanel.java:1445)
at
cytoscape.visual.ui.VizMapperMainPanel.setPropertyTable(VizMapperMainPanel.java:1263)
at
cytoscape.visual.ui.VizMapperMainPanel.switchVS(VizMapperMainPanel.java:752)
at
cytoscape.visual.ui.VizMapperMainPanel.initVizmapperGUI(VizMapperMainPanel.java:848)
at cytoscape.CytoscapeInit.loadSessionFile(CytoscapeInit.java:483)
at cytoscape.CytoscapeInit.init(CytoscapeInit.java:215)
at cytoscape.CyMain.<init>(CyMain.java:144)
at cytoscape.CyMain.main(CyMain.java:108)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.install4j.runtime.Launcher.main(Unknown Source)
Exception in thread "Thread-3" java.lang.NullPointerException
at
cytoscape.visual.customgraphic.PersistImageTask.run(PersistImageTask.java:45)
at cytoscape.task.util.TaskWrapper.run(TaskManager.java:160)


Thanks
Christian

Ruth Isserlin

unread,
Aug 16, 2011, 12:17:05 PM8/16/11
to cytoscap...@googlegroups.com
Hi Christian,
If you change the name of the session file from .cys to .zip and extract the
contents you should be able to access the xgmml file of your network which
should have all the info for the network in the session.
Ruth


Thanks
Christian

--
You received this message because you are subscribed to the Google Groups
"cytoscape-discuss" group.
To post to this group, send email to cytoscap...@googlegroups.com.
To unsubscribe from this group, send email to
cytoscape-disc...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/cytoscape-discuss?hl=en.


Christian Forst

unread,
Aug 16, 2011, 12:18:19 PM8/16/11
to cytoscap...@googlegroups.com
And I forgot. I am using Cytoscape 2.8.1 with java version "1.6.0_24" on
a 32bit Ubuntu box.

Christian

Christian Forst

unread,
Aug 16, 2011, 12:25:58 PM8/16/11
to cytoscap...@googlegroups.com
Ruth

Great, thanks! That worked. Actually I could try that by myself, but as
a corollary, could I re-zip the session file without the apparently
corrupt session_vizmap.props and use it? Or does cytoscpae need some
session_vizmap.props file in the session file?

Christian

Ruth Isserlin

unread,
Aug 16, 2011, 12:36:22 PM8/16/11
to cytoscap...@googlegroups.com
Hi Christian,
I am not sure if cytoscape needs the session_vizmap.props file, you can
always give it a try. You should be able to modify the contents and re-zip
the file to create a new session. In the past, I have found that rarely is
it the cytoscape session that is the problem but rather some bug in the code
that once fixed the session loads no problem. In this case I am not sure if
it is a bug or the session.
Ruth

-----Original Message-----
From: cytoscap...@googlegroups.com
[mailto:cytoscap...@googlegroups.com] On Behalf Of Christian Forst

Ruth

Christian

Mike Smoot

unread,
Aug 16, 2011, 3:32:34 PM8/16/11
to cytoscap...@googlegroups.com
Hi Aurelien,

We do jump through a few hoops in session loading to map old SUIDs to new objects.  I've opened a bug for this (https://code.cytoscape.org/issues/350), so that we can expose that machinery to plugin authors as well.  We've talked about adding a getObject(SUID) method to CySession or possibly the SessionLoadedEvent that would let you map old SUIDs to new objects.  Hopefully that will work for you.

I've created a feature request for an object lookup from SUID (https://code.cytoscape.org/issues/351) to allow you to get a CyNode/Edge from a CyRow.  We haven't run into a great need for this feature yet, but it shouldn't be hard to implement if the need is greater than we expect.


thanks,
Mike

--
You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To post to this group, send email to cytoscap...@googlegroups.com.
To unsubscribe from this group, send email to cytoscape-disc...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cytoscape-discuss?hl=en.




--
____________________________________________________________
Michael Smoot, Ph.D.              
UCSD Department of Medicine
tel: 858-822-4756
Reply all
Reply to author
Forward
0 new messages