How to use a Cytoscape application from Cyrest ?

101 views
Skip to first unread message

Pascal KREZEL

unread,
Nov 7, 2016, 3:10:52 AM11/7/16
to cytoscape-helpdesk
Hi, 

Is there a way to use a Cytoscape application from Cyrest ?
From example I would like to use the Community cluster (GLay) from ClusterMaker ?

Pascal

Scooter Morris

unread,
Nov 7, 2016, 12:21:28 PM11/7/16
to cytoscape...@googlegroups.com
Hi Pascal,
    Yes, but you should be aware that there are some unfortunate quirks.  You can call apps (clusterMaker2 in particular) using the /v1/commands branch of the REST service.  So, to execute GLay, you would issue the request: http://localhost:1234/v1/commands/cluster/glay?network=yyy&selectedOnly=false where yyy is the name of the network you wish to cluster.  This will result in a plain text response when it's complete.  We're in the process of changing things up so that the command responses are in JSON.

-- scooter
--
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.
For more options, visit https://groups.google.com/d/optout.


Ruth Isserlin

unread,
Nov 7, 2016, 3:24:37 PM11/7/16
to cytoscape...@googlegroups.com
Hi Scooter, 
There are some quirks with cyrest.  One that I am struggling with right now is I am using this documentation (http://idekerlab.github.io/cyREST/) to find all the cyrest features and I keep forgetting that there are way more that I can use in the command interface.  i realize that the commands available are dependent on the apps that you have installed but it would be helpful to incorporate the set of potentially available commands to this documentation as well (especially the ones that come already installed with cytoscape  like table, network, node,edge, layout....)
I just changed the way I was creating networks because I couldn’t figure out how to create a table from a file and I just found it in the command set :( 
Thanks, 
Ruth 

Pascal KREZEL

unread,
Nov 8, 2016, 12:34:02 PM11/8/16
to cytoscape-helpdesk
Hi Scooter,

I followed your explanations and I got an answer:


Pascal


Le lundi 7 novembre 2016 18:21:28 UTC+1, Scooter Morris a écrit :
Hi Pascal,
    Yes, but you should be aware that there are some unfortunate quirks.  You can call apps (clusterMaker2 in particular) using the /v1/commands branch of the REST service.  So, to execute GLay, you would issue the request: http://localhost:1234/v1/commands/cluster/glay?network=yyy&selectedOnly=false where yyy is the name of the network you wish to cluster.  This will result in a plain text response when it's complete.  We're in the process of changing things up so that the command responses are in JSON.

-- scooter


On 11/07/2016 12:10 AM, Pascal KREZEL wrote:
Hi, 

Is there a way to use a Cytoscape application from Cyrest ?
From example I would like to use the Community cluster (GLay) from ClusterMaker ?

Pascal
--
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.

Scooter Morris

unread,
Nov 8, 2016, 10:54:39 PM11/8/16
to cytoscape...@googlegroups.com
Short answer: you can't (remember I said there were some "quirks").  Once the cluster is complete, the network will have a new column (I *think* it's __glay, but you should run a cluster manually to confirm).  That column will assign each node to a cluster number that you can read with CyREST.

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

Pascal KREZEL

unread,
Nov 9, 2016, 10:34:56 AM11/9/16
to cytoscape-helpdesk
Hi Scooter,

Thank you for your answer.

What should I do to get this column ?

Pascal

Ruth Isserlin

unread,
Nov 9, 2016, 10:42:53 AM11/9/16
to cytoscape...@googlegroups.com
Hi Pascal, 
The easiest thing is to get the whole node table:
http://localhost:1234/v1/networks/52/tables/defaultnode/rows/

Where 52 is the network suid. 

Thanks, 
Ruth

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

Pascal KREZEL

unread,
Nov 22, 2016, 12:18:10 PM11/22/16
to cytoscape-helpdesk
Hi Scooter,

My network in CyREST is named "net".

if I do : 
nothing happens, there is no new column with the result of GLay.

Is it really possible to get such result ?

Pascal

Scooter Morris

unread,
Nov 22, 2016, 12:25:42 PM11/22/16
to cytoscape...@googlegroups.com
Hi Pascal,
    The namespace is actually "cluster", not "clustermaker".  Give this a try:


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

Pascal KREZEL

unread,
Nov 23, 2016, 2:56:32 AM11/23/16
to cytoscape-helpdesk
Hi Scooter;

Thank you for your answer.

I finally succeeded but with GET and not POST : 

                             requests.get("http://localhost:1234/v1/commands/cluster/glay?network=subnet_1&selectedOnly=false")

Thank your for your help.

Pascal

Pascal KREZEL

unread,
Nov 23, 2016, 3:36:38 AM11/23/16
to cytoscape-helpdesk
Hi Scooter;

Thank you for your answer.

I finally succeeded but with GET and not POST : 

                             requests.get("http://localhost:1234/v1/commands/cluster/glay?network=subnet_1&selectedOnly=false")

I remarked also an instability in the answer of CyREST. One time, I got the complete action of GLay (with the creation of a new network)  and in a second time I got only the addition of the "_glayClus" column !

Thank your for your help.

Pascal

Giovanni Urgo

unread,
Jan 5, 2021, 4:47:29 PM1/5/21
to cytoscape-helpdesk

Hi guys, sorry I was having a similar problem. 
I would like to run Glay clustering from ClusterMaker using R (Rcy3).

Is there any way to do so?? 

Thank you very much !
Giovanni

Scooter Morris

unread,
Jan 14, 2021, 11:42:06 AM1/14/21
to cytoscape-helpdesk
Hi Giovani,
   Even easier.  RCy3 has methods called commandRUN and commandPOST that deals with all of the underlying REST calls.   If you look at the help for "cluster glay" you can see:

help cluster glay

This is an implementation of the fast-greedy optimization of of the modularity score, with different corrections on edge density and cluster size.

cluster glay arguments:
clusterAttribute=<String>: Cluster attribute name 
createGroups=true|false: Create groups (metanodes) with results 
network=current|[column:value|network name]: Network to cluster
restoreEdges=true|false: Restore inter-cluster edges after layout 
selectedOnly=true|false: Cluster only selected nodes 
showUI=true|false: Create new clustered network 
undirectedEdges=true|false: Assume edges are undirected

If you just construct the command you want, you can use commandRUN to run it.

-- scooter
Reply all
Reply to author
Forward
0 new messages