A course on Network Science, including network formation models, structural patterns, and dynamic processes.
This project is maintained by chatox
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 is explained at the end of each practice handout. In short, it is a 9-pages report.
Basic concepts:
Advanced concepts:
Cytoscape is an open source software platform for visualizing complex networks and integrating these with any type of attribute data.
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.
File > Import > Network from File ...
karate.gml
Layout > Compound Spring Embedder
Tools > Analyze network
(do not check “directed”) and look at the Node table
displayed under the graphDo not use screenshots; use File > Export as image
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.
File > Import > Network from File ...
reptilia-tortoise.graphml
Layout > Prefuse Force Directed Layout
File > New Network > From selected nodes, all edges
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.
Reminder: do not use screenshots; use File > Export as image
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.
To style the entire networks in different ways:
Styles
, e.g. “Rippled”, “Curved”, or others.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
.
To change the shape of nodes:
To change the width of edges:
Try some layouts (“Layout” menu)
You do not need to include anything from this part (part 2) in your report.
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.
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
...
To import it into Cytoscape:
marvel-hero.csv
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 the largest degree?
File > New Network > From selected nodes, all edges
[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.
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.
Now we will practice creating small networks.
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:
File > Import > Network from file ...
got-relationships.csv
src
: “Source Node” (it’s a green disc)dest
: “Target Node” (it’s a red target)Now we import the node attribute:
File > Import > Table from file ...
got-characters.csv
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.
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.
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 9 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 nine 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.