py2自动保存视图



我想使用 py2cytoscape 包自动在 cytoscape 中保存视图。

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")

输出如下:

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'}

我尝试遵循(导出高分辨率图像文件):https://github.com/cytoscape/cytoscape-automation/blob/master/for-scripters/Python/advanced-cancer-networks-and-data.ipynb,但是收到上面显示的错误。

Cytoscape 3.7.1 有一些小的变化

请从开发分支安装 py2cytoscape

pip uninstall py2cytoscape
pip install git+https://github.com/cytoscape/py2cytoscape.git --user

,然后使用

cytoscape.view.export(options="PDF", outputFile="FILENAME")

最新更新