networks-science-course

A course on Network Science, including network formation models, structural patterns, and dynamic processes.

This project is maintained by chatox

Practice Session 01: Cytoscape Basics

Materials for this session

:warning: Do not simply right-click on the file names below, or you will download an HTML file that will not be readable by Cytoscape. See how to download in the README of the data/ directory.

What you should deliver

What you should deliver is explained at the end of each practice handout. In short, it is a 4-pages report.

Contents of this session

  1. About Cytoscape
  2. Importing a network
  3. Editing nodes and edge styles
  4. Performing basic network analysis
  5. Using a Cytoscape app

0. About Cytoscape

Cytoscape is an open source software platform for visualizing complex networks and integrating these with any type of attribute data.

1. Importing a network

1.1. Import Zachary’s karate club

Let’s start with a simple case: Zachary’s Karate Club, which captures 34 members of a karate club at a university, with links representing interactions between members outside the club.

Do not use screenshots; use File > Export as image

1.2. Import the Star Wars characters network

Open a graph showing characters that appear or are mentioned in the same scene of a Star Wars movie. Each edge indicates how many scenes the characters appear together.

Remember: do not use screenshots; use File > Export as image

1.3. Import network of tortoises

Open a graph representing tortoises who shared a burrow in the Nevada desert. It is interesting because desert tortoises are assumed to be solitary animals, and this study based on radio tags showed the extent to which they can sometimes be social. The graph we use is a projection of a bipartite graph of tortoises and burrows.

Note: you can zoom in and zoom out with the mouse scroll wheel, you can also use the panel on the bottom-right of the screen to navigate the graph.

Final reminder: do not use screenshots; use File > Export as image

2. How to edit node and edge styles

You do not need to include anything from this part (part 2) in your report.

Reload the Karate Club dataset (karate.gml).

Now you can play with the “Style” panel (top-left, between “Network” and “Filter”). Here are some ideas.

2.1. How to change the style of the entire network

To style the entire networks in different ways:

2.2. How to name nodes

To include in each node its name:

To remove these names:

Note that node names might not be visible in large graphs until you zoom in. This is controlled by the setting under View > Always Show Graphics Details.

2.3. How to change the shape of node

To change the shape of nodes:

2.4. How to change edge width

To change the width of edges:

2.5. How to add arrows

To add arrows, you need a directed graph such as the company ownership dataset.

2.6. How to change the entire layout

Try some layouts (“Layout” menu)

You do not need to include anything from this part (part 2) in your report.

3. Basic network analysis

3.1. Closeness and betweenness in the Karate Club

Perform basic network analysis. Tools > Analyze network. Consider the network is not directed.

3.2. Plot degree distributions

Look at the results from the network analysis (you will need to go to View > Show results panel – if it does not show up, try hiding and showing the results panel)

Tip: the user interface of Cytoscape is a bit confusing, as the bottom panel needs to be showing Node Table for the Node Degree Distribution button to work properly.

3.3. Style the network

4. Use a Cytoscape App (ClusterMaker2)

Cytoscape has “apps” that can be installed and used.

4.1. Install ClusterMaker2

Install ClusterMaker2 (Apps > App Store). You may be able to install it directly from a browser, or you may need to download a jar file from the releases directory of clustermaker2, and then Apps > App Store > Install apps from file ... in the App Manager.

4.2. Use ClusterMaker2

Run the affinity propagation clustering algorithm in ClusterMaker2 (Apps > ClusterMaker cluster network > Affinity Propagation Cluster ...) on the Star Wars network.

4.3. Apply to Karate Club

Use ClusterMaker2 on the Karate Club

Karate Club

[REPORT] Include in your report an image of the Karate Club network with nodes painted according to clusters using the two methods you selected.

[REPORT] Include a brief commentary on what do you see in these clusters, and whether they have some relationship with the way in which the Karate Club actually splitted

DELIVER (INDIVIDUALLY)

:warning: First of all, read delivering your report on the evaluation guidelines, and check your report against those guidelines before submitting.

Deliver a brief report of at most 4 pages (it can be less!), in PDF format. Organize your report as follows:

Please be brief, you do not need to write too much; your report can be less than four pages. A “brief commentary” means one or two paragraphs.

Your report should end with the following text:

I hereby declare that all of the text, tables, and figures in this report were produced by myself.