Coder Social home page Coder Social logo

opencobra / cobra.jl Goto Github PK

View Code? Open in Web Editor NEW
60.0 16.0 31.0 11.56 MB

High-level, high-performance, constraint-based reconstruction and analysis in Julia

Home Page: https://git.io/COBRA.jl

License: Other

Julia 77.70% Shell 0.47% Jupyter Notebook 21.83%
julia cobra analysis large-scale huge-scale high-performance high-level constraint-based-modeling

cobra.jl's Introduction

COBRA logo

COBRA.jl - COnstraint-Based Reconstruction and Analysis

Documentation Coverage Continuous integration - ARTENOLIS
coverage status linux macOS windows10

COBRA.jl is a package written in Julia used to perform COBRA analyses such as Flux Balance Anlysis (FBA), Flux Variability Anlysis (FVA), or any of its associated variants such as distributedFBA [1].

FBA and FVA rely on the solution of LP problems. The package can be used with ease when the LP problem is defined in a .mat file according to the format outlined in the COBRA Toolbox [2].

Installation of COBRA.jl

If you are new to Julia, you may find the Beginner's Guide interesting. A working installation of Julia is required.

At the Julia prompt, add the COBRA package:

julia> Pkg.add("COBRA")

Use the COBRA.jl module by running:

julia> using COBRA

COBRA.jl has been tested on Julia v0.5+ on Ubuntu Linux 14.04+, MacOS 10.7+, and Windows 7 (64-bit). All solvers supported by MathProgBase.jl are supported by COBRA.jl, but must be installed separately. A COBRA model saved as a .mat file can be read in using MAT.jl. MathProgBase.jl and MAT.jl are automatically installed during the installation of the COBRA.jl package.

Tutorial, documentation and FAQ

The comprehensive tutorials are based on interactive Jupyter notebooks.

The COBRA.jl package is fully documented here. You may also display the documentation in the Julia REPL:

julia> ? distributedFBA

๐Ÿ’ก Should you encounter any errors or unusual behavior, please refer first to the FAQ section or open an issue.

Testing and benchmarking

You can test the package using:

julia> Pkg.test("COBRA")

Shall no solvers be detected on your system, error messages may be thrown when testing the COBRA.jl package.

The code has been benchmarked against the fastFVA implementation [3]. A test model ecoli_core_model.mat [4] can be used to pre-compile the code and can be downloaded using

julia> using HTTP, COBRA
julia> pkgDir = joinpath(dirname(pathof(COBRA)), "..")
julia> include(pkgDir*"/test/getTestModel.jl")
julia> getTestModel()

How to cite distributedFBA.jl?

The corresponding paper can be downloaded from here. You may cite distributedFBA.jl as follows:

Laurent Heirendt, Ines Thiele, Ronan M. T. Fleming; DistributedFBA.jl: high-level, high-performance flux balance analysis in Julia. Bioinformatics 2017 btw838. doi: 10.1093/bioinformatics/btw838

Limitations

  • At present, a COBRA model in .mat format is loaded using the MAT.jl package. A valid MATLAB license is not required.
  • The inner layer parallelization is currently done within the solver. No log files of each spawned thread are generated.
  • The current benchmarks have been performed using default optimization and compilation options of Julia and a set of solver parameters. The performance may be further improved by tuning these parameters.

References

  1. B. O. Palsson., Systems Biology: Constraint-based Reconstruction and Analysis. Cambridge University Press, NY, 2015.
  2. Heirendt, L. and Arreckx, S. et al., Creation and analysis of biochemical constraint-based models: the COBRA Toolbox v3.0 (submitted), 2017, arXiv:1710.04038.
  3. Steinn, G. et al., Computationally efficient flux variability analysis. BMC Bioinformatics, 11(1):1โ€“3, 2010.
  4. Orth, J. et al., Reconstruction and use of microbial metabolic networks: the core escherichia coli metabolic model as an educational guide. EcoSal Plus, 2010.

cobra.jl's People

Contributors

farzanfarahani24 avatar femtocleaner[bot] avatar fh96 avatar github-actions[bot] avatar imanghd avatar jdesbonnet avatar juliatagbot avatar laurentheirendt avatar leejm516 avatar mtefagh avatar qacwnfq avatar rmtfleming avatar staticfloat avatar syarra avatar tkelman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cobra.jl's Issues

how to update WinRPM in julia version 0.6.4

I'm new to Julia and I want to use COBRA Package. For adding COBRA I use the command :

Pkg.add("COBRA")
But when running, I get these errors:

INFO: Building WinRPM

WARNING: skipping repodata/repomd.xml, not in cache -- call WinRPM.update() to download

WARNING: skipping repodata/repomd.xml, not in cache -- call WinRPM.update() to download

INFO: Downloading https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml

WARNING: Unknown download failure, error code: 2148270086

WARNING: Retry 1/5 downloading: https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml

until:

WARNING: Unknown download failure, error code: 2148270086

WARNING: Retry 5/5 downloading: https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml

WARNING: received error 0 while downloading https://cache.julialang.org/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2/repodata/repomd.xml

After these errors, I have checked the link and I've found out the source is not there, anymore. So then I ran this command as said above:

WinRPM.update()
But it has thrown this error:

ERROR: UndefVarError: WinRPM not defined

I'm using version 0.6.4 (Windows 10).
Any help would be appreciated.

add option to suppress messages

distributedFBA prints some informative messages:

image

It would be nice if we were able to disable these messages. Sometimes you want to run FBA inside a script and parse the output for other purposes. These messages are then in the way.

Info about upcoming removal of packages in the General registry

As described in https://discourse.julialang.org/t/ann-plans-for-removing-packages-that-do-not-yet-support-1-0-from-the-general-registry/ we are planning on removing packages that do not support 1.0 from the General registry. This package has been detected to not support 1.0 and is thus slated to be removed. The removal of packages from the registry will happen approximately a month after this issue is open.

To transition to the new Pkg system using Project.toml, see https://github.com/JuliaRegistries/Registrator.jl#transitioning-from-require-to-projecttoml.
To then tag a new version of the package, see https://github.com/JuliaRegistries/Registrator.jl#via-the-github-app.

If you believe this package has erroneously been detected as not supporting 1.0 or have any other questions, don't hesitate to discuss it here or in the thread linked at the top of this post.

COBRA cannot be used in v0.7

I'm using COBRA.jl in julia v0.7.0 on macos 10.13.6.
These are error messages:

julia> using COBRA
[ Info: Precompiling COBRA [58298e0b-d05c-52ec-a210-0694647ebfc7]
โ”Œ Warning: Deprecated syntax multiple line breaks between doc string and object at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/COBRA.jl:19.
โ”‚ Use at most one line break instead.
โ”” @ ~/.julia/packages/COBRA/nAHE8/src/COBRA.jl:19
โ”Œ Warning: Deprecated syntax multiple line breaks between doc string and object at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/checkSetup.jl:32.
โ”‚ Use at most one line break instead.
โ”” @ ~/.julia/packages/COBRA/nAHE8/src/checkSetup.jl:32
โ”Œ Warning: Deprecated syntax multiple line breaks between doc string and object at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/checkSetup.jl:68.
โ”‚ Use at most one line break instead.
โ”” @ ~/.julia/packages/COBRA/nAHE8/src/checkSetup.jl:68
โ”Œ Warning: Deprecated syntax multiple line breaks between doc string and object at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/load.jl:25.
โ”‚ Use at most one line break instead.
โ”” @ ~/.julia/packages/COBRA/nAHE8/src/load.jl:25
โ”Œ Warning: Deprecated syntax type at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/load.jl:25.
โ”‚ Use mutable struct instead.
โ”” @ ~/.julia/packages/COBRA/nAHE8/src/load.jl:25
โ”Œ Warning: Deprecated syntax multiple line breaks between doc string and object at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/load.jl:77.
โ”‚ Use at most one line break instead.
โ”” @ ~/.julia/packages/COBRA/nAHE8/src/load.jl:77
WARNING: importing deprecated binding Base.SparseMatrixCSC into COBRA.
WARNING: Base.SparseMatrixCSC is deprecated, run using SparseArrays to load sparse array functionality
likely near /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/load.jl:9
WARNING: Base.SparseMatrixCSC is deprecated, run using SparseArrays to load sparse array functionality
likely near /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/load.jl:9
WARNING: Base.SparseMatrixCSC is deprecated, run using SparseArrays to load sparse array functionality
likely near /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/load.jl:9
โ”Œ Warning: Deprecated syntax multiple line breaks between doc string and object at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/solve.jl:19.
โ”‚ Use at most one line break instead.
โ”” @ ~/.julia/packages/COBRA/nAHE8/src/solve.jl:19
โ”Œ Warning: Deprecated syntax type at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/solve.jl:19.
โ”‚ Use mutable struct instead.
โ”” @ ~/.julia/packages/COBRA/nAHE8/src/solve.jl:19
โ”Œ Warning: Deprecated syntax multiple line breaks between doc string and object at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/solve.jl:49.
โ”‚ Use at most one line break instead.
โ”” @ ~/.julia/packages/COBRA/nAHE8/src/solve.jl:49
โ”Œ Warning: Deprecated syntax multiple line breaks between doc string and object at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/solve.jl:94.
โ”‚ Use at most one line break instead.
โ”” @ ~/.julia/packages/COBRA/nAHE8/src/solve.jl:94
โ”Œ Warning: Deprecated syntax multiple line breaks between doc string and object at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/solve.jl:188.
โ”‚ Use at most one line break instead.
โ”” @ ~/.julia/packages/COBRA/nAHE8/src/solve.jl:188
โ”Œ Warning: Deprecated syntax multiple line breaks between doc string and object at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/solve.jl:236.
โ”‚ Use at most one line break instead.
โ”” @ ~/.julia/packages/COBRA/nAHE8/src/solve.jl:236
โ”Œ Warning: Deprecated syntax multiple line breaks between doc string and object at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/distributedFBA.jl:48.
โ”‚ Use at most one line break instead.
โ”” @ ~/.julia/packages/COBRA/nAHE8/src/distributedFBA.jl:48
โ”Œ Warning: Deprecated syntax multiple line breaks between doc string and object at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/distributedFBA.jl:160.
โ”‚ Use at most one line break instead.
โ”” @ ~/.julia/packages/COBRA/nAHE8/src/distributedFBA.jl:160
โ”Œ Warning: Deprecated syntax multiple line breaks between doc string and object at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/distributedFBA.jl:332.
โ”‚ Use at most one line break instead.
โ”” @ ~/.julia/packages/COBRA/nAHE8/src/distributedFBA.jl:332
โ”Œ Warning: Deprecated syntax multiple line breaks between doc string and object at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/distributedFBA.jl:507.
โ”‚ Use at most one line break instead.
โ”” @ ~/.julia/packages/COBRA/nAHE8/src/distributedFBA.jl:507
ERROR: LoadError: LoadError: syntax: invalid escape sequence
Stacktrace:
[1] include at ./boot.jl:317 [inlined]
[2] include_relative(::Module, ::String) at ./loading.jl:1038
[3] include at ./sysimg.jl:29 [inlined]
[4] include(::String) at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/COBRA.jl:19
[5] top-level scope at none:0
[6] include at ./boot.jl:317 [inlined]
[7] include_relative(::Module, ::String) at ./loading.jl:1038
[8] include(::Module, ::String) at ./sysimg.jl:29
[9] top-level scope at none:2
[10] eval at ./boot.jl:319 [inlined]
[11] eval(::Expr) at ./client.jl:399
[12] top-level scope at ./none:3
in expression starting at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/distributedFBA.jl:608
in expression starting at /Users/kousaka_tomoyuki/.julia/packages/COBRA/nAHE8/src/COBRA.jl:30
ERROR: Failed to precompile COBRA [58298e0b-d05c-52ec-a210-0694647ebfc7] to /Users/kousaka_tomoyuki/.julia/compiled/v0.7/COBRA/ChOhi.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] macro expansion at ./logging.jl:313 [inlined]
[3] compilecache(::Base.PkgId, ::String) at ./loading.jl:1185
[4] macro expansion at ./logging.jl:311 [inlined]
[5] _require(::Base.PkgId) at ./loading.jl:941
[6] require(::Base.PkgId) at ./loading.jl:852
[7] macro expansion at ./logging.jl:311 [inlined]
[8] require(::Module, ::Symbol) at ./loading.jl:834

How to use the C matrix with Julia

Hello, when I used the new version of COBRA Toolbox to generate the personalized community model, the C matrix replaced the original A matrix. When I tried to calculate the metabolic flux of C matrix with Julia, the code reported an error, which showed that there was no C matrix in the model. I wonder if the error was caused by the change of the internal structure of the model. Can Julia calculate C matrix now?

ERROR: LoadError: Matrix 'C' dose not exist in 'microbiota_model'.

Julia systems biology file parsers

Hey, following up from JuliaCon. I am interested in using SBML files to generate differential equation models, and it seems like you might have the tools for at least parsing these files. Could we collaborate on getting a separate package for these? It sounds like it exists in Python, so could there be an easy package via PyCall that wraps the parser functionality? I think this would be generally useful to the Julia community.

New .mat file in test script is causing script to fail

Ref pull request #80 merged to master branch in around 2020-09-07

The new ecoli model at
http://bigg.ucsd.edu/static/models/e_coli_core.mat (size 114736) is causing test script to fail.

The older URL
https://github.com/opencobra/COBRA.models/raw/master/mat/ecoli_core_model.mat does work but is a considerably smaller file of 8818 bytes)

URL is specified in file test/getTestModel.jl

To replicate error from command line on king.nuigalway.ie, create an empty directory and 'cd' into it. Then:

git clone https://github.com/opencobra/COBRA.jl 
cd COBRA.jl
/home/vmhadmin/julia-1.2.0/bin/julia --color=yes -e 'import Pkg; Pkg.clone(pwd()); Pkg.test("COBRA", coverage=true); Pkg.rm("COBRA");'

Error text:

Running s_all.jl ...

[ Info: The ecoli_core model already exists.
ERROR: LoadError: LoadError: The variable named `model` does not exist. Please set `model` to a known variable in the `.mat` file.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] loadModel(::String, ::String, ::Int64) at /home/vmhadmin/tmp/t/COBRA.jl/src/load.jl:220
 [3] loadModel at /home/vmhadmin/tmp/t/COBRA.jl/src/load.jl:226 [inlined] (repeats 3 times)
 [4] top-level scope at /home/vmhadmin/tmp/t/COBRA.jl/test/s_all.jl:48
 [5] include at ./boot.jl:328 [inlined]
 [6] include_relative(::Module, ::String) at ./loading.jl:1094
 [7] include(::Module, ::String) at ./Base.jl:31
 [8] include(::String) at ./client.jl:431
 [9] top-level scope at /home/vmhadmin/tmp/t/COBRA.jl/test/runtests.jl:133
 [10] include at ./boot.jl:328 [inlined]
 [11] include_relative(::Module, ::String) at ./loading.jl:1094
 [12] include(::Module, ::String) at ./Base.jl:31
 [13] include(::String) at ./client.jl:431
 [14] top-level scope at none:5
in expression starting at /home/vmhadmin/tmp/t/COBRA.jl/test/s_all.jl:48
in expression starting at /home/vmhadmin/tmp/t/COBRA.jl/test/runtests.jl:118
ERROR: Package COBRA errored during testing
Stacktrace:
 [1] pkgerror(::String, ::Vararg{String,N} where N) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Pkg/src/Types.jl:112
 [2] #test#119(::Bool, ::Nothing, ::typeof(Pkg.Operations.test), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Pkg/src/Operations.jl:1288
 [3] #test at ./none:0 [inlined]
 [4] #test#62(::Bool, ::Nothing, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Pkg.API.test), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Pkg/src/API.jl:245
 [5] #test at ./none:0 [inlined]
 [6] #test#61 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Pkg/src/API.jl:230 [inlined]
 [7] #test at ./none:0 [inlined]
 [8] #test#60 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Pkg/src/API.jl:229 [inlined]
 [9] #test at ./none:0 [inlined]
 [10] #test#59(::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:coverage,),Tuple{Bool}}}, ::typeof(Pkg.API.test), ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Pkg/src/API.jl:228
 [11] (::getfield(Pkg.API, Symbol("#kw##test")))(::NamedTuple{(:coverage,),Tuple{Bool}}, ::typeof(Pkg.API.test), ::String) at ./none:0
 [12] top-level scope at none:1

Empty tutorial

Is this package still actively maintained? In the tutorials for COBRA, all I see are installation instructions and not any explanations to run a model.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Trying to run doubleGeneDeeletion script on PALM.jl

I have only both the model.mat and KO script 'Macrophage_KO.m' in the test directory.

PALM(modelDir, "$(joinpath(dirname(pathof(COBRA)), "../test/Macrophage_KO.m"))",
nMatlab=nWorkers, outputFile="modelCharacteristics.mat",
varsCharact=varsCharact, cobraToolboxDir=installDir)

but I am getting this error:

Every worker will run 17 model(s).
Load sharing is ideal.

-- Load distribution --

  • Number of models: 17

  • Number of workers: 1

  • True load (models/worker): 17.0

  • Realistic load (quotient): 17

  • Remaining load (remainder): 0

โ”Œ Info: Directory with 17 models read successfully.
โ”” @ COBRA
~/COBRA.jl/src/PALM.jl:247

The poolsize is equal to 1. PALM.jl is meant to be used in parallel, not serial or sequential.

Stacktrace:
[1] error(::String) at ./error.jl:33
[2] PALM(::String, ::String; nMatlab::Int64, outputFile::String, varsCharact::Array{String,1}, cobraToolboxDir::String, printLevel::Int64, useCOBRA::Bool) at ~/COBRA.jl/src/PALM.jl:257
[3] top-level scope at In[122]:1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.