opencobra / cobratoolbox

The COnstraint-Based Reconstruction and Analysis Toolbox. Documentation:
https://opencobra.github.io/cobratoolbox
Other
253 stars 318 forks source link

Error when opening certain SBML files #874

Closed tanio003 closed 7 years ago

tanio003 commented 7 years ago

@tpfau I'm getting an error using MATLAB 2015b and 2016b when I try to open a model (iNS934.xml). The SMBL file was download from here: https://bmcsystbiol.biomedcentral.com/articles/10.1186/s12918-017-0441-1#Bib1 ("Additional File 3", just above References Section)

The model itself is valid on SBML checker. Error message get when I try to open this model is

>> model=readCbModel('iNS934.xml')
Error using cellfun
Non-scalar in Uniform output, at index 1, output 1.
Set 'UniformOutput' to false.

Error in readSBML>extractGPRRule (line 447)
    ruleGenes = cellfun(@(x) regexp(x,'[^ \[\]\(\)\{\}]*','match'),geneFields);

Error in readSBML (line 214)
        [rule,cgenes] = extractGPRRule(grRule{i},model.genes,0);

Error in readCbModel (line 206)
        model = readSBML(fileName,defaultBound);

I also attached the log file for COBRA toolbox as pdf. COBRAconfigReport-2.pdf

Thank you I hereby confirm that I have:

(Note: You may replace [] with [X] to check the box)

laurentheirendt commented 7 years ago

Direct link to model file.

tpfau commented 7 years ago

Hi @tanio003 Thanks for the report. There are a few issues with this file: One issue is something we can solve. There is an empty GPR that only contains '()' - something that we did not accept (but I'll put in a PR to adapt that). However, there are two errors in the SBML (line 46837, 46902), where the GENE_ASSOCIATION contains a duplicated 'and', which is something we can't filter in the code as this would allow very odd things to happen.This is simply an mistake in the SBML where the SBML does not stick to the definition.

laurentheirendt commented 7 years ago

Thanks @tanio003 and @tpfau! :+1: