Error when running CHRR sampling algorithm

24 views
Skip to first unread message

Gideon Idumah

unread,
Apr 11, 2024, 1:14:47 PMApr 11
to COBRA Toolbox
Hello all,

I am trying to run the CHRR algorithm in the COBRA toolbox. My code is attached below:

rng(12)
changeCobraSolver('ibm_cplex', 'all');
load('../Gimme_UWB1_289_Mock90.mat')
model = tissueModel_Gimme;
samplerName = 'CHRR';
iters = 100000;
sDens = 10000;
modelname = 'Gimme_UWB1_289_Mock90';
samples = sample_func(model, iters, sDens, modelname, samplerName);
function samples = sample_func(model, iters, sDens, modelname, samplerName)
% model.c = zeros(size(model.c)); % clear objective
options.nStepsPerPoint = sDens; % sampling density
options.nPointsReturned = iters; % number of points returned
options.toRound = 1; % whether or not polytope is rounded
options.optpercentage = 0; %only consider solutions that gives at least a certain percentage of optima solution.
tic
[~, samples] = sampleCbModel(model, [], samplerName, options); % outputs model (polytope) and samples
toc
t_samples = transpose(samples);
filename = [modelname, '_', samplerName, '.csv'];
csvwrite(filename, t_samples)
disp('Finished model')
end
However, I get the following error:

Checking for width 0 facets...
Currently (P.A, P.b) are in 1539 dimensions
Checking for width 0 facets...
Found 76 degenerate reactions, adding them to the equality subspace.
Warning: Rank deficient, rank = 988, tol =  5.817499e-10.
> In preprocess (line 169)
In chrrSampler (line 145)
In sampleCbModel (line 171)
In sampling>sample_func (line 19)
In sampling (line 10)
 
Now in 551 dimensions after restricting
Removed 2914 zero rows
Preconditioning A with gmscale
Rounding...
Error using mve_solver_cobra
x0 not interior

Error in mve_run_cobra (line 32)
    [x,E2,converged] = mve_solver_cobra(A,b,x0,maxiter,tol2,reg); %Ben

Error in preprocess (line 255)
            [T_shift, Tmve,converged] = mve_run_cobra(P.A,P.b, x0,reg);

Error in chrrSampler (line 145)
        [roundedPolytope] = preprocess(P,options);

Error in sampleCbModel (line 171)
        [samples, modelSampling] = chrrSampler(model, nStepsPerPoint, nPointsReturned, toRound, modelSampling, useFastFVA,optPercentage);

Error in sampling>sample_func (line 19)
[~, samples] = sampleCbModel(model, [], samplerName, options); % outputs model (polytope) and samples

Error in sampling (line 10)
samples = sample_func(model, iters, sDens, modelname, samplerName);


I observed that if I take out the bio_mass_reaction objective (first line under the function), the code runs fine.

I will greatly appreciate any comment on why this is happening, and what should be the right approach to take.

Thank you once again
Gideon

Ronan M.T. Fleming

unread,
Apr 11, 2024, 3:13:10 PMApr 11
to cobra-...@googlegroups.com
Hi Gideon,
please can you confirm that you are using the current master version of the cobra toolbox?
Regards,
Ronan

--

---
You received this message because you are subscribed to the Google Groups "COBRA Toolbox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cobra-toolbo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cobra-toolbox/15d0c5d0-e24c-4d2c-ad3b-d3c3c34845e5n%40googlegroups.com.


--
--
Mr. Ronan MT Fleming B.V.M.S. Dip. Math. Ph.D.
----------------------------------------------------------------------------
Associate Professor,
School of Medicine,
University of Galway,
Ireland.
Coordinator of the Horizon Europe project "Reconstruction and Computational Modelling for Inherited Metabolic Diseases" (Recon4IMD)
----------------------------------------------------------------------------
Peer-reviewed publications: https://goo.gl/FZPG23
Mobile:  +353 852 109 806
Github: @rmtfleming
----------------------------------------------------------------------------

Gideon Idumah

unread,
Apr 11, 2024, 3:38:53 PMApr 11
to COBRA Toolbox
Thank you Dr Fleming for your reply.

Yes my Cobra is up to date. Here is the output from updateCobraToolbox:

>> updateCobraToolbox
 > Checking for available updates ...
 > remote.origin.url = https://github.com/opencobra/cobratoolbox.git
.
 > currentBranch = master.
 > The COBRA Toolbox is up-to-date.

Reply all
Reply to author
Forward
0 new messages