An Introduction to Using Cytoscape 2.8.X for EFI Networks
The following tutorial has been modified from the Cytoscape Wiki to specifically address working with networks created by the Enzyme Function Initative (EFI). To view Cytoscape’s extensive tutorial pages, please go here.
Contents of this Tutorial
Go to http://www.cytoscape.org/download.html and download a copy of Cytoscape. We recommend you use version 2.8.2 or 2.8.3. In order to open files, you may need to adjust the memory allocations on your computer. View a guide for this here.
Before starting, you will need a dataset in the form of an xgmml file. Here is an example file for you to begin with if you do not have one already. Launch Cytoscape. You should see a window that looks like this:
Load your network file into Cytoscape by selecting File → Import → Network(Multiple File Types)... , then click the Select button and specify the location of your .xgmml file. Once loaded, click close on the Loading Network popup window. The example file consists of 497 edges observed between 60 proteins, which you can see in the left-hand pane.
Now your screen should look like this:
The initial view is not informative, but this is normal. Under the Layout menu, select Cytoscape Layouts → yFiles→ Organic. After a brief calculation, your screen should look like this:
On the Cytoscape canvas (the blue window showing the network graphic), you can select single nodes by clicking with the mouse or multiple nodes by holding shift and clicking. You may also click and hold in the white space to drag out a rectangle which will select multiple nodes within a given area. Notice that if you right click (control+click on Mac) on any node, you will get a sub-menu to carry out node-specific actions or access external links via LinkOut, such as to UniProtKB.
Notice that at the very bottom of this window is the Data Panel. It looks like this:
Select a few nodes and you will see protein-specific information (“Node Attributes”) appear in the data table. You can use the icons on the upper left to choose which attributes to display. As shortcuts, the third icon and the fourth icon will display all or none of the attributes, respectively. Double click (single click for Windows) the top of any column to sort the attributes in numerical or alphabetical order. You may also detach the data panel by clicking the icon in the upper right hand corner. To load and map your own Node Attributes, see this tutorial.
You can search Node Attributes using the search field at the top of the window, but you must make sure the search is configured to the appropriate attribute. Click the icon to the right of the field and select the appropriate attribute in the pop-up window.
As you enter in your search, the field will autofill and provide the number of hits for that search. If the search is not working, the field will turn red and “0 hits” will be displayed. A node that matches the search will be highlighted in the network and also appear in the Data Panel.
There are many options for changing the network graphically. Begin by opening the VizMapper left-hand panel. Double clicking in the “Defaults” pane will allow you to change basic parameters such as node shape, line thickness, and backgroud color. To appy a visual style to a subset of nodes, use the Visual Mapping Browser (in the Control Panel just under the camera icon). While you can adjust the visual properties of any feature, below is the basic process of changing node color.
1) Under the Visual Mapping Browser, double click on Node Color to activate it.
2) In the Node Color dropdown list, select the Node Attribute that you want to color by (e.g. cluster size). A list should now appear with the values possible (e.g. 1, 147, 1029).
3) Go to the dropdown list for Mapping Type and select, for example, Discrete Mapping. Discrete mapping will allow you to select a different color for each node.
4) Click the space next to each value and then click the small icon with the ellipsis that appears. Select the color your prefer for the value. For example, all nodes with a cluster size > 100 are colored in the example network below.
For more information on changing visual styles in Cytoscape, view tutorial here.
There may be times when you want to view a network at an e-value more stringent than the one you used to generate the network. This can be done within Cytoscape instead of having to redo the network altogether.
1) Open network in Cytoscape and make a copy of the network: File → New → Network → Clone Current Network (may take a minute)
2) Open Filters dialogue box: Select → Use Old Filters
3) In the Use Filters window (below), select Create New Filter and choose Numeric Filter (default will be "Node : null=0.0")
4) Configure filter by setting "Select graph objects of type" to Edge from dropdown menu, setting "with a value of numeric attribute" as -log 10(E) from dropdown menu, setting "that is" as < from dropdown menu and entering desired stringency as an integer X where X is the exponent in the form of 10-X, and hit return (the filter name should change automatically)
5) Hit the Apply Selected Filter button and the edges > than the set Evalue will turn red (may take a minute)
6) Delete red edges: Edit → Delete Selected Nodes and Edges
7) Re-do the layout: Layout → yFiles → Organic
Or click here to view a detailed tutorial.
Cytoscape can save all workspace states, including networks, attributes, visual styles, properties, and window sizes, into a session file (.cys). To save as a session, click the Save icon on the toolbar and a .cys file will be saved.
To open the session file, click the Open Session File... icon on the toolbar. A warning pop-up window will be shown. Click Yes and select a session file. By doing this, everything will be restored automatically from the file.