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 02: Cytoscape Advanced

Materials for this Session

(See how to download in the README of the data/ directory)

Contents

  1. Importing networks
  2. Creating networks
  3. Editing networks

1. Working with a large network

The Marvel Universe Social Graph contains characters from the Marvel Universe that appear in the same comic number. It contains over half a million edges. It is formatted in the following way:

BLACK PANTHER/T'CHAL<tab>HAWK
BLACK PANTHER/T'CHAL<tab>LOKI [ASGARDIAN]
BLACK PANTHER/T'CHAL<tab>HULK/DR. ROBERT BRUC
SPIDER-MAN/PETER PAR<tab>HULK/DR. ROBERT BRUC
...

1.1. Import this network into Cytoscape

To import it into Cytoscape:

Tip: change the style to “minimal” to see the graph better.

[REPORT] Include this graph in your report.

[REPORT] What are the top 20 nodes with largest degree?

1.2. Create sub-graphs

[REPORT] Indicate the number of nodes and edges of this sub-graph, it appears on the left panel next to the name of the network.

[REPORT] Describe what you see in this graph. If you see any community structure, describe it.

:warning: Important: by default Cytoscape has a level of detail setting that is similar to the one found in videogames. If the current view contains more than render.nodeLabelThreshold, the node labels are not displayed. You can toggle between full details and reduced details using “View > Always Show Graphics Details”. You can also permanently adjust this by going to “Edit > Preferences”. Depending on the computer, you can set this up to 2000 from the default of 200. Be careful: this will block your computer when dealing with large networks such as the hero network.

2. Creating a network

Now we will practice creating small networks.

2.1. Creating from existing spreadsheets

We will create a network from two spreadsheets. The first one, got-characters.csv, contains the name and house of the characters in the series Game of Thrones by George R. R. Martin. The second one, got-relationships.csv contains relationships between characters.

First we import the edges:

Now we import the node attribute:

Next, style the network:

[REPORT] Include the graph of Game of Thrones.

[REPORT] Select and extract (i.e., File > New Network > From Selected Nodes, All Edges) a graph containing one clique of four or more characters. Indicate which characters are involved, and style the edges so that they show as label the relation between the characters.

[REPORT] Show two examples of a multi-edge in this graph. Indicate which characters are involved. Extract the corresponding (2-nodes) subgraphs.

[REPORT] Describe any observation you can make about how node attribute “house of birth” is distributed in the graph.

2.2. Create a new network in a CSV file

Now, create a network on your own using CSV files, on whatever topic of your choice as long as the network is real. You will need two CSV files: one for the network and one for the attributes. The network should include between 20 and 30 nodes.

Some ideas:

These are only ideas. Be creative.

Tip: to include a legend, you can use the Cytoscape app legend creator.

[REPORT] Describe the graph you created.

[REPORT] Include two tables with the contents of the CSV files you created (not screenshots).

[REPORT] Draw the graph in Cytoscape and include it in your report.

DELIVER (INDIVIDUALLY)

Deliver a report describing these networks, having at most 4 pages in PDF. The report should have four numbered sections:

Remember to include all of the elements marked [REPORT] above.

Note: If you find any mistake in the Game of Thrones graph, e.g., something wrong with respect to the TV series, please send us the corrected CSV files.

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.