@@ -308,9 +308,16 @@ def _build_with_imat(
308308 expr_vector : npt .NDArray ,
309309 expr_thesh : tuple [float , float ],
310310 force_gene_ids : Sequence [int ],
311+ solver : str ,
311312) -> (cobra .Model , pd .DataFrame ):
312313 expr_vector = np .array (expr_vector )
313- properties = IMATProperties (exp_vector = expr_vector , exp_thresholds = expr_thesh , core = force_gene_ids , epsilon = 0.01 )
314+ properties = IMATProperties (
315+ exp_vector = expr_vector ,
316+ exp_thresholds = expr_thesh ,
317+ core = force_gene_ids ,
318+ epsilon = 0.01 ,
319+ solver = solver .upper (),
320+ )
314321 algorithm = IMAT (s_matrix , np .array (lb ), np .array (ub ), properties )
315322 context_rxns : npt .NDArray = algorithm .run ()
316323 fluxes : pd .Series = algorithm .sol .to_series ()
@@ -419,7 +426,6 @@ def _build_model( # noqa: C901
419426 force excluded even if they meet GPR association requirements using the force exclude file.
420427 """
421428 config = Config ()
422- cobra .Configuration ().solver = solver .lower ()
423429 reference_model : cobra .Model
424430 match general_model_file .suffix :
425431 case ".mat" :
@@ -508,7 +514,14 @@ def _build_model( # noqa: C901
508514 elif recon_algorithm == Algorithm .IMAT :
509515 context_model_cobra : cobra .Model
510516 context_model_cobra , flux_df = _build_with_imat (
511- reference_model , s_matrix , lb , ub , expr_vector , exp_thresh , idx_force
517+ reference_model ,
518+ s_matrix ,
519+ lb ,
520+ ub ,
521+ expr_vector ,
522+ exp_thresh ,
523+ idx_force ,
524+ solver = solver ,
512525 )
513526 imat_reactions = flux_df .rxn
514527 model_reactions = [reaction .id for reaction in context_model_cobra .reactions ]
0 commit comments