Error using singleGeneDeletion()

78 views
Skip to first unread message

Michel_Lavoie

unread,
Apr 17, 2019, 10:07:59 AM4/17/19
to COBRA Toolbox
Hi all,
   I am using CobraToolbox on MAC OS and gurobi. I tried to use the command 'singleGeneDeletion(model, 'FBA')', but I had the following error message :

>>[grRatio, grRateKO, grRateWT, hasEffect, delRxns, fluxSolution] = singleGeneDeletion(model1, 'FBA')
Single gene deletion analysis in progress ...
1%      [                                        ]Error using deleteModelGenes (line 86)
Error: This statement is incomplete.

Error in singleGeneDeletion (line 137)
        [modelDel,hasEffect(i),constrRxnNames] = deleteModelGenes(model,geneList{i});

Then. I tried to look for when the function stopped to work using :

>>i = 1;
for i = 1:length(model.genes)
    disp(i)
    [grRatio, grRateKO, grRateWT, hasEffect, delRxns, fluxSolution] = singleGeneDeletion(model1, 'FBA', model1.genes(i));
end

I found that the function stopped working at model1.genes(11). I looked at the genes associated with this using :
>>model1.genes(11)

ans =

  1×1 cell array

    {'149227'}

Then, I looked at the grRules and .rules field using :

Index = strfind(model1.genes, '149227');

find(not(cellfun('isempty',Index)))

Index = find(contains(model1.rules,'x(11)'));

Index

model1.rules(Index)

 

Index = strfind(model1.grRules, '149227');

Index = find(not(cellfun('isempty',Index)))

model1.grRules(Index)


I don't understand why the function stop working at model1.genes(11). This gene has a model1.grRules field =  {'(149227)'} and a model1.rules field =  {'( x(11) )'}. All .grRules and .rules field have parenthesis, but .genes field has no parenthesis. I ran the command 'generateRules(model1)' before running singleGeneDeletion() so all rules should be ok. Would anyone know what I should do so that the singleGeneDeletion() function work?
Thanks,
Michel







Thomas Pfau

unread,
Apr 17, 2019, 4:14:31 PM4/17/19
to 'Michel_Lavoie' via COBRA Toolbox
Hi Michel,

Did you run "model1 = generateRules(model1)" or just "generateRules(model1)" (since the latter won't do anything, as the model is not updated, which needs the assignment).
Other than that, it is really hard to say, what could have gone wrong without having the model, because from what you mention, it should be fine.

Best

Thomas
--

---
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.
For more options, visit https://groups.google.com/d/optout.


Michel_Lavoie

unread,
Apr 18, 2019, 8:21:35 AM4/18/19
to COBRA Toolbox
Hi Thomas,
     I found the problem. I deleted the field 'rxnGeneMat' in my model, which lead to errors when I ran the singleRxnDeletion() command. When I keep the 'rxnGeneMat' field' , it works.

Thank you for your help,
Michel
To unsubscribe from this group and stop receiving emails from it, send an email to cobra-...@googlegroups.com.

Michel_Lavoie

unread,
Apr 18, 2019, 8:38:42 AM4/18/19
to COBRA Toolbox
Sorry for my last email, the function 'singleGeneDeletion' does not work. The 'rxnGeneMat' field is a matrix filled with zeros in my model and when I run verifyModel(model, 'simpleCheck', true), I get an error :
The following problems have been encountered in the model structure
inconsistentFields:
rxnGeneMat: genes: Size of rxnGeneMat does not match elements in genes

ans =

  logical

   0

Moreover, the results of singleGeneDeletion are not correct. I find grRatio always equals to 1, grRateKO always = 0.0178, grRateWT = 0.0178, delRxns with empty field and hasEffect with zeros and 'fluxSolution' gives the same flux distribution for each gene deletion. How can I regenerate the field .rxnGeneMat ?

Thanks for your help,

Michel

Michel_Lavoie

unread,
Apr 18, 2019, 10:32:26 AM4/18/19
to COBRA Toolbox
Hi again,
  I builded the rxnGeneMat matrix with the function 'buildRxnGeneMat(model)' (model = buildRxnGeneMat(model) ) after having run 'model = generateRules(model) '. I still get the same error message when I perform a singleGeneDeletion (see below). I attach my .mat file so that someone could check where the error could be.

[grRatio, grRateKO, grRateWT, hasEffect, delRxns, fluxSolution] = singleGeneDeletion(model, 'FBA');
Single gene deletion analysis in progress ...
1%      [                                        ]Error using deleteModelGenes (line 86)
Error: This statement is incomplete.

Error in singleGeneDeletion (line 137)
        [modelDel,hasEffect(i),constrRxnNames] = deleteModelGenes(model,geneList{i});
modelMichel.mat

Michel_Lavoie

unread,
Apr 30, 2019, 9:11:44 AM4/30/19
to COBRA Toolbox
Hi all, 
Would anyone have any idea why I get this error message below when I run the command 'singleGeneDeletion(model, 'FBA') when using the model in the attached "modelMichel.mat' file ? 
Thanks for your help,
Michel
[grRatio, grRateKO, grRateWT, hasEffect, delRxns, fluxSolution] = singleGeneDeletion(model, 'FBA');
Single gene deletion analysis in progress ...
1%      [                                        ]Error using deleteModelGenes (line 86)
Error: This statement is incomplete.

Error in singleGeneDeletion (line 137)
        [modelDel,hasEffect(i),constrRxnNames] = deleteModelGenes(model,geneList{i});

Thomas Pfau

unread,
Apr 30, 2019, 4:24:50 PM4/30/19
to cobra-...@googlegroups.com
Hi Michel,

This is an error in your model. your rules 395 and 1444 are invalid (i.e. both are missing a closing parenthesis). This is nothing the toolbox can fix, as it does not know where the parenthesis should be, but it leads to an invalid statement when trying to evaluate the rule using eval.
I put in a PR to explicitly check model rules for validity when loading models, and added some verbosity to verifyModel with respect to where fields are invalid.

Best

Thomas
To unsubscribe from this group and stop receiving emails from it, send an email to cobra-toolbo...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages