13 Robustness and evolvability of biological systems
Living systems keep working in the face of constant change: concentrations of their proteins vary from cell to cell, temperatures and nutrients fluctuate, and mutations alter their genes. This ability to keep a function despite perturbations is robustness. Yet living systems also change, and acquire new functions over evolutionary time; this ability is evolvability. This chapter looks at how robustness to mutations and evolvability, which seem to pull in opposite directions, can coexist; one mechanism that makes a function robust to changes in parameters, integral feedback, is simulated in Chapter 12.
13.1 Robustness in biological systems
13.1.1 Key mechanisms
Of the mechanisms discussed in the book, two can be seen directly in the examples of this companion. Integral feedback, one mechanism of robust adaptation, is simulated in §12.3.1, and modularity, in the sense of densely connected communities in a network, is the subject of §3.3.1. Redundancy can also be read off the genome-scale gene deletions of §10.1. Of the 1516 genes in iML1515, deleting any one of 1272 leaves growth on glucose practically unchanged (at least 99% of the wild type). Why are these deletions harmless? For 451 of these genes, an isozyme or another gene in the GPR rule takes over, and no reaction is lost at all: this is redundancy, in the strict sense of the word. For the other 821, one or more reactions are lost, but the rest of the network finds another way to make biomass, or did not need those reactions on glucose in the first place. This is what Wagner calls distributed robustness (Wagner 2005), and in this model, at least, it is almost twice as common as simple redundancy.
13.1.2 Hierarchies and protocols
There is no code for this section; see the book.
13.1.3 Organising principles
The bow-tie structure of metabolism
Is the bow-tie of Figure 13.1 visible in a real metabolic network? Following Ma and Zeng (Ma and Zeng 2003), we build a directed graph of iML1515, with an edge from every substrate of a reaction to every product (and back again, for reversible reactions), and leave out the currency metabolites, as in §2.5.5. The largest strongly connected component of this graph, in which every metabolite can be converted into every other, is the knot of the bow-tie. The IN set holds the metabolites from which the knot can be reached, and the OUT set, those that can be reached from it.
Core MATLAB only; reads iML1515 from data/iML1515.mat.
%% The bow-tie structure of a genome-scale metabolic network
% Following Ma and Zeng (2003), we build a directed substrate graph from
% the E. coli model iML1515: an edge from every substrate of a reaction to
% every product, and back again if the reaction is reversible. Exchange
% and other one-metabolite reactions, the biomass reactions and ATP
% maintenance are left out, as are currency metabolites (in every
% compartment), which would otherwise connect almost everything.
% The bow-tie (book §13.1.3.1) then has four parts:
% * the core, or "knot": the largest strongly connected component, in
% which every metabolite can be converted into every other one;
% * IN: metabolites from which the core can be reached, but not back;
% * OUT: metabolites that can be reached from the core, but not back;
% * the rest, which neither reach the core nor are reached from it.
s = load(fullfile(sbp.data_dir(), 'iML1515.mat'));
model = s.iML1515;
S = model.S; mets = model.mets; rxns = model.rxns;
currency = {'h', 'h2o', 'atp', 'adp', 'amp', 'pi', 'ppi', 'nad', ...
'nadh', 'nadp', 'nadph', 'co2', 'coa', 'nh4', 'o2', 'q8', 'q8h2', ...
'mql8', 'mqn8', '2dmmq8', '2dmmql8', 'fad', 'fadh2', 'gtp', 'gdp', ...
'ctp', 'cdp', 'utp', 'udp', 'h2o2', 'na1', 'k', 'fe2', 'fe3', ...
'glu__L', 'akg', 'accoa', 'so4', 'gln__L'};
base = regexprep(mets, '_[^_]+$', ''); % drop the compartment
keep = ~ismember(base, currency);
src = {}; dst = {};
for j = 1:numel(rxns)
column = S(:, j);
if nnz(column) < 2 || startsWith(rxns{j}, 'BIOMASS') ...
|| strcmp(rxns{j}, 'ATPM')
continue
end
substrates = mets(column < 0 & keep);
products = mets(column > 0 & keep);
[a, b] = ndgrid(1:numel(substrates), 1:numel(products));
src = [src; substrates(a(:))]; %#ok<AGROW>
dst = [dst; products(b(:))]; %#ok<AGROW>
if model.lb(j) < 0
src = [src; products(b(:))]; %#ok<AGROW>
dst = [dst; substrates(a(:))]; %#ok<AGROW>
end
end
pairs = unique([string(src), string(dst)], 'rows');
G = digraph(pairs(:, 1), pairs(:, 2));
names = string(G.Nodes.Name);
bins = conncomp(G, 'Type', 'strong');
[~, largest] = max(accumarray(bins', 1));
core = find(bins == largest)';
seed = core(1);
out = setdiff(nearest(G, seed, Inf), core);
inn = setdiff(nearest(G, seed, Inf, 'Direction', 'incoming'), core);
rest = setdiff((1:numnodes(G))', [core; out; inn]);
parts = struct('in', inn, 'core', core, 'out', out, 'rest', rest);
keys = fieldnames(parts)';
results.metabolites = numnodes(G);
results.edges = numedges(G);
fprintf('%d metabolites, %d edges\n', numnodes(G), numedges(G));
for k = keys
nodes = names(parts.(k{1}));
tags = extractAfter(nodes, regexpPattern('.*_'));
counts = [sum(tags == "c"), sum(tags == "p"), sum(tags == "e")];
results.(k{1}) = struct('size', numel(nodes), 'by_compartment', counts);
fprintf([' %-5s %5d metabolites (%.0f%%): %d cytosolic, ' ...
'%d periplasmic, %d extracellular\n'], ...
k{1}, numel(nodes), 100 * numel(nodes) / numnodes(G), counts);
end
for m = ["glc__D_e", "pyr_c", "succ_c", "ala__L_c", "cbl1_e", "btn_c"]
where = "absent";
for k = keys
if any(names(parts.(k{1})) == m), where = k{1}; end
end
results.landmarks.(m) = where;
fprintf(' %-10s is in %s\n', m, where);
end
%% Plot
fig = figure('Position', [100 100 650 400]);
heights = zeros(4, 3);
for k = 1:4
heights(k, :) = results.(keys{k}).by_compartment;
end
parts_order = {'IN', 'core', 'OUT', 'rest'};
b = bar(categorical(parts_order, parts_order), heights, 'stacked', ...
'EdgeColor', 'none');
colours = [0.000 0.447 0.698; 0.902 0.624 0.000; 0.000 0.620 0.451];
for c = 1:3, b(c).FaceColor = colours(c, :); end
ylabel('Metabolites'); title('The bow-tie of iML1515');
% (MATLAB lists stacked bars in the order of the stack, top first)
legend({'cytosol', 'periplasm', 'extracellular'}, 'Box', 'off'); box off
sbp.save_figure(fig, mfilename('fullpath'), 'fig-bow-tie');
sbp.save_results(mfilename('fullpath'), results);
Needs COBRApy (to read the model) and NetworkX.
"""The bow-tie structure of a genome-scale metabolic network.
Following Ma and Zeng (2003), we build a directed substrate graph from
the E. coli model iML1515: an edge from every substrate of a reaction to
every product, and back again if the reaction is reversible. Exchange
and other one-metabolite reactions, the biomass reactions and ATP
maintenance are left out, as are currency metabolites (in every
compartment), which would otherwise connect almost everything.
The bow-tie (book §13.1.3.1) then has four parts:
* the core, or "knot": the largest strongly connected component, in
which every metabolite can be converted into every other one;
* IN: metabolites from which the core can be reached, but not back;
* OUT: metabolites that can be reached from the core, but not back;
* the rest, which neither reach the core nor are reached from it.
"""
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
import cobra
from cobra.util import create_stoichiometric_matrix
import sbp
model = cobra.io.read_sbml_model(str(sbp.DATA / "iML1515.xml.gz"))
S = create_stoichiometric_matrix(model)
mets = [m.id for m in model.metabolites]
rxns = [r.id for r in model.reactions]
lb = np.array([r.lower_bound for r in model.reactions])
currency = {"h", "h2o", "atp", "adp", "amp", "pi", "ppi", "nad", "nadh",
"nadp", "nadph", "co2", "coa", "nh4", "o2", "q8", "q8h2",
"mql8", "mqn8", "2dmmq8", "2dmmql8", "fad", "fadh2", "gtp",
"gdp", "ctp", "cdp", "utp", "udp", "h2o2", "na1", "k", "fe2",
"fe3", "glu__L", "akg", "accoa", "so4", "gln__L"}
keep = np.array([m.rsplit("_", 1)[0] not in currency for m in mets])
G = nx.DiGraph()
for j, r in enumerate(rxns):
column = S[:, j]
if (np.count_nonzero(column) < 2 or r.startswith("BIOMASS")
or r == "ATPM"):
continue
substrates = [mets[i] for i in np.flatnonzero((column < 0) & keep)]
products = [mets[i] for i in np.flatnonzero((column > 0) & keep)]
for a in substrates:
for b in products:
G.add_edge(a, b)
if lb[j] < 0:
G.add_edge(b, a)
core = max(nx.strongly_connected_components(G), key=len)
seed = min(core)
out = nx.descendants(G, seed) - core
inn = nx.ancestors(G, seed) - core
rest = set(G) - core - out - inn
parts = {"in": inn, "core": core, "out": out, "rest": rest}
def compartments(nodes):
"""How many metabolites of a part are cytosolic, periplasmic or
extracellular (the last letter of the identifier)."""
tags = [n.rsplit("_", 1)[1] for n in nodes]
return [tags.count(c) for c in ("c", "p", "e")]
results = {"metabolites": G.number_of_nodes(),
"edges": G.number_of_edges()}
print(f"{G.number_of_nodes()} metabolites, {G.number_of_edges()} edges")
for name, nodes in parts.items():
results[name] = {"size": len(nodes),
"by_compartment": compartments(nodes)}
c, p, e = compartments(nodes)
print(f" {name:5s} {len(nodes):5d} metabolites "
f"({100 * len(nodes) / len(G):.0f}%): "
f"{c} cytosolic, {p} periplasmic, {e} extracellular")
results["landmarks"] = {}
for m in ("glc__D_e", "pyr_c", "succ_c", "ala__L_c", "cbl1_e", "btn_c"):
where = next((k for k, v in parts.items() if m in v), "absent")
results["landmarks"][m] = where
print(f" {m:10s} is in {where}")
# --- Plot
sbp.style()
fig, ax = plt.subplots(figsize=(6.5, 4))
names = ["IN", "core", "OUT", "rest"]
bottom = np.zeros(4)
for k, (label, colour) in enumerate((("cytosol", "#0072B2"),
("periplasm", "#E69F00"),
("extracellular", "#009E73"))):
heights = [results[p]["by_compartment"][k] for p in parts]
ax.bar(names, heights, bottom=bottom, color=colour, label=label)
bottom += heights
ax.set_ylabel("Metabolites")
ax.set_title("The bow-tie of iML1515")
ax.legend(frameon=False, reverse=True) # in the order of the stack
sbp.save_figure(fig, __file__, "fig-bow-tie")
sbp.save_results(__file__, results)
sbp.show()
More than half of the metabolites (989 of 1793) lie in the knot, and these are mostly cytosolic: central metabolites such as pyruvate and succinate, and most of the amino acids, which can all be interconverted. A few amino acids, such as histidine, leucine and phenylalanine, are end products, in the OUT set. The IN set (446) consists largely of nutrients, in the medium and the periplasm, such as glucose and cobalamin, which the cell can take up and break down but not make. The OUT set (171) holds end products, such as biotin, which the cell makes from the core but cannot convert back. The remaining 187 metabolites (“rest” in the figure) neither reach the knot nor can be reached from it, for instance those that connect only to the IN or OUT sets, or only to one another. This is the bow-tie of the book in miniature: many inputs, funnelled into a densely connected core of common currencies, and fanned out again to many outputs. Note that the exact numbers depend on the currency metabolites we remove; with none removed, the knot swells to three-quarters of all metabolites (1409 of 1877).
13.2 Genotype spaces and genotype networks
Robustness to mutations seems to work against evolvability. If most mutations leave a function unchanged, how can new functions arise? Andreas Wagner resolved this paradox by distinguishing the robustness of a genotype from that of a phenotype (Wagner 2008). Many genotypes usually share a phenotype, and they are often connected by single mutations into a genotype network that extends far through the space of all genotypes. A robust phenotype has a large genotype network, and a population can drift along it without losing the phenotype, encountering, in different parts of the network, many different new phenotypes.
13.2.1 Genotype spaces
The space of logic circuits of §13.3 is a genotype space small enough to enumerate in full: 14,400 circuits of four NAND gates, each connected to the 20 circuits that differ from it by the rewiring of a single gate input. As for RNA sequences, every genotype has the same number of neighbours, and the space is connected: any circuit can be turned into any other by a series of single rewirings.
13.2.2 Genotype–phenotype mapping
In the circuit space of §13.3, the genotype–phenotype map is computed exactly: each wiring is evaluated, and its phenotype is the logic function it computes. The 14,400 circuits map onto only 15 phenotypes, very unequally: 2458 circuits compute NAND, but only 12 compute NOR. Most of these phenotypes form a single, connected genotype network (as in Figure 13.2c), whereas the 32 circuits that compute XOR are all isolated from one another (as in Figure 13.2f). The consequences for robustness and evolvability are worked out in §13.3.
13.3 Quantifying robustness and evolvability
Testing these ideas needs a system small enough that every genotype can be examined. Digital logic circuits are such a system (Raman and Wagner 2011). Our circuits are chains of four NAND gates. Each input of each gate is wired to one of the two circuit inputs, A and B, or to the output of an earlier gate, and the last gate gives the output. The wiring is the genotype, and the logic function the circuit computes, one of the 16 possible functions of two inputs, is its phenotype. A mutation rewires one input of one gate, and each circuit has 20 such neighbours. We enumerate all 14,400 circuits, and measure:
- the robustness of a circuit, the fraction of its 20 neighbours that compute the same function, and of a function, the average over all circuits that compute it (book §13.3 counts neighbours rather than taking the fraction; with 20 neighbours for every circuit, the two differ only by that factor);
- the evolvability of a circuit, the number of other functions among its neighbours, and of a function, the number of other functions found among the neighbours of all its circuits.
Treating truth tables as 4-bit numbers lets both languages evaluate all the circuits at once with bitwise operations.
Core MATLAB only.
%% Robustness and evolvability in a space of logic circuits
% A circuit is a chain of four NAND gates. Each input of gate g (g = 1..4)
% is wired to one of the two circuit inputs, A and B, or to the output of
% an earlier gate; the output of gate 4 is the output of the circuit. The
% wiring is the genotype, and the logic function the circuit computes, one
% of 16 possible truth tables, is its phenotype. A mutation rewires one
% input of one gate. We enumerate all 14,400 circuits, and ask how robust
% each phenotype is to mutations, and how many new phenotypes lie one
% mutation away (its evolvability).
% Requires: core MATLAB only.
% Truth tables as 4-bit numbers, outputs for (A, B) = 00, 01, 10, 11
A = 3; B = 5; % 0011 and 0101
NAMES = {'FALSE', 'A AND B', 'A AND NOT B', 'A', 'NOT A AND B', 'B', ...
'A XOR B', 'A OR B', 'A NOR B', 'A XNOR B', 'NOT B', 'A OR NOT B', ...
'NOT A', 'NOT A OR B', 'A NAND B', 'TRUE'};
% A genotype is 8 digits, the sources of the two inputs of each gate
% (numbered from 0); gate g can choose among 2 + (g - 1) sources
radix = [2 2 3 3 4 4 5 5];
weight = [fliplr(cumprod(fliplr(radix(2:end)))) 1]; % first digit slowest
n = prod(radix);
index = (0:n - 1)';
digits = mod(floor(index ./ weight), radix); % n x 8
% Phenotypes: evaluate all circuits at once, with bitwise NAND
signals = [A * ones(n, 1), B * ones(n, 1)];
for g = 1:4
x = signals(sub2ind(size(signals), index + 1, digits(:, 2 * g - 1) + 1));
y = signals(sub2ind(size(signals), index + 1, digits(:, 2 * g) + 1));
signals(:, end + 1) = 15 - bitand(x, y); %#ok<AGROW>
end
phenotype = signals(:, end);
% One-mutation neighbours: change one digit to each of its other values
same = zeros(n, 1); % neighbours with the same phenotype
seen = zeros(n, 1); % phenotypes of neighbours, as bits
edges = zeros(0, 2);
for d = 1:8
for v = 0:radix(d) - 1
mutant = digits(:, d) ~= v;
nb = index(mutant) + (v - digits(mutant, d)) * weight(d);
same_ph = phenotype(nb + 1) == phenotype(mutant);
same(mutant) = same(mutant) + same_ph;
seen(mutant) = bitor(seen(mutant), bitshift(1, phenotype(nb + 1)));
from = index(mutant);
edges = [edges; from(same_ph) + 1, nb(same_ph) + 1]; %#ok<AGROW>
end
end
n_neighbours = sum(radix - 1); % 20
robustness = same / n_neighbours;
popcount = @(b) sum(dec2bin(b, 16) == '1', 2);
not_own = 65535 - bitshift(1, phenotype); % all bits but the phenotype's
evolvability = popcount(bitand(seen, not_own));
component = conncomp(graph(edges(:, 1), edges(:, 2), [], n))';
% Summarise for each phenotype that occurs
found = unique(phenotype)';
summary = struct('phenotype', found, 'name', {NAMES(found + 1)}, ...
'n_genotypes', [], 'robustness', [], 'evolvability', [], ...
'n_components', []);
for f = found
g = phenotype == f;
reach = 0;
for b = seen(g)'
reach = bitor(reach, b);
end
reach = bitand(reach, 65535 - bitshift(1, f));
summary.n_genotypes(end + 1) = nnz(g);
summary.robustness(end + 1) = mean(robustness(g));
summary.evolvability(end + 1) = popcount(reach);
summary.n_components(end + 1) = numel(unique(component(g)));
fprintf(['%-12s %5d circuits, robustness %.3f, %2d new phenotypes ' ...
'nearby, %d genotype network(s)\n'], NAMES{f + 1}, nnz(g), ...
mean(robustness(g)), summary.evolvability(end), ...
summary.n_components(end));
end
fprintf('%d circuits compute %d of the 16 functions\n', n, numel(found));
c = corrcoef(robustness, evolvability);
r_genotype = c(1, 2);
c = corrcoef(summary.robustness, summary.evolvability);
r_phenotype = c(1, 2);
fprintf(['Correlation of robustness and evolvability: %.3f for ' ...
'genotypes, %.3f for phenotypes\n'], r_genotype, r_phenotype);
%% Plot
blue = [0.000 0.447 0.698]; orange = [0.902 0.624 0.000];
fig = figure('Position', [100 100 1000 420]);
subplot(1, 2, 1)
semilogx(summary.n_genotypes, summary.robustness, 'o', 'Color', blue, ...
'MarkerFaceColor', blue);
labelled = ismember(summary.name, ...
{'A XOR B', 'A NOR B', 'FALSE', 'A OR B', 'A NAND B'});
text(summary.n_genotypes(labelled) * 1.15, ...
summary.robustness(labelled), summary.name(labelled), 'FontSize', 8);
xlim([8 8000]); ylim([-0.03 0.6]);
xlabel('Number of circuits with this function');
ylabel('Robustness of the function');
title('Common functions are robust');
box off
subplot(1, 2, 2)
levels = unique(robustness);
mean_ev = arrayfun(@(r) mean(evolvability(robustness == r)), levels);
plot(levels, mean_ev, 'o-', 'Color', orange, 'MarkerFaceColor', orange);
hold on
plot(summary.robustness, summary.evolvability, 's', 'Color', blue, ...
'MarkerFaceColor', blue);
xlim([-0.03 0.83]); ylim([1.5 14.5]);
xlabel('Robustness'); ylabel('New functions one mutation away');
title('Robustness and evolvability');
legend({'single circuits', 'functions (all their circuits)'}, ...
'Location', 'southwest', 'Box', 'off');
box off
sbp.save_figure(fig, mfilename('fullpath'), 'fig-logic-circuits');
results.n_circuits = n;
results.summary = summary;
results.correlation_genotype = r_genotype;
results.correlation_phenotype = r_phenotype;
sbp.save_results(mfilename('fullpath'), results);
Needs SciPy.
"""Robustness and evolvability in a space of logic circuits.
A circuit is a chain of four NAND gates. Each input of gate g (g = 1..4)
is wired to one of the two circuit inputs, A and B, or to the output of
an earlier gate; the output of gate 4 is the output of the circuit. The
wiring is the genotype, and the logic function the circuit computes, one
of 16 possible truth tables, is its phenotype. A mutation rewires one
input of one gate. We enumerate all 14,400 circuits, and ask how robust
each phenotype is to mutations, and how many new phenotypes lie one
mutation away (its evolvability).
"""
import numpy as np
from scipy.sparse import coo_matrix
from scipy.sparse.csgraph import connected_components
import matplotlib.pyplot as plt
import sbp
# Truth tables as 4-bit numbers, outputs for (A, B) = 00, 01, 10, 11
A, B = 0b0011, 0b0101
NAMES = ["FALSE", "A AND B", "A AND NOT B", "A", "NOT A AND B", "B",
"A XOR B", "A OR B", "A NOR B", "A XNOR B", "NOT B", "A OR NOT B",
"NOT A", "NOT A OR B", "A NAND B", "TRUE"]
# A genotype is 8 digits, the sources of the two inputs of each gate;
# gate g can choose among 2 + (g - 1) sources
radix = np.array([2, 2, 3, 3, 4, 4, 5, 5])
weight = np.r_[np.cumprod(radix[::-1])[::-1][1:], 1] # first digit slowest
n = int(np.prod(radix))
index = np.arange(n)
digits = (index[:, None] // weight) % radix # n x 8
# Phenotypes: evaluate all circuits at once, with bitwise NAND
signals = [np.full(n, A), np.full(n, B)]
for g in range(4):
stacked = np.array(signals) # sources so far
x = stacked[digits[:, 2 * g], index]
y = stacked[digits[:, 2 * g + 1], index]
signals.append(15 - (x & y))
phenotype = signals[-1]
# One-mutation neighbours: change one digit to each of its other values
same = np.zeros(n) # neighbours with the same phenotype
seen = np.zeros(n, dtype=int) # phenotypes of neighbours, as bits
edges = []
for d in range(8):
for v in range(radix[d]):
mutant = digits[:, d] != v
nb = index[mutant] + (v - digits[mutant, d]) * weight[d]
same_ph = phenotype[nb] == phenotype[mutant]
same[mutant] += same_ph
seen[mutant] |= 1 << phenotype[nb]
edges.append(np.c_[index[mutant][same_ph], nb[same_ph]])
n_neighbours = int(np.sum(radix - 1)) # 20
robustness = same / n_neighbours
own = 1 << phenotype
popcount = np.vectorize(lambda b: bin(b).count("1"))
evolvability = popcount(seen & ~own)
edges = np.vstack(edges)
graph = coo_matrix((np.ones(len(edges)), (edges[:, 0], edges[:, 1])),
shape=(n, n))
_, component = connected_components(graph, directed=False)
# Summarise for each phenotype that occurs
found = np.unique(phenotype)
summary = {"phenotype": found.tolist(), "name": [NAMES[f] for f in found],
"n_genotypes": [], "robustness": [], "evolvability": [],
"n_components": []}
for f in found:
g = phenotype == f
summary["n_genotypes"].append(int(g.sum()))
summary["robustness"].append(robustness[g].mean())
reach = np.bitwise_or.reduce(seen[g]) & ~(1 << f)
summary["evolvability"].append(int(popcount(reach)))
summary["n_components"].append(len(np.unique(component[g])))
print(f"{NAMES[f]:12s} {g.sum():5d} circuits, robustness "
f"{robustness[g].mean():.3f}, {summary['evolvability'][-1]:2d} "
f"new phenotypes nearby, {summary['n_components'][-1]} "
f"genotype network(s)")
print(f"{n} circuits compute {len(found)} of the 16 functions")
r_genotype = np.corrcoef(robustness, evolvability)[0, 1]
r_phenotype = np.corrcoef(summary["robustness"],
summary["evolvability"])[0, 1]
print(f"Correlation of robustness and evolvability: {r_genotype:.3f} for "
f"genotypes, {r_phenotype:.3f} for phenotypes")
# --- Plot
sbp.style()
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 4.2))
ax1.semilogx(summary["n_genotypes"], summary["robustness"], "o",
color="#0072B2")
for name, x, y in zip(summary["name"], summary["n_genotypes"],
summary["robustness"]):
if name in ["A XOR B", "A NOR B", "FALSE", "A OR B", "A NAND B"]:
ax1.annotate(name, (x, y), textcoords="offset points",
xytext=(5, -3), fontsize=8)
ax1.set_xlim(8, 8000)
ax1.set_ylim(-0.03, 0.6)
ax1.set_xlabel("Number of circuits with this function")
ax1.set_ylabel("Robustness of the function")
ax1.set_title("Common functions are robust")
levels = np.unique(robustness)
ax2.plot(levels, [evolvability[robustness == r].mean() for r in levels],
"o-", color="#E69F00", label="single circuits")
ax2.plot(summary["robustness"], summary["evolvability"], "s",
color="#0072B2", label="functions (all their circuits)")
ax2.set_xlim(-0.03, 0.83)
ax2.set_ylim(1.5, 14.5)
ax2.set_xlabel("Robustness")
ax2.set_ylabel("New functions one mutation away")
ax2.set_title("Robustness and evolvability")
ax2.legend(frameon=False, loc="lower left")
sbp.save_figure(fig, __file__, "fig-logic-circuits")
sbp.save_results(__file__, {
"n_circuits": n, "summary": summary,
"correlation_genotype": r_genotype,
"correlation_phenotype": r_phenotype,
})
sbp.show()
The 14,400 circuits compute 15 of the 16 functions; XNOR needs at least five NAND gates. The functions are very unequally represented: 2458 circuits compute NAND, but only 32 compute XOR and 12 compute NOR. Common functions are robust (left): about 56% of mutations to a NAND circuit preserve its function, whereas every mutation to an XOR circuit destroys it, so that each of the 32 XOR circuits is isolated. Most functions have a single, connected genotype network, which can be traversed one mutation at a time.
The right panel resolves the paradox. For single circuits, robustness and evolvability are opposed (correlation −0.60): the more neighbours share a circuit’s function, the fewer are left for new functions. For functions, they go together (correlation +0.68): a robust function has a large genotype network, whose many circuits together lie next to almost every other function. Raman and Wagner found the same in much larger circuits, with 16 gates of five types and four inputs and outputs, too many to enumerate, by sampling with random walks (Raman and Wagner 2011); similar results hold for RNA secondary structures, proteins, regulatory circuits and metabolic networks.
13.4 Software tools
There is no code for this section; see the book.
Exercises
- Allow each gate in the logic circuits to be either NAND or NOR, so that a mutation can also change the type of a gate. How does this change the number of circuits for each function, their robustness, and the connectivity of their genotype networks? Can XOR circuits now reach one another?
- Starting from a random NAND circuit, perform random walks of 100 mutations that never change the function. How many different functions are found among the neighbours visited, and how does this grow with the length of the walk?
- Book Exercises 13.3 and 13.4: write code that builds the ODEs of the Goodwin oscillator for any of the \(3^6 = 729\) two-gene topologies studied by Wagner, and measure the genotype robustness of one topology that oscillates. Why does every topology have 12 neighbours?
Going further
Robustness has many sources besides feedback: redundant genes and pathways (Chapter 10), modularity and decoupling, and organising principles such as bow-tie structures (book, §13.1). The genotype-network view of evolution is developed by Wagner (2008) and in book §13.2–13.3, which also describes how these relationships hold for gene regulatory, metabolic and signalling networks, and when mutations are not all equally likely.