Unverified Commit 7e16b913 authored by St. Elmo's avatar St. Elmo
Browse files

added pretty printing of MetabolicModel

parent 3934d004
......@@ -5,6 +5,7 @@ version = "0.1.0"
[deps]
Clp = "e2554f3b-3117-50c0-817c-e040a3ddf72d"
Crayons = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
DistributedData = "f6a0035f-c5ac-4ad0-b410-ad102ced35df"
......
......@@ -16,7 +16,11 @@ using Measurements
using Statistics
using Random
using MacroTools # for DSL :)
<<<<<<< HEAD
using OrderedCollections
=======
using Crayons
>>>>>>> 8a2e108 (added pretty printing of MetabolicModel)
import Base: findfirst, getindex, show
import Pkg
......
"""
Pretty printing of model::MetabolicModel using generic interface.
"""
function Base.show(io::IO, ::MIME"text/plain", m::MetabolicModel)
println(Crayon(foreground=:cyan), "Metabolic model: [INSERT ID]")
println(Crayon(foreground=:blue), stoichiometry(m))
print(Crayon(foreground=:blue), "Number of reactions: ")
println(Crayon(foreground=:magenta), n_reactions(m))
print(Crayon(foreground=:blue), "Number of metabolites: ")
println(Crayon(foreground=:magenta), n_reactions(m))
print(Crayon(foreground=:blue), "Field names associated with this model include: ")
print(Crayon(foreground=:magenta),join([string(x) for x in fieldnames(typeof(m))], ", "))
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment