Re: [cytoscape-helpdesk] I want to automate saving a view in cytoscape using python py2cytoscape package

28 views
Skip to first unread message

Alex Pico

unread,
Jan 28, 2019, 8:54:13 PM1/28/19
to cytoscape...@googlegroups.com
Assuming you get the error on the last line, exporting. Can you try providing a full path to a directory you know you have permission to write to as the OutputFile parameter?  I suspect it’s trying to write to where you have Cytoscape installed and that is problematic for some reason (e.g., permissions).

 - Alex



On Jan 28, 2019, at 3:22 PM, mgruz...@pagerduty.com wrote:

software:
cytoscape: 3.7.1
python: 3.7.1 (default, Dec 14 2018, 13:28:58)
py2cytoscape: downloaded 1/28/2019 w/ pip install py2cytoscape


code:

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


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

--
You received this message because you are subscribed to the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.
To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.
To view this discussion on the web visit https://groups.google.com/d/msgid/cytoscape-helpdesk/b19684af-af0c-47cf-91f9-c89e34a2f310%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mgruzy

unread,
Jan 28, 2019, 9:19:29 PM1/28/19
to cytoscape-helpdesk
Yea, it is on the last line. I just tried an explicit path (I have read abd write access to) and the same issue is occuring.

Alex Pico

unread,
Feb 5, 2019, 4:10:26 PM2/5/19
to cytoscape...@googlegroups.com, Jorge Boucas
The developer of py2cy (cc’d) has just released an update that addresses this change in 3.7.1. Thanks again for reporting this!

 - Alex



mgruzy

unread,
Feb 5, 2019, 7:51:47 PM2/5/19
to cytoscape-helpdesk
Do I just do a pip install py2cytoscape or do I perform it on the developer link to get the updated patch?


On Monday, January 28, 2019 at 5:54:13 PM UTC-8, Alex Pico wrote:
Assuming you get the error on the last line, exporting. Can you try providing a full path to a directory you know you have permission to write to as the OutputFile parameter?  I suspect it’s trying to write to where you have Cytoscape installed and that is problematic for some reason (e.g., permissions).

 - Alex



On Jan 28, 2019, at 3:22 PM, mgruz...@pagerduty.com wrote:

software:
cytoscape: 3.7.1
python: 3.7.1 (default, Dec 14 2018, 13:28:58)
py2cytoscape: downloaded 1/28/2019 w/ pip install py2cytoscape


code:

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


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

--
You received this message because you are subscribed to the Google Groups "cytoscape-helpdesk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpdesk+unsub...@googlegroups.com.

Alex Pico

unread,
Feb 5, 2019, 7:54:50 PM2/5/19
to cytoscape-helpdesk, Jorge Boucas
Cc’ing developer...
 - Alex



To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.

To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.

jbo...@googlemail.com

unread,
Feb 6, 2019, 3:19:52 AM2/6/19
to cytoscape-helpdesk
Hi mgruzy,

```
pip3 uninstall -y py2cytoscape ; pip3 install git+https://github.com/cytoscape/py2cytoscape.git --user
```

Best,

Jorge
> To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages