Cytoscape: How to use the API with R?¶
As you have Cytoscape available in the Research Environment, can I always use it via an API using R?
Yes, the Cytoscape API is also functioning within our Research Environment. However, this requires some setting up, so please carefully follow the steps below for R/3.6.1.
1) Start up Cytoscape (Before you start up Rstudio)
Open the terminal and start up cytoscape by typing:
2) Start up Rstudio
Open a new terminal and start up Rstudio by typing:
3) Load the correct environment in R
R will require various packages to be loaded into your environment. Please add this to your R script, and run:
4) Basic checks
To run some basic checks to see if it worked, please run the following in R:
cytoscape.base.url <- "http://localhost:1234/v1" # Sets the default page RCy3::cyrestGET(base.url = cytoscape.base.url) # Provides detailed session info. If this (or similar) output # is not equal to your session, you may need to start over again. print(paste("Cytoscape Base URL: ",cytoscape.base.url, sep = ""))
5) Test functionality
To test whether your connection works, we are using an example provided by Cytoscape.
Please run the following lines in R:
This should result in Cytoscape constructing the network.
If the above is all fine, you are now set to use the Cytoscape API within our Research Environment!
This page was last updated on the 18 Dec 2020.