SysBioChalmers / GECKO

Toolbox for including enzyme constraints on a genome-scale model.
http://sysbiochalmers.github.io/GECKO/
MIT License
66 stars 51 forks source link

Bug detected in `getSubsetEcModel` #327

Closed mihai-sysbio closed 1 year ago

mihai-sysbio commented 1 year ago

Description of the bug:

Initially spotted here, running the last step of the light tutorial triggers an error.

Reproducing these results:

>> ecHT29 = getSubsetEcModel(ecModel,HT29);
Matrix index is out of range for deletion.

Error in removeReactions (line 41)
        reducedModel.rxns(indexesToDelete)=[];

Error in getSubsetEcModel (line 53)
smallEcModel = removeReactions(smallEcModel,~keepRxns, true, true, true);

System information

I hereby confirm that I have:

mihai-sysbio commented 1 year ago

These two lines are identical https://github.com/SysBioChalmers/GECKO/blob/38b6768b2ef9fb801a6739ef653372c3766c9f5a/src/geckomat/utilities/getSubsetEcModel.m#L41 https://github.com/SysBioChalmers/GECKO/blob/38b6768b2ef9fb801a6739ef653372c3766c9f5a/src/geckomat/utilities/getSubsetEcModel.m#L53

but I don't understand how come there is no

smallEcModel = removeReactions(bigEcModel,~keepRxns, true, true, true);
edkerk commented 1 year ago

These two lines are identical

https://github.com/SysBioChalmers/GECKO/blob/38b6768b2ef9fb801a6739ef653372c3766c9f5a/src/geckomat/utilities/getSubsetEcModel.m#L41

https://github.com/SysBioChalmers/GECKO/blob/38b6768b2ef9fb801a6739ef653372c3766c9f5a/src/geckomat/utilities/getSubsetEcModel.m#L53

Line 53 should be deleted.

but I don't understand how come there is no

smallEcModel = removeReactions(bigEcModel,~keepRxns, true, true, true);

That would not make sense. The smallEcModel is starting to get generated in line 26, and then modified in the rest of the function.

https://github.com/SysBioChalmers/GECKO/blob/38b6768b2ef9fb801a6739ef653372c3766c9f5a/src/geckomat/utilities/getSubsetEcModel.m#L26

edkerk commented 1 year ago

Resolved in #331