Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SBML import fails with MATLAB R2018a #303

Closed
thomassligon opened this issue May 15, 2018 · 10 comments
Closed

SBML import fails with MATLAB R2018a #303

thomassligon opened this issue May 15, 2018 · 10 comments

Comments

@thomassligon
Copy link
Contributor

The attached file was created in Cell Designer and validated by SBML.org, but ODE import fails with

Error using sym>convertChar (line 1448)
Character vectors and strings in the first argument can only specify a variable or number. To evaluate character vectors and strings representing symbolic
expressions, use 'str2sym'.

Error in sym>tomupad (line 1214)
        S = convertChar(x);

Error in sym (line 211)
                S.s = tomupad(x);

Error in cell2sym (line 31)
Csym = cellfun(conv, C, 'UniformOutput', false);

Error in sym>tomupad (line 1226)
    xsym = cell2sym(x);

Error in sym (line 211)
                S.s = tomupad(x);

Error in SBMLode/importSBML>cleanedsym (line 686)
csym = sym(sanitizeString(strrep(str,'time','__time_internal_amici__')));

Error in SBMLode/importSBML (line 80)
all_rulemath = cleanedsym({model.rule.formula});

Error in SBMLode (line 63)
            model.importSBML(filename);

Error in testAsthmaM07cd2>import (line 57)
    ODE = SBMLode([modelName '.xml']);

Error in testAsthmaM07cd2 (line 10)
ODE = import(modelName); % only first time

ODEimportError.zip

@dweindl
Copy link
Member

dweindl commented May 15, 2018

@thomassligon The script fails because of a wrong filename (ASTHMA_V40_M07cd vs ASTHMA_V40_M07cd2).

After correcting that, sbml import works for me. Cannot reproduce this error with the latest AMICI version on R2017b/Linux.

@dweindl
Copy link
Member

dweindl commented May 15, 2018

The model also compiles, but the provided script fails with:

Undefined function or variable 'getPar0AsthmaM06'.

Error in testAsthmaM07cd2 (line 30)
par0 = getPar0AsthmaM06();

@thomassligon
Copy link
Contributor Author

Daniel, thanks for the quick response! I see that I uploaded the wrong script, cd2 instead of cd, so that (trivial) problem is fixed. In addition, if ODE import and amiwrap works, then everything is OK. However, I just retested, and I still get the same error. I am running R2018a/Windows. Could you try with R2018a/Linux?

@thomassligon
Copy link
Contributor Author

I just retested on R2017b/Windows and it seems to be working OK, except that I am getting tons of this warning:

Warning: Support of character vectors will be removed in a future release. Character vectors can be used only for variable names and numbers. Instead, to
create symbolic expressions first create symbolic variables using 'syms'. To evaluate character vectors and strings representing symbolic expressions, use
'str2sym'. 

Maybe R2018a is the future release they were talking about.

@dweindl
Copy link
Member

dweindl commented May 16, 2018

Thanks for testing with the old release. I don't have R2018a one installed at the moment. I didn't find any information on syms-related issues in mathworks release notes, but I guess you are right.

@dweindl
Copy link
Member

dweindl commented May 16, 2018

Reproduced with R2018a/Linux.

EDIT:
Fails at x = 'scaleSykP*s82+offsetSykP'

@dweindl dweindl added the bug label May 16, 2018
@dweindl dweindl changed the title SBML import fails for a val SBML import fails with MATLAB R2018a May 16, 2018
FFroehlich pushed a commit that referenced this issue May 22, 2018
@thomassligon
Copy link
Contributor Author

Please add my account (thomassligon) as a contributor. I would like to create a new branch and pull request for corrections to issue #303, since the latest changes did not fix it.

@FFroehlich FFroehlich reopened this May 23, 2018
@FFroehlich
Copy link
Member

done

thomassligon added a commit that referenced this issue May 23, 2018
More text will appear in pull request.
thomassligon added a commit that referenced this issue May 23, 2018
@thomassligon
Copy link
Contributor Author

I just fetched AMICI and tested, resulting the following error:

Undefined function or variable 'betterSym'.

Error in SBMLode/importSBML>cleanedsym (line 689)
csym = betterSym(sanitizeString(strrep(str,'time','time_internal_amici')));

@dweindl
Copy link
Member

dweindl commented Mar 9, 2021

By now, the documentation clearly states that we require Matlab<R2018a. Therefore, I think we can close this issue.

@dweindl dweindl closed this as completed Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants