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 Step 4 #338

Closed Yu-sysbio closed 1 year ago

Yu-sysbio commented 1 year ago

I do not remember if I reported this before but by running:

complexInfo = getComplexData(); [ecModel, foundComplex, proposedComplex] = applyComplexData(ecModel, complexInfo);

I got:

Conversion to cell from char is not possible.

Error in applyComplexData (line 75) complexProts(lastProt+1:lastProt+numel(newProts))=newProts;

Here is the data step4.zip downloaded and generated during this step.

Yu-sysbio commented 1 year ago

Just checked, and found that the file "ComplexPortal.json" that I downloaded was a bit different from the file that you provided in the repo.

By using the file that you provided I did not get any error.

ae-tafur commented 1 year ago

I just download the file, the only difference I see:

In my new file: {"complexID":"CPX-1249","name":"SDS22-GLC7 phosphatase complex","species":"Saccharomyces cerevisiae; 559292","geneName":["GLC7","SDS22"],"protID":["P32598","P36047"],"stochiometry":[1,1],"defined":1},

in your file: {"complexID":"CPX-1249","name":" ","species":" ","geneName":" ","protID":" ","stochiometry":0,"defined":0}

Results after applyComplexData with my file:

[ecModel, foundComplex, proposedComplex] = applyComplexData(ecModel, complexInfo);
A total of 207 complex have full match, and 13 proposed.

With your file:

Conversion to cell from char is not possible.

Error in applyComplexData (line 75)
    complexProts(lastProt+1:lastProt+numel(newProts))=newProts;

So, I think it was an error downloading the data. Anyways the main error is because if there is a complex without data in complex portal then complexID is save it and the rest of the information is filled with an whitespace. Here is the line that do it:

https://github.com/SysBioChalmers/GECKO/blob/b4ee971d395d5c4df18989cd00f117340ba095cb/src/geckomat/change_model/getComplexData.m#L129

So a way to solve this is changing that lines or replacing this one

https://github.com/SysBioChalmers/GECKO/blob/b4ee971d395d5c4df18989cd00f117340ba095cb/src/geckomat/change_model/applyComplexData.m#L72

by

protIDs = strtrim(complexData(i).protID);

edkerk commented 1 year ago

Will implement