I was trying to test how many alternative minimal_medium() are possible with open_exchanges as True for each model. #589 is what I was testing for different models.
I first tried my code on windows machine and then ported to my server with podman for faster results but the results were not replicating.
But if I am getting different outputs on different machines (Windows and Podman
container [Ubuntu]) with same code and python packages, the concept of limited solutions for minimal_media() seems wrong. @sunilnagpal :)
I am not sure if this should go as a question or an issue, so have made an issue just in case.
My questions are:
- Why does cobrapy act in this way?
- Is this just the difference in machines?
- If so are there ways to improve this? Can I do anything about it?
- How does the minimal_medium() function works? Why does it limit to just 5 output as in the example case, when we can see there are 5 more solutions also feasible. How and why does it limit the output?
- If the same model shows very different outputs which one is correct? Does it still hold any biological relevance if I know there are possibly many other alternative medias which are possible other than the outputs I observe.
These versions are same for both machines as I thought maybe those could be the reason:
Cobrapy version: 0.29.1
swiglpk: 5.0.12
optlang: 1.8.3
The solution i got on different machines:
Windows:
| |
0 |
1 |
2 |
3 |
4 |
| EX_cpd00012_e0 |
0.216872 |
0.217619 |
0.186794 |
7.023511 |
5.270229 |
| EX_cpd00028_e0 |
0.003096 |
0.003096 |
0.003096 |
0.003096 |
0.003096 |
| EX_cpd00030_e0 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
| EX_cpd00034_e0 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
| EX_cpd00048_e0 |
0.109715 |
0.109715 |
0.109715 |
0.109715 |
0.109715 |
| EX_cpd00051_e0 |
0.124897 |
0.124897 |
0.124897 |
0.124897 |
0.124897 |
| EX_cpd00058_e0 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
| EX_cpd00063_e0 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
| EX_cpd00099_e0 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
| EX_cpd00108_e0 |
501.252 |
2.655737 |
322.5745 |
2.997655 |
2.267766 |
| EX_cpd00149_e0 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
Podman:
| |
0 |
1 |
2 |
3 |
4 |
| EX_cpd00012_e0 |
22.43154 |
9.681643 |
15.375 |
8.121669 |
5.49252 |
| EX_cpd00028_e0 |
0.077686 |
0.003096 |
0.003096 |
0.003096 |
0.003096 |
| EX_cpd00030_e0 |
0.038843 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
| EX_cpd00034_e0 |
0.038843 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
| EX_cpd00048_e0 |
2.752599 |
0.109715 |
0.109715 |
0.109715 |
0.109715 |
| EX_cpd00051_e0 |
3.133482 |
0.124897 |
0.124897 |
0.124897 |
0.124897 |
| EX_cpd00058_e0 |
0.038843 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
| EX_cpd00063_e0 |
0.038843 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
| EX_cpd00099_e0 |
0.038843 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
| EX_cpd00108_e0 |
59.81598 |
665.8628 |
4.887436 |
500.05 |
2.378912 |
| EX_cpd00149_e0 |
0.038843 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
| EX_cpd00182_e0 |
119.3432 |
2.619473 |
4.954539 |
2.526269 |
0 |
| EX_cpd00205_e0 |
0.038843 |
0.001548 |
0.001548 |
0.001548 |
0.001548 |
| EX_cpd00220_e0 |
0.077686 |
0.003096 |
0.003096 |
0.003096 |
0.003096 |
To replicate the problem:
I got GSMM models for testing from: https://github.com/danielriosgarza/MAMBO, but this should be applicable for any model(I do not think it is a problem of models)
Code:
# making the media complete for the models setting bounds(-1000,1000) then finding all the possible medias
def min_medias(cmodel):
growth=0.5
model=cobra.io.read_sbml_model(folder+cmodel)
model.id=cmodel.replace('.xml','')
add_media(model,model.id,complete=True)
min_comp_open=minimal_medium(model, growth, minimize_components=100, open_exchanges=True)
return(min_comp_open)
min_medias("Zunongwangia_0.xml")
Podman image replication:
FROM python:3.10
WORKDIR /home
COPY requirements.txt .
RUN pip install --upgrade pip && pip install -r requirements.txt
requirements.txt:
optlang
swiglpk
micom
Cython
biom-format
optlang
modelseedpy
ncbi-genome-download
memote
pyscipopt
carveme
Please inform if anything else is required to address the issue.
I was trying to test how many alternative minimal_medium() are possible with open_exchanges as
Truefor each model. #589 is what I was testing for different models.I first tried my code on windows machine and then ported to my server with podman for faster results but the results were not replicating.
But if I am getting different outputs on different machines (Windows and Podman
container [Ubuntu]) with same code and python packages, the concept of limited solutions for minimal_media() seems wrong. @sunilnagpal :)
I am not sure if this should go as a question or an issue, so have made an issue just in case.
My questions are:
These versions are same for both machines as I thought maybe those could be the reason:
Cobrapy version: 0.29.1
swiglpk: 5.0.12
optlang: 1.8.3
The solution i got on different machines:
Windows:
Podman:
To replicate the problem:
I got GSMM models for testing from: https://github.com/danielriosgarza/MAMBO, but this should be applicable for any model(I do not think it is a problem of models)
Code:
Podman image replication:
requirements.txt:
Please inform if anything else is required to address the issue.