LSMA

LONDON SCHOOL OF MULTIOMICS & AI

Free course

Free course

0 of 73 lessons

Lesson 5 of 9

Module 7 · From genes to function

Biological networks and systems biology

Biological networks and systems biology

Biological networks and systems biology

How to turn a list of parts into a map of connections: nodes and edges, where interaction data come from, hubs, bridges and modules, and why two genes that rise together need not touch.

⏱ 15 min readModule 7 · From genes to functionFree
Lesson at a glance6 steps · about 15 min
  1. From parts lists to connections
  2. Where interaction data come from
  3. Describing a network
  4. Building the network in Python
  5. Modules, and what happens when a node is lost
  6. Correlation is not interaction

From parts lists to connections

The lessons from Finding genes and annotating a genome to Pathways and enrichment analysis turned sequences into parts: genes found in DNA, domains in proteins, structures in 3D, and pathways that a gene list falls into. But a cell is not a bag of separate parts. Proteins bind each other, enzymes pass products along, and regulators switch genes on and off. Systems biology is the study of how those connections produce the behaviour of the whole cell, and the network is its basic picture.

A network (also called a graph) has two ingredients. A node is one thing, such as a protein, a gene or a metabolite. An edge is a link between two nodes, such as "these two proteins bind". The pattern of nodes and edges is the network's topology, its shape. The same mathematics applies whether the nodes are proteins, neurons or species in a food web, which is why network ideas spread so quickly into biology.

Biology uses several kinds of network, and they mean different things:

  • A protein–protein interaction network links proteins that bind or work together. Its edges have no direction.
  • A gene regulatory network links a regulator, such as a transcription factor, to the genes it controls. Its edges have a direction: A switches on B is not the same as B switches on A.
  • A metabolic network links metabolites through the enzymes that convert one into another, as in the pathways of Pathways and enrichment analysis.
  • A co-expression network links genes whose RNA levels rise and fall together across samples. Its edges are statistical, not physical, and the last section explains why that matters.

The kind of network decides what questions it can answer. A path through a protein–protein interaction network says "these proteins are connected by a chain of binding", which hints at shared work but not at the order of events. A path through a gene regulatory network, because its edges have direction, says "A can influence B, through these steps", which is a claim about cause. Reading a network of one kind as if it were another is one of the commonest mistakes in this field.

Where interaction data come from

Physical interactions are measured in the laboratory. In a yeast two-hybrid screen, two proteins are fused to the two halves of a switch, and the switch only works if the proteins bind. In affinity purification with mass spectrometry, one protein is pulled out of cells with everything stuck to it, and mass spectrometry (Proteomics and metabolomics) identifies the partners. Databases such as BioGRID and IntAct collect these experimental results from published papers.

The two methods find different things, and each has typical errors. Yeast two-hybrid tests pairs directly, so it finds binary interactions, where two proteins touch, but it takes them out of their normal place in the cell, and some proteins switch the reporter on by themselves and seem to bind everything. Affinity purification finds whole complexes: if protein A is pulled out, every member of its complex comes too, including members that never touch A directly. Proteins that are very abundant or sticky turn up in many purifications by chance, so careful studies compare against control purifications. When the same pair is found by both methods, or in several independent studies, it is far more trustworthy than a single report.

STRING is the database most people meet first. For each pair of proteins it combines several kinds of evidence: experiments, curated pathway databases, co-expression, genes that sit next to each other or are fused in other genomes, and text mining, which counts how often two names appear together in papers. Each pair gets a combined score between 0 and 1, an estimate of how likely the link is to be real. STRING suggests 0.4 as medium confidence, 0.7 as high and 0.9 as highest. You type in one protein or a list, choose an organism and a score threshold, and STRING draws the network and offers it for download as a table of edges.

Two cautions apply from the start. A STRING link means "these proteins are functionally associated", not always "these proteins touch". And well-studied proteins collect more links simply because more people have looked at them, a problem called study bias.

The current description of STRING is Szklarczyk et al. 2023, Nucleic Acids Research, covering version 12. STRING calibrates its scores against a benchmark of known pathway membership, so a score estimates how likely two proteins are to work in the same pathway, not how likely they are to touch. When you publish a STRING network, report the version, the organism, the score threshold and which evidence channels were switched on. Text mining is one of those channels, and you can turn it off if you want only experimental and database evidence.

Describing a network

The degree of a node is the number of edges it has. A hub is a node with a much higher degree than most. Many biological networks have a few hubs and a great many nodes with only one or two links. Betweenness measures how often a node lies on the shortest route between other pairs of nodes; a node with high betweenness is a bridge, and removing it can split the network. A module, or community, is a group of nodes more densely linked to each other than to the rest, which often matches a protein complex or a shared job.

In a directed network, such as a gene regulatory network, degree splits in two. The in-degree is the number of edges pointing into a node: how many regulators control it. The out-degree is the number pointing out: how many genes it controls. A transcription factor that controls hundreds of genes has a high out-degree, while a gene controlled by many regulators has a high in-degree. Both can be called hubs, but they mean different things.

The figure shows a small network of well-established links among 15 human proteins, from the DNA damage response and the cell cycle. You will build the same network in code.

Biological networks and systems biology · LSMA free course Fifteen proteins joined by sixteen links. TP53 sits in the middle with six links, the most of any protein. On its left are ATM, CHEK2, BRCA1 and BARD1; above it MDM2 and MDM4; below it EP300. To its right, CDKN1A links TP53 to PCNA and to CDK2, which links to the cyclins CCNE1 and CCNA2; CCNA2 links to CDK1, which links to CCNB1. CDKN1A is marked as the bridge between the two halves. 15 PROTEINS · 16 LINKS TP53 · 6CDKN1A MDM2MDM4ATM CHEK2EP300BRCA1 BARD1PCNACDK2 CCNE1CCNA2CDK1 CCNB1 Navy: the hub, with the highest degree. Vermilion outline: the bridge whose removal splits the network into three pieces.
Each pill is a protein and each line a well-established link. Count the lines touching a pill to get its degree: TP53 has six. Everything on the right reaches TP53 only through CDKN1A. Links simplified for teaching; positions carry no meaning.

How to read this figure

Distance and position on a network drawing mean nothing; only the lines do. Start at TP53, the protein p53, which senses DNA damage and decides whether a cell pauses, repairs or dies. MDM2 and MDM4 hold p53 in check, and EP300 adds chemical tags that help activate it. BRCA1 and its partner BARD1 work in repairing broken DNA. ATM and CHEK2 are kinases that switch p53 on after DNA breaks. CDKN1A makes p21, a brake on the cell cycle that p53 switches on; p21 binds CDK2 and PCNA. CDK2 and CDK1 are the cell-cycle engines, each working with partner cyclins (CCNE1, CCNA2, CCNB1).

Go deeper: is my gene list more connected than chance?

A common question is whether a list of hit genes forms a tighter network than a random list would. Counting the links among them is not enough, because some genes have many links in any database. A fair test compares your list with many random lists of the same size, ideally matched for degree, so that hubs are not over-represented.

STRING does a version of this for you and reports a "PPI enrichment p-value" for any list you enter. Suppose 50 hit genes share 60 links, while random sets of 50 typically share about 20. That suggests the hits are functionally related. But study bias returns here: if your hits are mostly famous genes, they will be well connected for that reason alone. Degree-matched random lists help with this, and a result that survives them is more convincing.

Building the network in Python

This lesson needs networkx, a package for networks, and numpy. Both are already installed in Google Colab.

Python
import networkx as nx

# Well-established links between human proteins (binding, phosphorylation
# or direct regulation), simplified for teaching
links = [("TP53", "MDM2"), ("TP53", "MDM4"), ("MDM2", "MDM4"),
         ("ATM", "TP53"), ("ATM", "CHEK2"), ("CHEK2", "TP53"),
         ("TP53", "EP300"), ("TP53", "CDKN1A"), ("ATM", "BRCA1"),
         ("BRCA1", "BARD1"), ("CDKN1A", "PCNA"), ("CDKN1A", "CDK2"),
         ("CDK2", "CCNE1"), ("CDK2", "CCNA2"), ("CDK1", "CCNA2"),
         ("CDK1", "CCNB1")]

G = nx.Graph()
G.add_edges_from(links)
print(G.number_of_nodes(), "proteins,", G.number_of_edges(), "links")

degree = sorted(G.degree, key=lambda pair: pair[1], reverse=True)
print("Highest degree:", degree[:3])

between = nx.betweenness_centrality(G)
top = sorted(between, key=between.get, reverse=True)[:3]
print("Highest betweenness:", [(p, round(between[p], 2)) for p in top])

What this does

  • links is a list of pairs. Each pair, such as ("TP53", "MDM2"), is one edge. The nodes do not need to be listed separately; networkx adds them as it meets them.
  • nx.Graph() makes an empty network whose edges have no direction. add_edges_from fills it.
  • G.degree gives each node with its degree. sorted(..., key=lambda pair: pair[1], reverse=True) sorts those pairs by their second item, the degree, largest first. [:3] keeps the top three.
  • nx.betweenness_centrality(G) returns, for each node, the share of shortest routes between other pairs that pass through it, from 0 to 1.
15 proteins, 16 links Highest degree: [('TP53', 6), ('ATM', 3), ('CDKN1A', 3)] Highest betweenness: [('TP53', 0.69), ('CDKN1A', 0.58), ('CDK2', 0.47)]

Reading the output

Fifteen proteins and sixteen links, as in the figure. TP53 has six links, twice as many as anyone else. ATM and CDKN1A have three each; CDK2 also has three but is not printed because the list was cut at three. Betweenness tells a different story from degree: CDKN1A (0.58) ranks second because every route from the DNA-damage side to the cell-cycle side runs through it, even though it has only three links. A node can matter for its position, not just its number of partners.

Worked example · is TP53 really a hub?

average degree = 2 × edges ÷ nodes = 2 × 16 ÷ 15 = 2.13
TP53: 6 ÷ 2.13 = 2.8 times the average
density = edges ÷ possible edges = 16 ÷ 105 = 0.15

A hub is judged against the network it sits in, so first work out what an ordinary node looks like.

Step by step. Every edge has two ends, so the 16 edges give 32 ends shared among 15 nodes: 32 ÷ 15 = 2.13 links per protein on average. TP53 has 6, which is 6 ÷ 2.13, about 2.8 times the average. The number of possible edges among 15 nodes is 15 × 14 ÷ 2 = 105, and only 16 are present, so the density is 0.15: most pairs of proteins are not linked.

What the answer means. In this small network TP53 is clearly a hub. That fits what is known: p53 is one of the most connected proteins in human interaction databases. But remember study bias. p53 has been the subject of a vast number of papers, so part of its high degree reflects how hard people have looked. A rarely studied protein with two recorded links may simply be waiting for someone to test it.

Modules, and what happens when a node is lost

Why look for modules? Because a cell's work is organised into units: a complex such as the proteasome, a signalling route, a set of enzymes in one pathway. Finding modules in an interaction network is a way to propose such units from data, including ones nobody has named yet. Asking what happens when a node is removed is the network version of a knockout experiment: if losing one protein cuts the network into pieces, that protein may be essential to the flow of information between them. The code below does both on the network you just built.

Python
from networkx.algorithms.community import greedy_modularity_communities

modules = greedy_modularity_communities(G)
for i, m in enumerate(modules, start=1):
    print(f"Module {i}:", sorted(m))

H = G.copy()
H.remove_node("CDKN1A")
print("Pieces with CDKN1A:   ", nx.number_connected_components(G))
print("Pieces without CDKN1A:", nx.number_connected_components(H))
print("Shortest path ATM to CCNB1:", nx.shortest_path(G, "ATM", "CCNB1"))

What this does

  • greedy_modularity_communities splits the nodes into modules. It joins groups step by step, each time choosing the join that most raises modularity, a score that is high when there are many edges inside groups and few between them.
  • G.copy() makes a second network, H, so that removing CDKN1A from it leaves the original untouched.
  • number_connected_components counts the separate pieces: groups of nodes with no path between them.
  • shortest_path lists the nodes on the shortest route between two proteins.
Module 1: ['EP300', 'MDM2', 'MDM4', 'TP53'] Module 2: ['ATM', 'BARD1', 'BRCA1', 'CHEK2'] Module 3: ['CCNE1', 'CDK2', 'CDKN1A', 'PCNA'] Module 4: ['CCNA2', 'CCNB1', 'CDK1'] Pieces with CDKN1A: 1 Pieces without CDKN1A: 3 Shortest path ATM to CCNB1: ['ATM', 'TP53', 'CDKN1A', 'CDK2', 'CCNA2', 'CDK1', 'CCNB1']

Reading the output

The four modules make biological sense, although the algorithm knew nothing about biology: p53 with its controllers MDM2, MDM4 and EP300; the DNA-damage sensors ATM, CHEK2, BRCA1 and BARD1; p21 with CDK2, cyclin E and PCNA; and CDK1 with cyclins A and B. Removing CDKN1A breaks the single network into three pieces: PCNA is left alone, and the cell-cycle proteins are cut off from the DNA-damage side. The shortest path from ATM to CCNB1 runs through TP53 and CDKN1A, which matches the biology: DNA damage halts the cell cycle through p53 and p21.

Real networks are far larger, with thousands of nodes. The ideas are the same, but you would use them to ask focused questions, such as "which of my 50 hit genes are linked to each other?", rather than to draw everything.

A pitfall with module-finding is to treat the result as the only possible answer. Algorithms such as the one used here are greedy, choosing the best join at each step, and different algorithms, or the same one on a slightly different network, can split the nodes differently. Modules that appear again and again, across methods and score thresholds, deserve more trust than ones that appear once.

Correlation is not interaction

Co-expression networks are built from data you may already have: an expression table like the count table of Module 5. If two genes rise and fall together across samples, they are joined. This is useful for finding groups of genes that behave alike, but an edge means only "these two numbers move together". It does not mean the two proteins touch, or that one controls the other. The commonest reason two genes correlate is that something else drives both. The code below builds exactly that situation.

Python
import numpy as np

rng = np.random.default_rng(7)
growth = rng.normal(0, 1, 50)                    # a hidden driver in 50 samples
gene_a = 2 * growth + rng.normal(0, 0.5, 50)     # both genes follow the driver
gene_b = 3 * growth + rng.normal(0, 0.5, 50)     # but never touch each other
print("Correlation A with B:", round(np.corrcoef(gene_a, gene_b)[0, 1], 2))

# Remove the driver's effect from each gene, then correlate what is left
res_a = gene_a - np.polyval(np.polyfit(growth, gene_a, 1), growth)
res_b = gene_b - np.polyval(np.polyfit(growth, gene_b, 1), growth)
print("After removing the driver:", round(np.corrcoef(res_a, res_b)[0, 1], 2))

What this does

  • default_rng(7) makes a random number generator with a fixed seed, so you get the same numbers every time.
  • growth is a made-up hidden driver measured in 50 samples. Each gene is the driver times a number, plus its own random noise. Neither gene appears in the other's formula.
  • np.corrcoef gives the Pearson correlation, r, from −1 (perfectly opposite) through 0 (no straight-line relation) to 1 (perfectly together).
  • np.polyfit(growth, gene_a, 1) fits a straight line of gene A against the driver; np.polyval gives the line's prediction. Subtracting it leaves the residual, the part of gene A that the driver does not explain. The last line correlates the two residuals, which is called a partial correlation.
Correlation A with B: 0.95 After removing the driver: -0.14

Reading the output

An r of 0.95 would join A and B in any co-expression network, yet by construction they have nothing to do with each other. After removing the driver, r falls to −0.14, which is within what chance gives for 50 samples. In real tissue, the hidden driver is often the mix of cell types: a sample with more immune cells has more of every immune gene, so all immune genes correlate. Partial correlation helps only when you have measured the driver. When you have not, an edge in a co-expression network is a hint to test, not a finding.

Building a co-expression network also needs a cut-off: how high must r be before two genes are joined? With 20,000 genes there are about 200 million pairs, so even a strict cut-off lets in many pairs that correlate by chance, and a loose one joins almost everything. Widely used methods, such as WGCNA, avoid a single hard cut-off by weighting edges by the strength of correlation and then looking for modules of genes that move together. Whatever the method, the result still describes correlation, and the cautions above still apply.

Key point

Always ask what an edge means before you read a network. A physical interaction, a functional association and a correlation are three different claims, and hubs partly reflect how much a protein has been studied.

A second example: a co-expression network from 200 tumours links an immune gene to hundreds of other genes, so it looks like a master regulator. Before believing it, check whether those genes are simply all made by immune cells. If the tumours differ mainly in how many immune cells they contain, every immune-cell gene will correlate with every other one, and the "hub" is a measure of immune infiltration rather than a regulator.

Further reading · Module 7STRING: search a protein and explore its evidence channels and scores. · NetworkX documentation: the tutorial and the list of network measures. · All reading for this course

Check your understanding

1. In a protein network, removing one node with only three links splits it into three pieces. What does that node have a lot of?

2. Two genes correlate at r = 0.9 across 200 tumours. What can you safely conclude?

3. A famous cancer protein has hundreds of recorded partners, a rarely studied one has two. Why be careful calling the first a hub?

Up next

Lesson 6

Why multi-omics, and how layers are integrated

Ask BioTutor

Create a free website with Framer, the website builder loved by startups, designers and agencies.