Skip to content

Error in SolveCobraQP #4

@jacobmartin2022

Description

@jacobmartin2022

I'm trying to use gapsplit to indirectly sample metabolite concentrations by sampling "cumulative" fluxes and then applying those to initial concentrations. I'm then applying upper and lower bounds on b in S*v = b to make sure my final concentrations are within experimental ranges. Since it seems like the Cobra Toolbox (and gapsplit) only allow either upper bounds or lower bounds, what I've been doing was doubling the linear problem, so I have
[S, -1.*S] * v <= [b_ub, -1 .* b_lb]
However, when I do this, it seems unable to find a solution, even though I've confirmed that there's a feasible solution with

[x_init,resnorm,residual,exitflag,output,lambda] = ...
            lsqlin(C, d, A, b, [], [], ...
            tot_flux_lb, tot_flux_ub, [], lsqlin_options);

that there is a solution.

I attached an example workspace where I run

flux_struct_test = gapsplit(gs_model, n_samples, ...
                'primary', 'max',...
                'secondaryFrac', gs_metab_secondary_frac,...
                'minval', gs_minval,...
                'maxval', gs_maxval);

I pulled gs_minval and gs_maxval from a single homemade FVA, but it seems the same if I don't pass those varargin to gapsplit.

If I only solve the lower-bounded problem (bottom half of my double-bounded problem), gapsplit seems able to sample, but very slowly.

Lastly, the gurobi solver seems to be having more issues than pdco for this problem. Using the gurobi solver, I get the exception "'Gurobi error 10003: Element 0 of a double array is Nan or Inf.'" at line 713 of SolveCobraQP.
If I'm using pdco, gapsplit just seems unable to find a solution (keeps entering the statement at line 263 of gapsplit and restarts the loop).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions