Taxa knockouts

An interesting question concerning any given microbial community is how dependent the growth of one bacteria is one the presence of other bacteria. One strategy to answer that is to perform in silico knockouts for each individual taxa in a community and observe how this changes the growth rates of other bacteria. If the knowckout of one bacteria increases the growth of another one this indicates competitivity whereas a dimished growth rate indicted cooperativity. In order to get unique growth rate solutions we will again use cooperative tradeoff.

For large models as managed in micom running those knockouts can be challenging due to numerical problems and the tendency of the solvers to get stuck in a previous solutions. micom thus implements an optimized knockout algorithms that avoids numerical and solver issues as much as possible.

Still you should be aware that knockouts are computationally instensive due to the large numbers of quadratic and linear programming problems that have to be solved. For realistic communities with 10-100 taxa and many samples you should expect a full knockout experiment to take between 1 and 5 hours. Here we will perform the knockouts for our small E. coli example.

[1]:
from micom import Community, data

tax = data.test_taxonomy()
com = Community(tax)

ko = com.knockout_taxa(fraction=1.0)
ko


[1]:
compartments Escherichia_coli_1 Escherichia_coli_2 Escherichia_coli_3 Escherichia_coli_4
Escherichia_coli_1 -0.873922 0.305549 0.305549 0.305549
Escherichia_coli_2 0.305549 -0.873922 0.305549 0.305549
Escherichia_coli_3 0.305549 0.305549 -0.873922 0.305549
Escherichia_coli_4 0.305549 0.305549 0.305549 -0.873922

By default knockout_species returns the changes in growth rate meaning the difference between the growth rate after the knockout and the growth rate before. Rows denote the taxa that has been kncked out and columns the changes in growth rate. As we can see all knockouts increase the growth rates of the remaining E. coli strains in this example which makes sense since all of them compete for the same resources. Alternatively we can also just get the new growth rates after the knockout

[2]:
com.knockout_taxa(fraction=1.0, method="raw")

[2]:
compartments Escherichia_coli_1 Escherichia_coli_2 Escherichia_coli_3 Escherichia_coli_4
Escherichia_coli_1 0.000000 1.179471 1.179471 1.179471
Escherichia_coli_2 1.179471 0.000000 1.179471 1.179471
Escherichia_coli_3 1.179471 1.179471 0.000000 1.179471
Escherichia_coli_4 1.179471 1.179471 1.179471 0.000000

…or the relative change ((new - old)/old):

[3]:
com.knockout_taxa(fraction=1.0, method="relative change")

[3]:
compartments Escherichia_coli_1 Escherichia_coli_2 Escherichia_coli_3 Escherichia_coli_4
Escherichia_coli_1 -1.00000 0.34963 0.34963 0.34963
Escherichia_coli_2 0.34963 -1.00000 0.34963 0.34963
Escherichia_coli_3 0.34963 0.34963 -1.00000 0.34963
Escherichia_coli_4 0.34963 0.34963 0.34963 -1.00000

In certain circumstances the diagonal entries can be confusing since the knocked out taxa always loses its entire growth. We can suppress the diagonal using the diag argument.

[4]:
com.knockout_taxa(diag=False)

[4]:
compartments Escherichia_coli_1 Escherichia_coli_2 Escherichia_coli_3 Escherichia_coli_4
Escherichia_coli_1 NaN 0.305549 0.305549 0.305549
Escherichia_coli_2 0.305549 NaN 0.305549 0.305549
Escherichia_coli_3 0.305549 0.305549 NaN 0.305549
Escherichia_coli_4 0.305549 0.305549 0.305549 NaN
[ ]: