wikipathways / cytoscape-wikipathways-app

WikiPathways app for Cytoscape to open and access pathways from WikiPathways
Apache License 2.0
5 stars 7 forks source link

Major Issue: Export to CX bug #102

Closed ariutta closed 2 years ago

ariutta commented 5 years ago

Cytoscape 3.7.1 WikiPathways App 3.3.7

This fails:

Look at the last few lines of the CX file, and you'll see an error.

This succeeds:

1) Import WP554 as pathway 2) Save 3) Close 4) Re-open the session file from 2 5) Export > Network to File (choose CX)

AlexanderPico commented 5 years ago

@AdamStuart This is definitely a bug we saw before. I think it occured during session saving... The fix might need to be applied to exporting to CX, XGMML and other network file formats as well.

ariutta commented 5 years ago

Another test case: WP244

AdamStuart commented 5 years ago

java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Integer at org.cytoscape.view.presentation.property.IntegerVisualProperty.toSerializableString(IntegerVisualProperty.java:1) at org.cytoscape.io.internal.cx_writer.VisualPropertiesGatherer.addProperties(VisualPropertiesGatherer.java:101) at org.cytoscape.io.internal.cx_writer.VisualPropertiesGatherer.gatherNodeVisualProperties(VisualPropertiesGatherer.java:407) at org.cytoscape.io.internal.cx_writer.VisualPropertiesGatherer.gatherVisualPropertiesAsAspectElements(VisualPropertiesGatherer.java:83) at org.cytoscape.io.internal.cxio.CxExporter.writeVisualProperties(CxExporter.java:567) at org.cytoscape.io.internal.cxio.CxExporter.writeSubNetworks(CxExporter.java:1324) at org.cytoscape.io.internal.cxio.CxExporter.writeNetwork(CxExporter.java:239) at org.cytoscape.io.internal.cx_writer.CxNetworkWriter.run(CxNetworkWriter.java:259)

AdamStuart commented 5 years ago

?? I don't see CX as an optional format in the export dialog

AlexanderPico commented 5 years ago

Should be the first option...

Screen Shot 2019-05-17 at 1 21 33 AM
AdamStuart commented 5 years ago

sorry, I'd uninstalled several core apps on home machine.

AdamStuart commented 5 years ago

looks like a problem inside CXWriter

org.cytoscape.io.internal.cx_writer.VisualPropertiesGatherer.addProperties(VisualPropertiesGatherer.java:101) org.cytoscape.io.internal.cx_writer.VisualPropertiesGatherer.gatherNodeVisualProperties(VisualPropertiesGatherer.java:407)

AlexanderPico commented 5 years ago

Note that it is "fixed" by saving/loading the imported network as a session. This suggests the serialization to xgmml and back is "fixing" something the CXWriter cares about...

AlexanderPico commented 2 years ago

@ariutta This appears to be fixed in 3.3.8. Do you want to try skipping the save/close/reload steps in your next export to CX?