How to make COBRA toolbar work with proper SBML support in MATLAB on Linux (e.g. Ubuntu 14.04)?

Consider these 4 pieces of software:

1) COBRA 2.05

2) LibSBML 5.10

3) MATLAB R2013a (also known as 8.1, 64-bit, MATLAB no longer supports 32-bit Linux)

4) Linux 64-bit (e.g., but not limited to Ubuntu 14.04 or the latest Mint)

Introduction

The COBRA tool is an optimization package that works on MATLAB to develop MATLAB code for modeling the metabolic network. Such a “network” is a system of equations that can have a very large number of equations and variables (for example, thousands). Therefore, the procedures for reading and writing these large models in accordance with a specific format specification are mandatory, and COBRA uses standard SBML for this.

Problem

Unlike Windows versions, Linux binary packages do not integrate well out of the box: for starters, the pre-compiled Linux libSBML (open-source) disk, available for download, does not come with MATLAB support. If you try to use the pre-compiled libSBML, COBRA does not will find "MATLAB bindings" and, therefore, will not be able, for example, to read and write SBML XML files from disk to m-script.

Question

What needs to be done to make COBRA 2.05 on top of MATLAB R2013a under Linux (Ubuntu 14.04 or the latest Mint, but it hardly depends on the distribution), able to read and write SBML XML files? In other words, what needs to be done throughout the system to make COBRA your test testSBML?

+4
3

, , Linux-. , //.

1. MATLAB

1,1. MATLAB

( root-), , . :

1.1.1.

, - , - MATLAB, , , , .

1.1.2.

, , , ( Linux, , Registry, ), , , - 1.1.1 - Linux, - / script , . MATLAB NTFS- HD; , Linux HD Linux- , ?

1.2. MATLAB,

, - , MATLAB , . , /usr/local/bin/matlab - script ( , ):

    #!/bin/sh
    export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
    exec /usr/local/MATLAB/R2013a/bin/matlab $*

OBS: LD_LIBRARY_PATH SBML . , , TOMLAB, , , script. OBS 2: script , Matlab 8.01 matlab png, .desktop, , , /usr/share/applications, Unity Dash . Matlab.desktop:

    [Desktop Entry]
    Type=Application
    Icon=/usr/local/MATLAB/R2013a/Matlab.png
    Name=Matlab 8.01
    Comment="Start Matlab 8.01"
    Exec=/usr/local/MATLAB/R2013a/bin/matlab -desktop
    Categories=Development;
    Name=Matlab 8.01
    GenericName=Matlab 8.01
    Comment="Start Matlab 8.01"

2. libSBML

2,1. libSBML

libSBML deb, Ubuntu ( CentOS), Windows MacOSX ( : http://sbml.org/Software/libSBML). , , MATLAB? Linux, . , ( deb ). :

2.1.1.

libxml2-dev ( ):

    sudo apt-get install libxml2-dev

2.1.2.

configure, make, make install. , -, : , , make uninstall . , checkinstall make install, checkinstall , , ( ):

    sudo apt-get install checkinstall

2.1.3.

LibSBML - . :

    ./configure --with-matlab

OBS: with-matlab script , matlab. , , matlab , , , , . , NTFS, configure , , , . /path/to/matlab/root ( bin bin):

    ./configure --with-matlab=/path/to/matlab/root

OBS: libSBML : /usr/local/lib. , , , : --prefix=/your/installation/path

OBS 2: , libSBML matlab : MATLAB , MEX ( MATLAB), , t libSBML , MATLAB MEX .

2.1.4. libSBML

    make
    checkinstall

OBS:

I) checkinstall , . version "" ( ), checkinstall, dpkg ( , deb) . , , version (.. "5.10", , )

II) checkinstall , , make install , , , . LibSBML test.xml, $HOME , MATLAB. , test.xml , , , , . , checkinstall $HOME/test.xml ( , ), , . , $HOME/test.xml , checkinstall, test.xml $HOME, libSBML checkinstall.

2,2. libSBML MATLAB

MATLAB, , SBML MATLAB 2.1.5 ( : /usr/local/lib) installSBML.m, .

2.2.1.

- : libstdc++.so.6 GLIBCXX_3.4.15. , MATLAB libstdc++.so.6.0.13 (libstdc++.so.6 , ), /usr/local/MATLAB/R2013a/sys/os/glnxa64, ( , , :

    strings /usr/local/MATLAB/R2013a/sys/os/glnxa64/libstdc++.so.6.0.13 | grep GLIBC

). libstdc++.so.6.0.19, /usr/lib/x86_64-linux-gnu, , MATLAB 6.0.19 , LD_LIBRARY_PATH (. 1.2), libstdc++.so.6, MATLAB, - , , . , Linux Mint, : LD_LIBRARY_PATH.

2.2.2.

installSBML.m , , $HOME/test.xml 2.1.5, , . , , , , $HOME, .

3. COBRA/SBML

3.1. COBRA

MATLAB <YOUR_COBRA_ROOT_FOLDER_HERE>/external/toolboxes/SBMLToolbox-4.1.0/toolbox install.m . , MATLAB, 2.2.

3,2. MATLAB

/usr/local/MATLAB/R2013a/toolbox/local/pathdef.m root, /usr/local/lib ( libSBML MATLAB), . , MATLAB, setpath , , MATLAB root setpath MATLAB.

3.3.

. : MATLAB <YOUR_COBRA_ROOT_FOLDER_HERE> :

    initCobraToolbox
    testAll

, 14 19, SBML (testSBML), SBML MATLAB .

+1

/usr/local/lib/libsbml.so.5 Sys MATLAB:

sudo ln -s /usr/local/lib/libsbml.so.5 /usr/local/MATLAB/R2014a/sys/os/glnxa64/

, , . Cmake. FindMatlab.cmake MATLAB!

.............
        elseif(EXISTS "/Applications/MATLAB_R2008a.app/")
                set(MATLAB_ROOT_PATH "/Applications/MATLAB_R2008a.app/")    
            endif()
        else()
            if (EXISTS "/usr/local/MATLAB/R2014a/")
                set(MATLAB_ROOT_PATH "/usr/local/MATLAB/R2014a/")
            endif()
        endif()
..........
0

FYI, to solve the problem with the shared library at point 2.2.1 I needed to install the package matlab-support(in the Ubuntu repository)

0
source

Source: https://habr.com/ru/post/1541049/


All Articles