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.
from micom import Community, data tax = data.test_taxonomy() com = Community(tax) ko = com.knockout_taxa(fraction=1.0) ko
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
…or the relative change ((new - old)/old):
com.knockout_taxa(fraction=1.0, method="relative change")
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