cytoscape / py4cytoscape

Python library for calling Cytoscape Automation via CyREST
https://Py4Cytoscape.readthedocs.io
Other
72 stars 14 forks source link

Cannot handle list in `create_network_from_cytoscapejs` #108

Closed gmhhope closed 1 year ago

gmhhope commented 1 year ago

Dear py4cytoscape developer,

When I loaded a cytoscape python object

# Convert the graph to Cytoscape JSON format
cytoscape_data = json_graph.cytoscape_data(G)
p4c.create_network_from_cytoscapejs(cytoscape_data,col_name_d['n_name'],col_name_d['c_name'])

This gives me error:

In cyrest_post(): Could not parse the given network JSON: invalid type: class java.util.ArrayList
...

This is because the list object cannot be parsed? However, if I try to use desktop version, there is actually no error and I can see the list object perfectly. See the screenshot below:

Screenshot 2023-07-07 at 1 34 43 PM

Is there a way I can work around this in py4cytoscape for better automation.

Thanks, Minghao Gong

gmhhope commented 1 year ago

Somehow it get resolved by shortening the file names