cdanielmachado / carveme

CarveMe: genome-scale metabolic model reconstruction
Other
144 stars 49 forks source link

SCIP with gap-filling and init #199

Closed tapj closed 1 month ago

tapj commented 2 months ago

Hi,

I am trying to use CarveMe with SCIP solver. It works fine with the example you provide

(carveme-1.6.1) jutap@front:~$ carve --refseq GCF_000005845.2 -o ecoli_k12_mg1655.xml --solver scip
File exists, skipping.
(carveme-1.6.1) jutap@front:~/synthplex/M2Msandbox$ ls ecoli_k12_mg1655.xml 
ecoli_k12_mg1655.xml

However, when I start to gapfill and/or init with a media, it fails:

with M9

(carveme-1.6.1) jutap@front:~$ carve --refseq GCF_000005845.2 -o ecoli_k12_mg1655.xml --solver scip --gapfill M9
File exists, skipping.
[var.c:7263] ERROR: cannot change the bounds of a fixed variable
[var.c:7239] ERROR: Error <-9> in function call
[scip_var.c:4711] ERROR: Error <-9> in function call
/usr/local/genome/Anaconda3/envs/carveme-1.6.1/lib/python3.12/site-packages/reframed/solvers/scip_solver.py:282: UserWarning: SCIP: unable to reset bounds

or with LB

(carveme-1.6.1) jutap@front:~$ carve --refseq GCF_000005845.2 -o ecoli_k12_mg1655.xml --solver scip -g LB
File exists, skipping.
[var.c:7263] ERROR: cannot change the bounds of a fixed variable
[var.c:7239] ERROR: Error <-9> in function call
[scip_var.c:4711] ERROR: Error <-9> in function call
/usr/local/genome/Anaconda3/envs/carveme-1.6.1/lib/python3.12/site-packages/reframed/solvers/scip_solver.py:282: UserWarning: SCIP: unable to reset bounds
  warn('SCIP: unable to reset bounds')

and with gapfil and init

(carveme-1.6.1) jutap@front:~$ carve --refseq GCF_000005845.2 -o ecoli_k12_mg1655.xml --solver scip -g LB -i LB
File exists, skipping.
[var.c:7406] ERROR: cannot change the bounds of a fixed variable
[var.c:7382] ERROR: Error <-9> in function call
[scip_var.c:4801] ERROR: Error <-9> in function call
/usr/local/genome/Anaconda3/envs/carveme-1.6.1/lib/python3.12/site-packages/reframed/solvers/scip_solver.py:282: UserWarning: SCIP: unable to reset bounds

I do not know if this is an issue related to SCIP.

for each, I have ecoli_k12_mg1655.xml generated but I do not know if it worked properly depsite warning.

I would apreciate any help on this.

Thank you,

Julien

cdanielmachado commented 2 months ago

Thanks for reporting this. Unfortunately I won't have time to fix this bug very soon.

Since the interface catches the error and throws just a warning, it is possible that the model was still generated successfully. Can you confirm that?

tapj commented 2 months ago

Thank you, Daniel. Yes, the model has been generated. I just wonder if model generation took into account those -g and -i options.

cdanielmachado commented 2 months ago

Running a simulation on those media should reveal if it worked... :)

Also, if there are any gap-filling reactions introduced to enable growth in those media, they will be at the end of the SBML file and have 'GAP_FILL' in their annotation.

silvtal commented 1 month ago

Running gapfill with --verbose does report reactions being added to my model(s) when using M9 or LB medium, also when using a custom medium without glucose

Loading model...
Loading reaction universe...
Loading media...
Gap filling for sint...
[var.c:7263] ERROR: cannot change the bounds of a fixed variable
[var.c:7239] ERROR: Error <-9> in function call
[scip_var.c:4711] ERROR: Error <-9> in function call
/home/silvia/.local/lib/python3.10/site-packages/reframed/solvers/scip_solver.py:282: UserWarning: SCIP: unable to reset bounds
  warn('SCIP: unable to reset bounds')
Added 2 reactions and 0 metabolites
The reactions are:
R_PHPYROX
R_PPPGO2
Saving SBML file...
Done.

(edited the code so that it would print the reactions)

tapj commented 1 month ago

thank you, @silvtal, for your insight. very helpful.