Did you already initialize the map object? Before you use the drawFlux
function, you have to load the map file into a handle using the
function readCbMap().
> map1 = readCbMap('iAF1260_central.txt');
where the input file is obtained from the BiGG database.
Hope this helps,
Chris
On Nov 16, 10:58 am, JM Seoane <jm.seoane.redo...@gmail.com> wrote:
> Dear COBRA users,
>
> I am trying to follow the protocol published in nature protocols by
> Schellenberger et al. (2011), and everything worked fine until I
> tried to plot optimal flux distributions with drawFlux. i am using
> matlab 64 with w7 64 and gurobi, with this solvers:
>
> >> initCobraToolbox()
>
> LP solver set to gurobi successful
> MILP solver set to gurobi successful
> QP solver set failed
> MIQP solver set failed
> CB map output set to svg successful
>
> >> model=readCbModel()
>
> My numerical solution solution.f is 0.87 as in the example, but when I
> try to plot using drawFlux I got the following message from Matlab:
>
> >> drawFlux(map,model,solution.x,[],'ZeroFluxWith',1,'lb',-15,'ub',15,'FileNam e','EcoreOptFlux2.svg');
Thank you for your kind reply. I am doing as follows:
>> clear all
>> initCobraToolbox()
LP solver set to gurobi successful
MILP solver set to gurobi successful
QP solver set failed
MIQP solver set failed
CB map output set to svg successful
>> model = readCbModel('ecoli_core_model.xml');
>> map = readCbMap('ecoli_core_map.txt');
>> changeCbMapOutput('svg');
>> solution = optimizeCbModel(model);
>> drawFlux(map, model, solution.x, [], 'ZeroFluxWidth', 1, 'lb', -15, 'ub', 15, 'FileName', 'EcoreOptFlux2.svg');
Without problems until I get here:
??? Error using ==> fprintf
Invalid file identifier. Use fopen to generate a valid file
identifier.
Error in ==> drawCbMap at 200
fprintf(mapHandle, '<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>\n');
Error in ==> drawFlux at 122
drawCbMap(map,options);
Also problems when trying to plot it as a matlab figure, etc. The map
and model I used is the one provided with cobra toolbox as an
example :-(
Thank you for any help/advise you may have!
Jose
I figured this out by myself. It was an stupid mistake but may happen
to other people. You have to run MATLAB as administrator in order to
save files (I have installed cobra in the same location than the other
matlab toolboxes I have).
Thanks a lot and sorry for taking your time!
Jose