Code to retrieve and display an XGMML file from a REST API

24 views
Skip to first unread message

Arun Kumar

unread,
Jul 22, 2015, 3:52:29 PM7/22/15
to cytoscape-discuss

I have a REST based web service which outputs an XGMML file. I am able to import the url using File>Import>Network>URL an display the network.

I am trying to create an additional menu item under File which when clicked would automatically call the web service and display the XGMML output file. Could someone point me to the right classes in Cytoscape API to accomplish this? Thanks.

Kei

unread,
Jul 23, 2015, 12:28:41 PM7/23/15
to cytoscape-discuss, arunq...@gmail.com, arunq...@gmail.com
Hi.

You can do it by importing correct reader from OSGi service registry.  In your case, you need to get XGMMLReaderFactory from CyNetworkReaderManager:


So you can import this manager, and pass the stream to this.  It should return XGMMLReaderFactory.

Kei



2015年7月22日水曜日 12時52分29秒 UTC-7 Arun Kumar:

Arun Kumar

unread,
Jul 23, 2015, 2:24:36 PM7/23/15
to cytoscape-discuss, arunq...@gmail.com
Thanks Kei. But I am looking at a simpler way to implement this using Task Factories.:

final TaskIterator ti = adapter.get_LoadNetworkURLTaskFactory().loadCyNetworks(restAPIURL);
adapter.getTaskManager().execute(ti);
SynchronousTaskManager<?> synTaskMan = adapter.getCyServiceRegistrar().getService(SynchronousTaskManager.class);           
synTaskMan.execute(ti);   

This does not work. I am not sure how to get from TaskManager to actually displaying the network data on Cytoscape.

piet molenaar

unread,
Jul 24, 2015, 3:19:37 AM7/24/15
to Cytoscape-Discuss
Hi Arun, 
If you're serious about building your own app to achieve this, I'd advice you to walk through our app developer ladder first:

For your specific question you'd might consult the cookbook

Hope this helps,
Piet

--
You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-disc...@googlegroups.com.
To post to this group, send email to cytoscap...@googlegroups.com.
Visit this group at http://groups.google.com/group/cytoscape-discuss.
For more options, visit https://groups.google.com/d/optout.



--
Piet Molenaar
piet...@gmail.com
Department of Oncogenomics, M1-131
Academic Medical Center
University of Amsterdam
Meibergdreef 9
1105 AZ Amsterdam
the Netherlands

tel (+31) 20-5666592
fax (+31) 20-6918626

Arun Kumar

unread,
Jul 24, 2015, 1:48:51 PM7/24/15
to cytoscape-discuss, arunq...@gmail.com
Piet, I have already looked at the sites you mentioned. Most of the examples there are rudimentary. I could not find anything as simple as reading a network file and displaying the network.

On Wednesday, July 22, 2015 at 3:52:29 PM UTC-4, Arun Kumar wrote:
Reply all
Reply to author
Forward
0 new messages