From 839c7e6183ea6c02778747825c091802e0fd6c72 Mon Sep 17 00:00:00 2001 From: "St. Elmo Wilken" Date: Fri, 5 Aug 2022 10:15:04 +0200 Subject: [PATCH 1/5] remove banner --- src/COBREXA.jl | 2 -- src/banner.jl | 32 -------------------------------- 2 files changed, 34 deletions(-) delete mode 100644 src/banner.jl diff --git a/src/COBREXA.jl b/src/COBREXA.jl index c84c4acad..c8a0e220e 100644 --- a/src/COBREXA.jl +++ b/src/COBREXA.jl @@ -19,8 +19,6 @@ import Base: findfirst, getindex, show import Pkg import SBML # conflict with Reaction struct name -include("banner.jl") - # autoloading const _inc(path...) = include(joinpath(path...)) const _inc_all(dir) = _inc.(joinpath.(dir, filter(fn -> endswith(fn, ".jl"), readdir(dir)))) diff --git a/src/banner.jl b/src/banner.jl deleted file mode 100644 index 00f62a550..000000000 --- a/src/banner.jl +++ /dev/null @@ -1,32 +0,0 @@ -const _PKG_ROOT_DIR = normpath(joinpath(@__DIR__, "..")) -include_dependency(joinpath(_PKG_ROOT_DIR, "Project.toml")) - -const COBREXA_VERSION = - VersionNumber(Pkg.TOML.parsefile(joinpath(_PKG_ROOT_DIR, "Project.toml"))["version"]) - -function __init__() - if myid() == 1 && Base.JLOptions().banner != 0 - _print_banner() - end -end - -function _print_banner() - c = Base.text_colors - n = c[:normal] - y = c[:bold] * c[:cyan] - - println( - " - $(y)//$(n) | - \\\\\\\\\\ // $(y)//$(n) | $(c[:bold])COBREXA.jl $(c[:normal]) v$(COBREXA_VERSION) - \\\\ \\\\// $(y)//$(n) | - \\\\ \\/ $(y)//$(n) | $(c[:bold])CO$(c[:normal])nstraint-$(c[:bold])B$(c[:normal])ased $(c[:bold])R$(c[:normal])econstruction - \\\\ $(y)//$(n) | and $(c[:bold])EX$(c[:normal])ascale $(c[:bold])A$(c[:normal])nalysis in Julia - // $(y)\\\\$(n) | - // $(y)/\\ \\\\$(n) | See documentation and examples at: - // $(y)//\\\\ \\\\$(n) | https://lcsb-biocore.github.io/COBREXA.jl - // $(y)// \\\\\\\\\\$(n) | - // | - ", - ) -end From 503401b37bd8340508986fe2badffb263fa082b1 Mon Sep 17 00:00:00 2001 From: "St. Elmo Wilken" Date: Fri, 2 Sep 2022 11:53:44 +0200 Subject: [PATCH 2/5] add banner to module docstring --- src/COBREXA.jl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/COBREXA.jl b/src/COBREXA.jl index c8a0e220e..92e0e3d39 100644 --- a/src/COBREXA.jl +++ b/src/COBREXA.jl @@ -1,3 +1,12 @@ +""" +COBREXA.jl v$(VersionNumber(Pkg.TOML.parsefile(joinpath(normpath(joinpath(@__DIR__, "..")), "Project.toml"))["version"]))\n +\n +COnstraint-Based Reconstruction\n +and EXascale Analysis in Julia\n +\n +See documentation and examples at:\n +https://lcsb-biocore.github.io/COBREXA.jl\n +""" module COBREXA using Distributed @@ -19,6 +28,8 @@ import Base: findfirst, getindex, show import Pkg import SBML # conflict with Reaction struct name +include_dependency(joinpath(normpath(joinpath(@__DIR__, "..")), "Project.toml")) + # autoloading const _inc(path...) = include(joinpath(path...)) const _inc_all(dir) = _inc.(joinpath.(dir, filter(fn -> endswith(fn, ".jl"), readdir(dir)))) From afdda2f20c68fa2cdaf150f711777a3d96c0cdd7 Mon Sep 17 00:00:00 2001 From: "St. Elmo Wilken" Date: Fri, 2 Sep 2022 11:54:25 +0200 Subject: [PATCH 3/5] fix alignment --- src/COBREXA.jl | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/COBREXA.jl b/src/COBREXA.jl index 92e0e3d39..24b13444e 100644 --- a/src/COBREXA.jl +++ b/src/COBREXA.jl @@ -1,11 +1,14 @@ """ -COBREXA.jl v$(VersionNumber(Pkg.TOML.parsefile(joinpath(normpath(joinpath(@__DIR__, "..")), "Project.toml"))["version"]))\n -\n -COnstraint-Based Reconstruction\n -and EXascale Analysis in Julia\n -\n -See documentation and examples at:\n -https://lcsb-biocore.github.io/COBREXA.jl\n +``` +\\\\\\\\\\ // // | COBREXA.jl v$(VersionNumber(Pkg.TOML.parsefile(joinpath(normpath(joinpath(@__DIR__, "..")), "Project.toml"))["version"])) + \\\\ \\\\// // | + \\\\ \\/ // | COnstraint-Based Reconstruction + \\\\ // | and EXascale Analysis in Julia + // \\\\ | + // /\\ \\\\ | See documentation and examples at: + // //\\\\ \\\\ | https://lcsb-biocore.github.io/COBREXA.jl +// // \\\\\\\\\\ | +``` """ module COBREXA From f138fe6e049ae27b0cf13dc176183ff7f65f5cdf Mon Sep 17 00:00:00 2001 From: "St. Elmo Wilken" Date: Fri, 2 Sep 2022 12:17:49 +0200 Subject: [PATCH 4/5] add back some consts and make docstring nicer --- src/COBREXA.jl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/COBREXA.jl b/src/COBREXA.jl index 24b13444e..b83340bf2 100644 --- a/src/COBREXA.jl +++ b/src/COBREXA.jl @@ -9,6 +9,17 @@ // //\\\\ \\\\ | https://lcsb-biocore.github.io/COBREXA.jl // // \\\\\\\\\\ | ``` +To perform flux balance analysis using COBREXA, try: +``` +using COBREXA, Clarabel + +model = load_model(StandardModel, "path_to_model") + +fba_dict = flux_balance_analysis_dict(model, Clarabel.Optimizer) + +flux_summary(flux_dict) +``` +More examples can be found in the documentation. """ module COBREXA @@ -31,7 +42,11 @@ import Base: findfirst, getindex, show import Pkg import SBML # conflict with Reaction struct name -include_dependency(joinpath(normpath(joinpath(@__DIR__, "..")), "Project.toml")) +const _PKG_ROOT_DIR = normpath(joinpath(@__DIR__, "..")) +include_dependency(joinpath(_PKG_ROOT_DIR, "Project.toml")) + +const COBREXA_VERSION = + VersionNumber(Pkg.TOML.parsefile(joinpath(_PKG_ROOT_DIR, "Project.toml"))["version"]) # autoloading const _inc(path...) = include(joinpath(path...)) From 6aaa6bb90bb2776196e1f2c033b1e7d0d85cb991 Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Fri, 2 Sep 2022 16:03:35 +0200 Subject: [PATCH 5/5] tune up the ?COBREXA docstring --- src/COBREXA.jl | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/COBREXA.jl b/src/COBREXA.jl index b83340bf2..43b1576ef 100644 --- a/src/COBREXA.jl +++ b/src/COBREXA.jl @@ -1,6 +1,6 @@ """ ``` -\\\\\\\\\\ // // | COBREXA.jl v$(VersionNumber(Pkg.TOML.parsefile(joinpath(normpath(joinpath(@__DIR__, "..")), "Project.toml"))["version"])) +\\\\\\\\\\ // // | COBREXA.jl v$(COBREXA.COBREXA_VERSION) \\\\ \\\\// // | \\\\ \\/ // | COnstraint-Based Reconstruction \\\\ // | and EXascale Analysis in Julia @@ -9,17 +9,19 @@ // //\\\\ \\\\ | https://lcsb-biocore.github.io/COBREXA.jl // // \\\\\\\\\\ | ``` -To perform flux balance analysis using COBREXA, try: -``` -using COBREXA, Clarabel - -model = load_model(StandardModel, "path_to_model") - -fba_dict = flux_balance_analysis_dict(model, Clarabel.Optimizer) -flux_summary(flux_dict) +To start up quickly, install your favorite optimizer, load a metabolic model in +a format such as SBML or JSON, and run a metabolic analysis such as the flux +balance analysis: ``` -More examples can be found in the documentation. +import Pkg; Pkg.add("GLPK") +using COBREXA, GLPK +model = load_model("e_coli_core.xml") +x = flux_balance_analysis_dict(model, GLPK.Optimizer) +flux_summary(x) +``` + +A complete overview of the functionality can be found in the documentation. """ module COBREXA