Algorithmadvanced
ARACNE
Also called algorithm for the reconstruction of accurate cellular networks.
Keep gene pairs with high mutual information, then delete the weakest edge of each triangle by the data processing inequality.
- Time
- O(m n log n + m^2 (n + b^2) + m^3) worst
- Space
- Θ(m^2 + m n) extra
- Where
- b = the number of bins per gene; m = the number of genes; n = the number of samples
- Model
- Real RAM
- Properties
- deterministicnot exactofflineiterative
- Evidence
- Proof sketchCode in 1 languages
- Origin
- Adam A. Margolin, Ilya Nemenman, Katia Basso, Chris Wiggins, Gustavo Stolovitzky, Riccardo Dalla Favera, Andrea Califano, 2006
ARACNE builds an undirected network of genes from expression data in two steps. First it estimates the mutual information of every pair of genes and keeps the pairs above a threshold . Then it looks at every triangle of kept pairs and deletes the edge with the smallest mutual information, because the data processing inequality says that an indirect link through a third gene can never carry more information than the two direct links it passes through. The method is one heuristic answer to gene regulatory network inference. With exact mutual information values and a true network that is a tree, it returns that tree exactly; with estimated values it has no such guarantee. For genes and samples it runs in time with a binned estimator on bins.
In plain words
Two genes whose levels rise and fall together across many samples share information: knowing one tells you something about the other. A first guess at the network joins every pair that shares a lot of information. That guess has too many links. If gene A controls B and B controls C, then A and C also move together, only because B sits between them.
ARACNE removes those extra links with one rule. Look at any three genes that are all joined. The weakest of the three links is the most likely to be the indirect one, so cut it. Do this for every such group of three, decide all the cuts first, and then remove them together. What is left is a sparse network that keeps the strongest direct links.
The problem
Input. An expression matrix with genes and samples, for gene and sample ; a threshold ; and a tolerance . Genes are numbered 1 to on this page and 0 to in the code.
Output. A set of undirected edges , read as "genes and interact, directly". ARACNE gives no direction and no sign.
The mutual information of two random variables is the Kullback-Leibler divergence of their joint law from the product of the marginals,
with the Shannon entropy in nats. It is zero exactly when and are independent, and for jointly normal variables with correlation it is . This site has no separate page on mutual information.
The algorithm
Write for the estimate of .
ARACNE(X, I0, τ)- 1
for each pair of genes i < j do - 2
I[i, j] ← estimated mutual information of rows i and j of X - 3
E ← { {i, j} : I[i, j] > I0 } - 4
D ← ∅ ▷ edges to delete - 5
for each triangle {i, j, k} whose three edges are all in E do - 6
for each edge e of the triangle do - 7
if I(e) < (1 - τ) · I(f) for both other edges f of the triangle then D ← D ∪ {e} - 8
return E \ D
Lines L1 and L2 fill the matrix of pairwise estimates. Line L3 is the relevance network: all pairs above the threshold. Lines L5 to L7 apply the data processing inequality to every triangle of the relevance network, and line L8 removes all marked edges at the end. Because the marks are made on the fixed set , the result does not depend on the order in which the triangles are visited. With , line L7 marks the strict minimum of each triangle, and it marks nothing when the two smallest values are equal. A tolerance marks an edge only when it is clearly the weakest, so it keeps more edges and some small loops. Margolin et al. write the condition as and report that values of below 0.15 gave a reasonable trade-off on their test networks.
Estimating . The paper applies a rank (copula) transform to each gene, so that each marginal is uniform on , and then uses a Gaussian kernel density estimator with one fixed kernel width. The threshold comes from a null: shuffle the samples of each gene to break all dependence, estimate the mutual information of the shuffled pairs, and pick at a chosen p-value, with an exponential fit to the tail for small p-values. The implementation on this site uses a simpler estimator: it puts the ranks of each gene into bins of equal size and computes the plug-in value . It takes as a parameter, and it leaves out the kernel estimator, the permutation null and the bootstrap of later versions. The pruning step, lines L3 to L8, is the same as in the paper.
Example
Take four genes A, B, C and D in a tree with B at the center: A, C and D each connect to B only. Let the expression be jointly normal with correlations 0.9 for A and B, 0.8 for B and C and 0.7 for B and D. In such a tree, the correlation of two genes is the product of the correlations along the path between them, so A and C have 0.72, A and D have 0.63, and C and D have 0.56. The exact mutual information values are:
| pair | AB | BC | AC | BD | AD | CD |
|---|---|---|---|---|---|---|
| 0.9 | 0.8 | 0.72 | 0.7 | 0.63 | 0.56 | |
| (nats) | 0.830366 | 0.510826 | 0.365321 | 0.336672 | 0.252836 | 0.188147 |
With , line L3 keeps all six pairs, so all four triangles are present. With , line L7 marks AC in triangle ABC, AD in ABD, CD in ACD and CD again in BCD. Line L8 returns AB, BC and BD, the true tree. With the result is the same, because in every triangle the weakest edge is below times the other two (the largest ratio is , in ABD). With the factor is 0.7. Then AC survives, since , and so does AD, since ; CD is still marked in BCD, where its ratio to BD is . So the result has five edges: the tree and the two indirect edges AC and AD.
On sampled data. The test of the implementation simulates a normal tree model with 8 genes, 7 edges with correlations from 0.7 to 0.85, and 250 samples (seed 7), and uses 4 bins and . All 28 pairs pass the threshold, so the relevance network is the complete graph. After the DPI step, the result is exactly the 7 true edges. This is one measurement on easy data, not a guarantee: with fewer samples, weaker links or a network with many short loops, ARACNE deletes true edges and keeps false ones.
Correctness
ARACNE is a heuristic, so its correctness has two parts. The first part is that the code computes what lines L3 to L8 define: the set of edges of the relevance network that are not the -weakest edge of any of its triangles. The loop visits each triangle once and the marks do not change , so this holds by inspection; the test compares it with a direct check of the definition over all triples.
The second part is what the output means. The data processing inequality (Cover and Thomas, Theorem 2.8.1) says that if is a Markov chain, then , and since is also a Markov chain, . Suppose the joint law of the genes is Markov with respect to a tree , so that and are independent given whenever lies on the path from to in .
Theorem. Assume the values are exact, for every edge of , and for any three distinct genes with on the path from to in , . Then ARACNE returns exactly the edges of .
The proof has two steps. No edge of is marked: for an edge and a third gene on the side of , gene is on the path from to , so , and line L7 cannot mark against . Every other edge that passes the threshold is marked: for a pair at distance at least 2 in , let be the neighbor of on the path; then passes the threshold by assumption, passes it because , and line L7 marks in the triangle . This is Theorem 1 of Margolin et al. The DPI gives the hypothesis with in place of and ; the strict form holds, for example, for a normal tree with all correlations in in absolute value, because . The full proof is below.
The theorem says nothing about networks with loops, such as a feed-forward loop, where the true triangle loses its weakest edge.
Proof: ARACNE computes its pruned network, and recovers a tree from exact valuesfull
Setup. Let be a symmetric matrix of non-negative numbers, and . Let , the set of line L3. A triangle of is a set of three genes whose three pairs are all in . Call an edge of a triangle weak in it when for both other edges of the triangle. Define
Lemma 1. ARACNE returns .
Proof. Line L4 starts with . Lines L5 to L7 visit every triangle of , and line L7 adds to exactly the edges that are weak in the visited triangle. The loop does not change or , so the triangles and the test of line L7 are the same whatever the order of the visits. After the loop, is the set of edges of that are weak in at least one triangle of , and line L8 returns .
Lemma 2 (data processing inequality). If the random variables , and satisfy that and are independent given , then .
Proof. By the chain rule of mutual information, . The term is zero by the conditional independence, and . So . The hypothesis is symmetric in and , so the same argument with and exchanged gives . This is Theorem 2.8.1 of Cover and Thomas.
Now let be a tree on the genes. Say that the law of is Markov on if and are independent given whenever is an inner node of the path from to in . By Lemma 2, exact values then satisfy for each such triple. The theorem needs a strict form with the tolerance.
Theorem. Let be exact, and assume:
- for every edge of ;
- for any three distinct genes , , with an inner node of the path from to in , .
Then ARACNE returns the edge set of .
Proof. By Lemma 1 it is enough to show that is the edge set of .
Step 1: every edge of is in . Let be an edge of . By assumption 1 it is in . Suppose it were weak in a triangle of . Deleting the edge from splits the tree into two parts, one with and one with . By the symmetry of the claim we may assume that is in the part of . Then the path from to in goes through , and is an inner node of it. Assumption 2 for the triple gives . Weakness of needs , which contradicts . So is weak in no triangle, and it is in .
Step 2: no other pair is in . Let be a pair that is not an edge of . If , it is not in . Otherwise, the path from to in has at least two edges. Let be the node after on it, so is an edge of and is an inner node of the path. By assumption 1, . By assumption 2, , so , and . So is a triangle of , and assumption 2 says that and . So is weak in it, and it is not in .
Steps 1 and 2 show that is the edge set of .
The normal case. Let the genes be jointly normal and Markov on , with correlation on each edge of , . Then the correlation of genes and is the product of over the path between them, so when is an inner node of the path. The map is strictly increasing in , so assumption 2 holds with , and assumption 1 holds with . This is the case that the test checks on random trees.
Complexity
The model is the real RAM, with each logarithm and division as one step.
- Estimates, lines L1 and L2. Ranking each gene costs , so for all genes. Each of the pairs then costs to fill a table of counts and to sum it, so in all. The kernel estimator of the paper costs per pair instead, which gives the term of the paper for genes and samples.
- Pruning, lines L3 to L8. Line L3 is . The triangles are found by intersecting the neighbor sets of the two ends of each edge, which is per edge and in all, and each triangle costs . When all pairs pass the threshold there are triangles, so the bound is reached.
- Space. The matrix of estimates takes numbers and the bins take .
In practice the estimation term dominates for many samples. For the full genome ( near 20000) the term is large too. A common remedy is to keep only the pairs that contain a known transcription factor.
Properties
- Deterministic. For fixed estimates, the output does not depend on the gene order, by the two-phase marking.
- Monotone in . A larger tolerance marks a subset of the edges, so the output grows with .
- Undirected and unsigned. Mutual information is symmetric and ignores the sign of the dependence, so ARACNE cannot tell activation from repression or cause from effect.
- Contains the Chow-Liu tree. The Chow-Liu tree is a maximum spanning tree of the complete graph weighted by mutual information. With and , every edge of positive weight of such a tree is in the output (Theorem 2 of the paper states this for exact values). The reason is the cycle property: line L7 marks only the strict minimum of a triangle, and the strict minimum of a cycle is in no maximum spanning tree.
Variants and improvements
- Relevance network. Stop after line L3. This is the older method of Butte and Kohane, which keeps all indirect links.
- Known regulators. Keep only pairs with at least one transcription factor, and apply the DPI only to triangles that contain a transcription factor. This cuts the work and the number of target to target edges.
- ARACNe-AP. Lachmann et al. (2016) estimate the mutual information with adaptive partitioning, which is much faster than the kernel estimator, and run ARACNE on many bootstrap samples, keeping the edges that appear more often than chance.
- Other uses of mutual information. CLR scores each pair against the background distribution of the mutual information of each gene, and MRNET picks edges by a minimum redundancy rule. DREAM5 (Marbach et al. 2012) compared several mutual information methods with regression, correlation and Bayesian network methods, and found that mutual information and correlation methods recovered feed-forward loops better than the regression methods.
- Conditional independence instead of the DPI. A Gaussian graphical model removes an edge when the partial correlation, given all other genes, is zero. It handles loops, but needs more samples than genes or a sparsity penalty.
When to use it
Use ARACNE for many samples of one cell type, under many conditions, when you want a sparse, undirected list of candidate direct partners of each regulator, and you accept that true triangles are broken. The estimates need many samples: with a few dozen, the noise in the mutual information is of the same size as the gaps that line L7 compares. For directed links from regulators to targets, a regression method such as GENIE3 ranks the candidates; for time series, a dynamic Bayesian network can use the time order.
Pitfalls
- Real loops are cut. Every triangle loses one edge with . A feed-forward loop, common in transcription networks, always loses one of its three links.
- Ties. With and the strict test of line L7, a triangle with two equal smallest values loses neither. Binned estimates on small samples give many ties; a small or a finer estimator avoids surprises.
- Estimator bias. The plug-in estimate on bins is biased upward by about nats for independent genes, so the threshold must come from a null on the same and , not from a fixed number.
- Order of removal. Deleting the weakest edge of each triangle at once, in a loop over triangles, gives a result that depends on the order. Mark first, then delete.
- Not causal. An edge means strong dependence that the DPI step did not explain away. A hidden common regulator that is not measured makes two targets look directly linked.
Implementations
Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/aracne/. The authors are listed in prov/VF2D8H.jsonl.
"""ARACNE: mutual information network with data processing inequality pruning.
The expression data is a list of m genes, and each gene is a list of n
samples (floats). Genes are numbered 0 .. m-1 in the code (the page numbers
them from 1). An edge is a pair (i, j) with i < j.
The original method of Margolin et al. (2006) estimates mutual information
with a Gaussian kernel estimator on rank (copula) transformed data, and picks
the threshold I0 from a permutation null. This file uses a plug-in estimate on
equal-frequency bins of the ranks, and takes I0 as a parameter. The pruning
step (lines L4 to L8 of the page) is the same as in the paper.
"""
from __future__ import annotations
import math
from typing import Dict, List, Sequence, Set, Tuple
Edge = Tuple[int, int]
def ranks(xs: Sequence[float]) -> List[int]:
"""Rank of each value, 0 .. n-1. Ties are broken by position (stable)."""
order = sorted(range(len(xs)), key=lambda s: xs[s])
r = [0] * len(xs)
for pos, s in enumerate(order):
r[s] = pos
return r
def equal_frequency_bins(xs: Sequence[float], b: int) -> List[int]:
"""Bin index 0 .. b-1 of each value: rank r goes to bin floor(r b / n)."""
n = len(xs)
return [r * b // n for r in ranks(xs)]
def mutual_information_binned(x: Sequence[float], y: Sequence[float], b: int) -> float:
"""Plug-in mutual information, in nats, of two samples on b x b rank bins."""
if len(x) != len(y) or len(x) == 0:
raise ValueError("x and y must have the same positive length")
return mi_from_bins(equal_frequency_bins(x, b), equal_frequency_bins(y, b), b)
def mi_from_bins(bx: Sequence[int], by: Sequence[int], b: int) -> float:
"""Plug-in mutual information, in nats, of two binned samples; O(n + b^2) time."""
n = len(bx)
joint: Dict[Tuple[int, int], int] = {}
cx = [0] * b
cy = [0] * b
for s in range(n):
joint[(bx[s], by[s])] = joint.get((bx[s], by[s]), 0) + 1
cx[bx[s]] += 1
cy[by[s]] += 1
mi = 0.0
for (u, v), c in joint.items():
mi += c / n * math.log(c * n / (cx[u] * cy[v]))
return mi
def gaussian_mutual_information(rho: float) -> float:
"""Mutual information, in nats, of two jointly normal variables with correlation rho."""
return -0.5 * math.log(1.0 - rho * rho)
def mi_matrix(data: Sequence[Sequence[float]], b: int) -> List[List[float]]:
"""Symmetric m x m matrix of binned mutual information (diagonal 0)."""
m = len(data)
bins = [equal_frequency_bins(gene, b) for gene in data] # one sort per gene
mi = [[0.0] * m for _ in range(m)]
for i in range(m):
for j in range(i + 1, m):
v = mi_from_bins(bins[i], bins[j], b) # @line L2
mi[i][j] = mi[j][i] = v
return mi
def aracne_prune(mi: Sequence[Sequence[float]], threshold: float, tolerance: float = 0.0) -> Set[Edge]:
"""Lines L3 to L8: threshold the matrix, then apply the DPI to every triangle.
An edge e of a triangle whose three edges all pass the threshold is removed
when I(e) < (1 - tolerance) * I(f) for both other edges f of the triangle.
All removals are decided on the thresholded graph and applied at the end,
so the result does not depend on the order of the genes.
"""
m = len(mi)
if not 0.0 <= tolerance < 1.0:
raise ValueError("tolerance must be in [0, 1)")
keep = 1.0 - tolerance
adj: List[Set[int]] = [set() for _ in range(m)]
edges: Set[Edge] = set()
for i in range(m):
for j in range(i + 1, m):
if mi[i][j] > threshold: # @line L3
edges.add((i, j))
adj[i].add(j)
adj[j].add(i)
removed: Set[Edge] = set() # @line L4
for i, j in sorted(edges):
for k in sorted(adj[i] & adj[j]):
if k <= j:
continue # @line L5
# the triangle i < j < k, visited once
tri = ((i, j), (i, k), (j, k)) # @line L6
for e in tri:
others = [f for f in tri if f != e]
ie = mi[e[0]][e[1]]
if all(ie < keep * mi[f[0]][f[1]] for f in others): # @line L7
removed.add(e)
return edges - removed # @line L8
def aracne(data: Sequence[Sequence[float]], threshold: float, tolerance: float = 0.0, b: int = 4) -> Set[Edge]:
"""Lines L1 to L8: estimate all pairwise MI values, then prune."""
for gene in data: # @line L1
if len(gene) != len(data[0]):
raise ValueError("every gene needs the same number of samples")
return aracne_prune(mi_matrix(data, b), threshold, tolerance)
def tree_correlations(m: int, parent: Sequence[int], r: Sequence[float]) -> List[List[float]]:
"""Exact correlations of a Gaussian tree model.
Gene 0 is the root, parent[c] < c is the parent of gene c >= 1, and r[c] is
the correlation of gene c with its parent. The correlation of two genes is
the product of r over the edges of the path between them.
"""
path_to_root = []
for c in range(m):
p = [c]
while p[-1] != 0:
p.append(parent[p[-1]])
path_to_root.append(p)
rho = [[1.0] * m for _ in range(m)]
for a in range(m):
for b2 in range(a + 1, m):
pa, pb = path_to_root[a], set(path_to_root[b2])
lca = next(v for v in pa if v in pb)
prod = 1.0
for v in pa:
if v == lca:
break
prod *= r[v]
for v in path_to_root[b2]:
if v == lca:
break
prod *= r[v]
rho[a][b2] = rho[b2][a] = prod
return rho
def simulate_tree(rng, m: int, parent: Sequence[int], r: Sequence[float], n: int) -> List[List[float]]:
"""n samples of the Gaussian tree model, gene by gene in index order per sample.
Each sample draws gene 0 then genes 1 .. m-1 with rng.gauss(0, 1):
x_c = r[c] x_parent + sqrt(1 - r[c]^2) z.
"""
data = [[0.0] * n for _ in range(m)]
for s in range(n):
data[0][s] = rng.gauss(0.0, 1.0)
for c in range(1, m):
data[c][s] = r[c] * data[parent[c]][s] + math.sqrt(1.0 - r[c] * r[c]) * rng.gauss(0.0, 1.0)
return data
test_aracne.py 186 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/aracne/. The authors are listed in prov/VF2D8H.jsonl.
import math
import random
from aracne import (
aracne,
aracne_prune,
gaussian_mutual_information,
mi_matrix,
mutual_information_binned,
simulate_tree,
tree_correlations,
)
def brute_force_prune(mi, threshold, tolerance):
"""The definition: keep a passing edge unless some passing triangle has it as the weakest edge."""
m = len(mi)
passing = {(i, j) for i in range(m) for j in range(i + 1, m) if mi[i][j] > threshold}
out = set()
for i, j in passing:
dropped = False
for k in range(m):
if k in (i, j):
continue
a, b = tuple(sorted((i, k))), tuple(sorted((j, k)))
if a in passing and b in passing:
if mi[i][j] < (1 - tolerance) * mi[a[0]][a[1]] and mi[i][j] < (1 - tolerance) * mi[b[0]][b[1]]:
dropped = True
if not dropped:
out.add((i, j))
return out
def gaussian_mi_matrix(rho):
m = len(rho)
return [[0.0 if i == j else gaussian_mutual_information(rho[i][j]) for j in range(m)] for i in range(m)]
def random_tree(rng, m):
parent = [0] + [rng.randrange(c) for c in range(1, m)]
r = [1.0] + [rng.choice([-1, 1]) * rng.uniform(0.3, 0.95) for _ in range(1, m)]
return parent, r
def test_binned_mi_identical_variables_is_log_b():
rng = random.Random(1)
x = [rng.random() for _ in range(120)]
for b in (2, 3, 4, 5):
assert abs(mutual_information_binned(x, x, b) - math.log(b)) < 1e-12
y = [-v ** 3 for v in x] # a decreasing map keeps the bins, in reverse
assert abs(mutual_information_binned(x, y, b) - math.log(b)) < 1e-12
def test_binned_mi_balanced_grid_is_zero():
b, c = 4, 5
n = b * b * c
x = list(range(n))
# within each x bin, the y bins are filled in turn, so every cell gets c points
y = [((s % (n // b)) % b) * (n // b) + s // b for s in range(n)]
assert sorted(y) == list(range(n))
assert abs(mutual_information_binned(x, y, b)) < 1e-12
def test_binned_mi_symmetric_and_nonnegative():
rng = random.Random(2)
for _ in range(20):
x = [rng.gauss(0, 1) for _ in range(60)]
y = [v + rng.gauss(0, 1) for v in x]
a = mutual_information_binned(x, y, 3)
assert a >= -1e-12
assert abs(a - mutual_information_binned(y, x, 3)) < 1e-12
def test_worked_example_of_the_page():
# genes A, B, C, D = 0, 1, 2, 3; B is the hub of a tree
parent = [1, 0, 1, 1]
rho = [[1.0] * 4 for _ in range(4)]
edge = {(0, 1): 0.9, (1, 2): 0.8, (1, 3): 0.7}
for (i, j), v in edge.items():
rho[i][j] = rho[j][i] = v
for i, j in ((0, 2), (0, 3), (2, 3)):
rho[i][j] = rho[j][i] = rho[i][1] * rho[1][j]
mi = gaussian_mi_matrix(rho)
assert abs(mi[0][1] - 0.830366) < 1e-6
assert abs(mi[2][3] - 0.188147) < 1e-6
assert aracne_prune(mi, 0.1, 0.0) == {(0, 1), (1, 2), (1, 3)}
assert aracne_prune(mi, 0.1, 0.15) == {(0, 1), (1, 2), (1, 3)}
assert aracne_prune(mi, 0.1, 0.3) == {(0, 1), (1, 2), (1, 3), (0, 2), (0, 3)}
assert aracne_prune(mi, 0.3, 0.0) == {(0, 1), (1, 2), (1, 3)}
assert parent[0] == 1
def test_prune_matches_brute_force():
rng = random.Random(3)
for trial in range(200):
m = rng.randint(3, 8)
mi = [[0.0] * m for _ in range(m)]
for i in range(m):
for j in range(i + 1, m):
mi[i][j] = mi[j][i] = rng.choice([rng.random(), round(rng.random(), 1)])
th = rng.choice([0.0, 0.2, 0.5])
tol = rng.choice([0.0, 0.1, 0.3])
assert aracne_prune(mi, th, tol) == brute_force_prune(mi, th, tol)
def test_result_does_not_depend_on_gene_order():
rng = random.Random(4)
for _ in range(50):
m = 7
mi = [[0.0] * m for _ in range(m)]
for i in range(m):
for j in range(i + 1, m):
mi[i][j] = mi[j][i] = rng.random()
perm = list(range(m))
rng.shuffle(perm)
inv = [0] * m
for a, p in enumerate(perm):
inv[p] = a
mi2 = [[mi[perm[a]][perm[b]] for b in range(m)] for a in range(m)]
e1 = aracne_prune(mi, 0.1, 0.05)
e2 = {tuple(sorted((perm[a], perm[b]))) for a, b in aracne_prune(mi2, 0.1, 0.05)}
assert e1 == e2
def test_larger_tolerance_keeps_more_edges():
rng = random.Random(5)
for _ in range(50):
m = 6
mi = [[0.0] * m for _ in range(m)]
for i in range(m):
for j in range(i + 1, m):
mi[i][j] = mi[j][i] = rng.random()
prev = aracne_prune(mi, 0.0, 0.0)
for tol in (0.05, 0.1, 0.2, 0.5, 0.9):
cur = aracne_prune(mi, 0.0, tol)
assert prev <= cur
prev = cur
def test_exact_mi_on_a_tree_gives_the_tree():
# Theorem 1 of Margolin et al. 2006: exact MI values of a tree network
rng = random.Random(6)
for _ in range(100):
m = rng.randint(2, 12)
parent, r = random_tree(rng, m)
mi = gaussian_mi_matrix(tree_correlations(m, parent, r))
truth = {tuple(sorted((c, parent[c]))) for c in range(1, m)}
assert aracne_prune(mi, 0.0, 0.0) == truth
def test_tree_correlation_products():
parent = [0, 0, 1, 1]
r = [1.0, 0.5, -0.6, 0.8]
rho = tree_correlations(4, parent, r)
assert abs(rho[2][3] - (-0.6 * 0.8)) < 1e-15
assert abs(rho[0][3] - 0.5 * 0.8) < 1e-15
assert abs(rho[0][2] - 0.5 * -0.6) < 1e-15
def test_recovery_on_simulated_data_is_measured():
# a measurement for one seed, not a guarantee: 8 genes, 250 samples, 4 bins
rng = random.Random(7)
m, n = 8, 250
parent = [0, 0, 1, 1, 2, 2, 3, 0]
r = [1.0, 0.85, 0.8, 0.75, 0.8, 0.7, 0.85, 0.8]
data = simulate_tree(rng, m, parent, r, n)
truth = {tuple(sorted((c, parent[c]))) for c in range(1, m)}
mi = mi_matrix(data, 4)
relevance = {(i, j) for i in range(m) for j in range(i + 1, m) if mi[i][j] > 0.05}
pruned = aracne(data, 0.05, 0.0, 4)
assert pruned <= relevance
assert truth <= relevance
fp_rel = len(relevance - truth)
fp_ar = len(pruned - truth)
tp_ar = len(pruned & truth)
assert fp_ar < fp_rel
assert tp_ar >= 6
# the measured numbers quoted on the page
assert (len(relevance), tp_ar, fp_ar) == MEASURED
# all 28 pairs pass the threshold; ARACNE keeps the 7 true edges and no other
MEASURED = (28, 7, 0)
History
Butte and Kohane proposed relevance networks of mutual information in 2000. Basso, Margolin, Stolovitzky, Klein, Dalla Favera and Califano used ARACNE in 2005 to reconstruct a regulatory network of human B cells. Margolin and coauthors gave the full description, the theorems and the tests on synthetic networks in BMC Bioinformatics in 2006. Lachmann, Giorgi, Lopez and Califano published the faster ARACNe-AP in 2016.
References
- Adam A. Margolin, Ilya Nemenman, Katia Basso, Chris Wiggins, Gustavo Stolovitzky, Riccardo Dalla Favera and Andrea Califano, ARACNE, an algorithm for the reconstruction of gene regulatory networks in a mammalian cellular context, BMC Bioinformatics 7 (Suppl 1), S7, 2006, the sections on the algorithm (MI estimation, the threshold and the DPI with tolerance), Theorems 1 to 3 on exact reconstruction, and the complexity O(N^3 + N^2 M^2)
- Thomas M. Cover and Joy A. Thomas, Elements of Information Theory, 2nd edition, Wiley, 2006, Section 2.8, the data-processing inequality (Theorem 2.8.1)
- Katia Basso, Adam A. Margolin, Gustavo Stolovitzky, Ulf Klein, Riccardo Dalla Favera and Andrea Califano, Reverse engineering of regulatory networks in human B cells, Nature Genetics 37(4), 2005, the application of ARACNE to B cell expression profiles
- Alexander Lachmann, Federico M. Giorgi, Gonzalo Lopez and Andrea Califano, ARACNe-AP, gene network reverse engineering through adaptive partitioning inference of mutual information, Bioinformatics 32(14), 2016, the adaptive partitioning estimator and the bootstrap consensus
- Atul J. Butte and Isaac S. Kohane, Mutual information relevance networks, 2000, the relevance network, all gene pairs with mutual information above a threshold
- Daniel Marbach et al., Wisdom of crowds for robust gene network inference, Nature Methods 9(8), 2012, the DREAM5 comparison, in which ARACNE is one of the mutual information methods
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H1 sketch |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag VF2D8H Edit this page History Report an error Markdown