Open alejandrocs98 opened 7 months ago
Hi, thanks for the report. I was not able to reproduce it on a smaller example. The "old" values are simply the growth rates from a cooperative tradeoff run, so they should be the same as running com.cooperative_tradeoff(fraction=0.6)
. It looks like in your case 2 successive runs yield different growth rates which is buggy for sure. Maybe you could verify if that is the case.
What solver are you using (output of com.solver
)? It looks like you don't have HIGHSpy installed which might mean you are still running the old OSQP solver which can have problems with accuracy. So updating to the latest MICOM version might help already, but it might also be something else.
Hi! Thank you for your response. I was running the simulations on my home institution's HPC cluster and then doing the further analysis on my PC. I decided to run everything on my PC and the consistency problem between runs was solved. Also, here is the output for com.solver
(I am using GUROBI as a solver):
<optlang.gurobi_interface.Model at 0x706ed8ba3ee0>
Nevertheless, now I have a new doubt. Now when I perform exactly what I mentioned in my initial issue report, the results for both methods (old = change - new, and modyfing the code for directly retrieving the old values) I get exactly the same results, which is great!
However, I ran com.cooperative_tradeoff(fraction=0.6)
to check if I retrieved the same results and got different ones. Also, I checked the results that I got from running the growth
workflow for that sample and also obtained different results.
The repo in which I have been working in this project is a mess and I haven't push anything to the remote in a while, but I created a test repo with the data and code (in a jupyter notebook) that I have used to test this : https://github.com/alejandrocs98/my-micom-test.
So the output from your KO modification and the growth results you loaded look the same to me. The differences there are within the solver tolerance which is 1e-6 but in practice can be slightly larger for individual variables. So a difference between 1e-20 and 1e-14 does not mean much, those are both essentially zero.
Your first cooperative tradeoff definitely looks different though. I will try to investigate a bit with the data you uploaded. Thanks for that!
It makes perfect sense to me! Thank you so much :)
Hi! I really like MICOM! But I am having a problem when trying to perform the Taxa Knockout Analysis
Problem description
I want to calculate the log fold change of the growth rates when performing the Taxa Knockouts. Currently, one can obtain one of three possible outputs when using
com.knockout_taxa()
.method='raw'
-> new: the new growth rates for the taxa in the community without the knocked taxon.method=
change` -> new - old: the absolute change in the growth rates for the new community without the knocked taxon with respect to the original community.method=
relative change` -> (new - old)/old: the relative change in the growth rates for the new community without the knocked taxon with respect to the original community.What I actually want for the log fold change is something like log(new) - log(old) (or log(new/old), which is the same). So I attempted two things for trying to achieve this:
com.knockout_taxa()
withmethod
equal toraw
andchange
, and then calculateold
(the growth rates for the original community) as follows old = change - new (now that I know bothnew
andold
I can easily calculate the log fold change using either of the expressions above). The problem is that, when I checked the values forold
for all my samples, I consistently found some troubling values for some of the knocked taxa (always in one of the first three taxa in my matrix).As you can see, the results for
old
should be a matrix where the values for all the rows in a column should be the same, and it it true for most of the taxa but it fails for the first 3 taxa. This happens consistently across my 15 samples and even when using different media.com.knockout_taxa()
it returns me not only the new growth rates (when usingmethod=raw
) but also the old values. The and, something that is also strange for me is that the values I am obtaining are quite different to the previous calculation (1.).Context