Visualizing Expression Data

Probably the most common use of expression data in Cytoscape is to set the visual attributes of the nodes in a network according to expression data. This creates a powerful visualization, portraying functional relation and experimental response at the same time. Here, we will walk through the steps for doing this.

Loading Network

  • Start Cytoscape and download the demo session.
  • Open the demo session using File → Open...
  • When the network first opens, the entire network is not visible because of the default zoom factor used. To see the whole network, we can use the View → Fit Content function.

Label the Nodes

  • Open the Styles interface by selecting its tab in the Control Panel (the leftmost panel). We are going to use the COMMON name attribute to give the nodes useful names:
  • Zoom in on the network so that node labels are visible.
  • Click the second column of the Label row in the Styles panel. This should produce a drop-down panel with Column and Mapping Type.
  • Change the Column to COMMON by clicking on the field to the right of the Column label. This should bring up a list of columns. Select COMMON.
  • Verify that the node labels on the network have changed to their common names.
  • By default, the Mapping Type is Passthrough Mapping, which is what we want to use. Other options are Discrete Mapping and Continuous Mapping.

Color the nodes

  • Click on the middle square (Map.) next to the Fill Color row in the Styles panel.
  • Click the -- select value -- cell in the Column section.
  • In the drop-down menu of available column names, select gal80Rexp.
  • Click the -- select value-- cell in the Mapping Type section.
  • In the drop-down menu of available mapping types, select Continuous Mapping.
  • This produces a default gradient ranging from blue to red for expression values. Notice that the nodes in the network change color.
    For our purposes, this default gradient works so we don't need to edit it.
  • Click on the color gradient to change the colors. This will pop-up a gradient editing dialog.
  • We're going to build a basic blue-white-yellow gradient for our expression values.
  • Drag the left-most, black inverted triangle handle along the top of the gradient. Drag it to an value of approx. -1.2. Double-click on the handle and set a color in the blue range.
  • Drag the white inverted triangle handle to approx 0.5. You can type the value in the Handle Position section to be more precise.
  • Add a new handle by clicking Add, and drag that handle to 2.5. Set the color to yellow.
  • Finally, set the Maximum Color by double-clicking on the white, left-pointing triangle. Set it to green.
  • You can also change the color of each handle by double-clicking or using the Node Fill Color selector button in the Handle Settings section.
  • This should produce a Blue-White-Yellow Color gradient like the image below, with min and max extremes colored black and green, respectively.
  • Click OK to save the gradient adjustment dialog and verify that the nodes in the network reflect the new coloring scheme.

Set the Default Node Color

Note that the default node color of pale blue falls within this spectrum. A useful trick is to choose a color outside this spectrum to distinguish nodes with no defined expression value and those with slight repression.

  • Click the Def. (leftmost) square next to Fill Color and choose a dark gray color.
  • Zoom out on the network view to verify that a few nodes have been colored gray.

Set the Node Shape

We imported both expression measurement values and corresponding significance values. We can use the significance values to change the shape of the nodes so that measurements we have confidence in appear as squares while potentially bad measurements appear as circles.

  • Click the Map. cell next to the Shape row in the Style panel.
  • Click the -- select value -- cell next to Column.
  • In the drop-down menu of available column names, select gal80Rsig.
  • Click the -- select value -- cell next to Mapping Type.
  • In the drop-down menu of available mapping types, select Continuous Mapping.
  • This will create an empty icon in the Current Mapping row of the Shape section. Click on this icon.
  • This action will pop-up a continuous shape selection dialog.
  • Click the Add button.
  • This splits the range of values with a slider down the middle with a node shape icon to either side.
  • This will pop-up a node shape selection dialog.
  • In the node shape selection dialog, choose the Rectangle shape and click the Apply button.
  • Click the black triangle and move the slider to the left, to slightly lower that 0.05, our threshold for significance.
  • Close the continuous shape selection dialog and verify that some nodes now have a square shape.

The network should now look like this:

Fun with Charts

In addition to coloring the nodes, Cytoscape also provides the ability to draw charts and graphs on each node. For example, suppose we wanted to display a bar chart showing all of the expression values on each of our nodes?

  • To reset things a little, remove the mapping for Fill Color by doing a Right-Click over the Fill Color row and selecting Edit → Remove Mappings from Selected Visual Properties.
  • Now change the default value to a lighter shade of grey so we can see our chart.
  • Near the top of the panel, select Properties and choose Paint → Custom Paint 1 → Image/Chart 1. This will add a new row in our list of Node Visual Properties called Image/Chart 1.
  • Select the Def. (leftmost) cell in the Image/Chart 1 row to bring up the Graphics dialog.
  • Select the Charts tab.
  • Move the three columns containing the expression data (gal1RGexp, gal4RGexp, gal80Rexp) from Available Columns: to Selected Columns: by selecting the rows and clicking the right arrow. This indicates that we're going to use the data from these three columns to create our chart.
  • Now select Heat Strips for the type of bar chart.

  • Click on Options if you want to add labels to the graphs, change the default coloring, etc.
  • Click Apply to see the resulting charts.