Module 3 Lab Primer: Cytoscape Primer
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. This means that you are able to copy, share and modify the work, as long as the result is distributed under the same license.
By Gary Bader, Ruth Isserlin, Chaitra Sarathy, Veronique Voisin
Goal of the exercise
Create a network and customize it.
The goal of this exercise is to learn how to create a network in Cytoscape and customize id. In this example, the proteins are the entities represented as nodes in the network and known physical interactions are the connections between the proteins that are represented as edges. We will overlay 2 additional pieces of information about these proteins, mutation information per protein as node color and mutation expression as node size.
Data
- The data used in this exercise is a set of protein - protein interactions and associated attributes.
Start the exercise
To start the lab practical section, first create a cytoscape_primer_files directoty on your computer and download the files below.
Right click on link below and select “Save Link As…”.
Place it in the corresponding module directory of your CBW work directory.
Two files are needed for this exercise:
Exercise 1a - Create Network from table
- Launch Cytoscape
- Locate the top menu bar and select File,–> Import, –> Network from File….
- Browse your computer and select the file networktable.txt
- An Import Network from Table dialog box opens. The 3 columns of the table should be set as “source”, “interaction” and “target” respectively.
Cytoscape will assume, by default, will look for the column names that start with “source”, “interaction” and “target”. It will assume that any other column is an interaction attribute (edge attribute)
- This is just an example file. You can import files with any number of additional columns and choose to ignore all columns except for the ones that you want to import or import all of them. Although Cytoscape tries to guess the data type of each column and the type (ie. is it an attribute associated with source node, target nodes or the interaction) you are able to fine tune everything.
- Click “Ok”.
- A network containing the proteins as blue square nodes and interaction as edges should be displayed in the main Cytoscape window.
Exercise 1b - Load node attributes
Locate the Cytoscape top menu bar and select File,–> Import,–> Table from File….
Browse your computer and select the file nodeattribute.txt
click “Open”.
An “Import Table from Columns” dialog appears.
Click on “OK”.
You should be able to see the imported attributes in the node table.
-
The key column is assumed to be the first column in your
table.
- The key is the column in the loaded attribute file used to match your attributes to your network.
- key colum for Network is the column in the Network that the key is matched to. (In this network there isn’t the ability to set this value because that is the only attribute associated with the nodes in our network but normally this drop box will be selectable)
- The key and matching column need to match perfectly (unless you have specifid that case does not matter).
Similiar to the Import Network from Table, everything about the import is customizable. Cytoscape does its best to guess the datatypes of each column but you are able to fine tune it.
There are also advanced options if you want to:
- change the file delimiter
- skip lines
- specify the header column
Exercise 1c - Map node attributes to Visual Style
Go to “Control Panel” on the left side and select the “Style” tab. Make sure that you are in the “Node” tab.
Select the “Fill Color” field
expand it by clicking on the right arrow.
Set “Column” to “expression” and “Mapping Type” to “Continuous Mapping”.
This will change the colours of the nodes to the default colour coding.
Double click on the continuos mapping colour box to manually adjust the colour and other settings.
At the bottom of the “Style” tab, check the box “Lock node width and height”.
Select the “Size” field and
expand it by clicking on the right arrow.
Set “Column” to “mutation” and “Mapping Type” to “Continuous Mapping”.
Your resulting network maps expression to the colour of the node and the size of the node to the number of mutations.
- Adjust the setting on the colour mapping. Change the colour scheme. Change the maximum and minimum values.
- Adjust the setting on the size mapping. Make the nodes bigger with higher values.
- Eventhough the network is small, play around with the layouts.
Exercise 2 - Work with larger networks
Cytoscape supplies a few demo networks that you can play around with. When you open cytoscape you are presented with a Start Panel where you can choose to reload a previous session or load in one of the sample networks.
You do not need to re-open cytoscape to open the starter panel. Locate the Cytoscape top menu bar and select View,–> Show Starter panel.
Double click on the Affinity Purification Network to open it.
If you already have a session open then you will recieve a warning that the current session will be lost. Before proceeding make sure your current session is saved. (Click on cancel. Then, File –> Save as)
Once the network has loaded you will see a network of protein interactions derived from an affinity purification experiment. Bait proteins are reprsented as pink hexagons and their corresponing prey proteins blue boxes.
Using this larger network play around with the different layouts
- Search for the node “VPR”
- select all of the prey proteins associated with “VPR”
Exercise 3 - Perform basic enrichment analysis using EnrichmentTable
In Module 2 we performed detailed enrichment analysis with g:profiler and GSEA. We supplied gene lists and ranked expression sets in order to perform the analysis. What if you want to run a quick enrichment analysis with a given network or a given subset of the network? The easiest way to do this is to use the cytoscape app EnrichmentTable. EnrichmentTable will query g:profiler directly with the given network or subnetwork. Not all of the parameters that are available in the web version can be tweaked from the enrichmentmap table app but it can be an easy way to quickly see enrichment results.
We will select the bait protein VPR and all its associated prey proteins to use for an enrichment analysis.
Bait Protein - Is the labelled protein in an
affinity purification experiment that is pulled down.
Prey Protein - are the proteins that are associated
with the bait protein when it is pulled down and are assumed to interact
with the bait protein.
First neighbor - are all the
nodes that are directly connected to the given node
1. In the search bar enter “VPR”. Press enter.
- VPR is now the only highlighted node in the network. In order to select all its associated preys we need to select all the nodes that are connected to VPR, all of VPR’s first neighbours. There are two ways to select the first neighbours:
- In the top menu bar click on Select –> Nodes –> First neighbors of selected nodes –> undirected
- Click on the first neighbor button, , in the quick links button set.
- Click on the “Enrichment Table” in the Table Panel.
- Click on the cog icon in the top right hand corner of the Enrichment Table panel
- This will bring up a panel with the adjustable settings. There are only 5 adjustable parameters-
- Organism - This shows a list of organisms that are available on the g:Profiler site.
- Gene ID column - the column in the current network that you want to use to search g:Profiler with. Ideally this should be a column specifying the Gene Name or other identifier.
- Multiple testing correction - change to fdr.
- Adjusted p-value threshold (min 0 max 1) - leave as 0.05. If you are getting too many results you can make this value smaller.
- Include inferred GO annotations (IEA) - by default the search will exclude inferred from electonic annotation GO terms. If you want to include them, select this option.
By default, EnrichmentTable automatically uses all the databases available on the g:Profiler site. There is no way to filter prior to running the analysis. You need to filter the results after the analysis has been run. This will change the results because you end up filtering the results after the multiple correction and the multiple correction is dependent on the number of genesets you are testing with.
- Filter the EnrichmentTable results to show only GO:BP, Reactome and Wikipathway, similiar to what we used in Module 2.
- Click on the filter icon in the top left hand corner of the enrichment table results.
- Next to Select Categories select Gene Ontology Biological Process, Reactome, Wikipathways. To select multiple options click and hold command key on Mac or Shift on Windows.
- click on OK
- The EnrichmentTable will update to only include the sets from Gene Ontology Biological Process, Reactome, Wikipathways.
Exercise 3B - create Enrichment Map and Enhanced graphics nodes from EnrichmentTable
-
To create an Enrichment Map from the EnrichmentTable results, Click on the EM logo in the top left hand bar in the ErichmentTable Panel.
- This will bring up an EM options panel with very limited parameter adjustments. You can only change the name of the network and the connectivity threshold. You have already specified the p-value threshold when you originally performed the analysis. If you want to create your network with a more permissive q-value you need to go back to the EnrichmentTable search panel. Click on OK
- This will create an Enrichment Map in a new network and represents all the Gene Ontology Biological Process, Reactome, Wikipathways terms enriched for the VPR and its prey protein set.
Exercise 4 - Load network from NDex
NDex is an open-source repository where scientists can store, share, manipulate and publish biological network data. Networks are viewable on the web through their webapp but can also be downloaded directly into cytoscape so you can search, manipulate, integrate and analyze the given network for yourselves.
For the purpose of this exercise we are going to load in a network from the publication A protein landscape of Breast Cancer. This publication is associated with multiple networks the the authors of this paper created and shared in NDex - https://www.ndexbio.org/index.html#/networkset/4423340d-e8e3-11eb-b666-0ac135e8bacf
- Start a new session. File –> Close
- In the Network Search bar (located at the top of the control panel) make sure that the search provider is set to NDex.
It should be set to NDex by default but click on down arrow to see the different data sources you can search for. Later in the workshop we will be using this bar to query GeneMania.
-
Enter MCF7_All_PPI>=0.9 into the search box, Click on the search icon.
-
A search results box will appear. The MCF7_All_PPI>=0.9 network is just one of the networks associated with this publication. Eventhough you are searching for this specific network, other networks associated with the original paper will also show up in the search results as well as others.
- Click on the green down arrow next to MCF7_All_PPI>=0.9, the network will start to import.
- Once the network has been loaded, click on Close Dialog
-
Resulting network loaded into cytoccape.
Description taken from NDex
record
- Baits are shown as yellow box, and
- preys as grey circle.
- Size of each node represents number of patients with alterations in each protein.
- Dotted line represents the physical protein-protein association (validated in other studies) with high Integrated Association Stringency score.
- Change the edge width to reflect the number of patients the associations is found in instead of the PPI score.
- Change the default node colour to blue.