I want to automate saving a view in cytoscape using the py2cytoscape
package.
from py2cytoscape import cyrest
cytoscape = cyrest.cyclient()
cytoscape.network.load_file("FILENAME.cyjs")
cytoscape.vizmap.apply(styles="default")
cytoscape.network.set_current(network="FILENAME")
cytoscape.layout.apply_preferred()
cytoscape.view.set_current(network="FILENAME")
cytoscape.view.fit_content()
cytoscape.network.deselect(nodeList='all', edgeList='all')
cytoscape.view.export(options="PDF", OutputFile="FILENAME")
Output below:
ValueError: {'status': 500, 'type': 'urn:cytoscape:ci:cyrest-core:v1:handle-json-command:errors:2', 'message': 'java.lang.NullPointerException', 'link': 'file:/Users/mgruzynski/CytoscapeConfiguration/3/framework-cytoscape.log'}
I tried to follow (Exporting high resolution image files): https://github.com/cytoscape/cytoscape-automation/blob/master/for-scripters/Python/advanced-cancer-networks-and-data.ipynb, but am getting the errors shown above.