cdanielmachado / smetana

SMETANA: a tool to analyse interactions in microbial communities
Other
56 stars 11 forks source link

Different MIP and MRO scores for same input -SMETANA #10

Closed NTDevika closed 4 years ago

NTDevika commented 4 years ago

Dear Daniel, I am running Smetana  - "smetana Lactococcus_raffinolactis_strain_WiKim0068.xml V_harveyi_QT520.xml --mediadb constrained_media_Treh.tsv  --flavor cobra -o TREHALOSE"

I am getting different results when I am executing  this commands with the same set of inputs ----  MIP and MRO score. community medium size mip mro all complete 2 2 0.64

community medium size mip mro all complete 2 1 0.8333333333333334

What would be the reason? Can you please help me out to sort out this issue.

Thank You

-- Best Regards N.T.Devika

cdanielmachado commented 4 years ago

Hi Devika,

The method is deterministic so this should not happen.

Does this happen if you run the same code two consecutive times? What happens if you run multiple times?

Please add the flag --debug when you run the method. This will output an extra table with debug information including the minimal media for the whole community and each species.

Best regards, Daniel

NTDevika commented 4 years ago

Yes, when I run the same command consecutive times I got different score for MIP & MRO. Even I tried including --debug option. Smetana_Debug Smetana_Running_Same_Command_multiple_Times

cdanielmachado commented 4 years ago

Ok, I think I see what is happening. The minimal medium composition for the community has a degenerate solution, there are different media with the same number of compounds. For some reason, the solver doesn't always return the same solution. I think it is because some heuristics are applied by the MILP solver.

The medium for the community is then used to calculate the minimal media for each species, which is constrained to a subset of the original medium. Since the latter is not the same between simulations, the species-specific media also differ, which can result in different values for MIP and MRO.

My suggestion is that you use the option --molweight. This will minimize the total mass of the compounds in the media, which is less prone to degenerate solutions.

NTDevika commented 4 years ago

Thanks Daniel !! Including --molweight option Worked out.

cdanielmachado commented 4 years ago

That's great :)