API
ReactionNetworkImporters.BNGNetwork — Type
BNGNetwork()File-format selector for BioNetGen .net reaction network files.
Arguments
None.
Keywords
None.
Fields
None.
Pass BNGNetwork() to loadrxnetwork to parse a BioNetGen .net file into a Catalyst ReactionSystem.
Examples
using ReactionNetworkImporters
BNGNetwork() isa ReactionNetworkImporters.NetworkFileFormat
# output
trueReactionNetworkImporters.MatrixNetwork — Type
MatrixNetwork(rateexprs, substoich, prodstoich; species = Any[], params = Any[], t = nothing)Input representation for constructing a Catalyst reaction network from substrate and product stoichiometry matrices.
Arguments
rateexprs::AbstractVector: One symbolic or numeric rate expression per reaction.substoich::AbstractMatrix: Species-by-reaction substrate coefficients.prodstoich::AbstractMatrix{Int}: Species-by-reaction product coefficients; it must have the same size assubstoich.
Keywords
species::AbstractVector = Any[]: Symbolic species in row order. Empty uses generated species with the chosen independent variable.params::AbstractVector = Any[]: Symbolic parameters referenced byrateexprs.t = nothing: Independent variable.nothingusesCatalyst.default_t().
Fields
rateexprs: Rate expressions, one for each reaction column.substoich: Substrate stoichiometry matrix.prodstoich: Product stoichiometry matrix.species: Symbolic species in matrix-row order.params: Symbolic parameters available to rate expressions.t: Independent variable ornothing.
Examples
using ReactionNetworkImporters
network = MatrixNetwork([1.0], reshape([1], 1, 1), reshape([0], 1, 1))
network isa MatrixNetwork
# output
trueReactionNetworkImporters.ComplexMatrixNetwork — Type
ComplexMatrixNetwork(rateexprs, stoichmat, incidencemat; species = Any[], params = Any[], t = nothing)Input representation for constructing a Catalyst reaction network from complex stoichiometry and complex-incidence matrices.
Arguments
rateexprs::AbstractVector: One symbolic or numeric rate expression per reaction.stoichmat::AbstractMatrix: Species-by-complex nonnegative stoichiometric coefficients.incidencemat::AbstractMatrix{Int}: Complex-by-reaction matrix whose entries are-1,0, or1.
Keywords
species::AbstractVector = Any[]: Symbolic species in row order. Empty uses generated species with the chosen independent variable.params::AbstractVector = Any[]: Symbolic parameters referenced byrateexprs.t = nothing: Independent variable.nothingusesCatalyst.default_t().
Fields
rateexprs: Rate expressions, one for each reaction column.stoichmat: Species-by-complex stoichiometry matrix.incidencemat: Complex-by-reaction incidence matrix.species: Symbolic species in matrix-row order.params: Symbolic parameters available to rate expressions.t: Independent variable ornothing.
Examples
using ReactionNetworkImporters
network = ComplexMatrixNetwork([1.0], [1 0], reshape([-1, 1], 2, 1))
network isa ComplexMatrixNetwork
# output
trueReactionNetworkImporters.loadrxnetwork — Function
loadrxnetwork(ft::BNGNetwork, rxfilename; name = gensym(:ReactionSystem), verbose = true, kwargs...)Parse a BioNetGen .net file and construct a Catalyst ReactionSystem.
Arguments
ft::BNGNetwork: Selector for the BioNetGen.netformat.rxfilename::AbstractString: Path to the network file.
Keywords
name::Symbol = gensym(:ReactionSystem): Name assigned to the returned system.verbose::Bool = true: Print parser progress whentrue.kwargs...: Additional keywords forwarded toReactionSystem.
Returns
ReactionSystem: Incomplete Catalyst system. Its metadata contains initial conditions, parameter values, BNG variable names, and BNG group observables.
Rules
- Supports parameter expressions, fixed species, compartment-prefixed species, elementary and
Satrate laws, function blocks, and groups. MM,Hill, andtfun()constructs are unsupported and throw an error.- Call
completeon the returned system before constructing a SciML problem.
Examples
using ReactionNetworkImporters
format = BNGNetwork()
format isa ReactionNetworkImporters.NetworkFileFormat
# output
trueloadrxnetwork(mn::MatrixNetwork; name = gensym(:ReactionSystem))Convert a MatrixNetwork into a Catalyst ReactionSystem.
Arguments
mn::MatrixNetwork: Input matrix representation satisfyingMatrixNetwork's dimensionality rules.
Keywords
name::Symbol = gensym(:ReactionSystem): Name assigned to the resulting system.
Returns
ReactionSystem: An incomplete Catalyst system. Callcompletebefore using it to construct a SciML problem.
Rules
substoichandprodstoichmust be species-by-reaction matrices of equal size.- Each rate expression corresponds to one reaction column.
- An empty
speciesvector requests generated species symbols.
Examples
using ReactionNetworkImporters
network = MatrixNetwork([1.0], reshape([1], 1, 1), reshape([0], 1, 1))
system = loadrxnetwork(network; name = :decay)
nameof(system)
# output
:decayloadrxnetwork(cmn::ComplexMatrixNetwork; name = gensym(:ReactionSystem))Convert a ComplexMatrixNetwork into a Catalyst ReactionSystem.
Arguments
cmn::ComplexMatrixNetwork: Complex-matrix representation satisfying the documented stoichiometry and incidence rules.
Keywords
name::Symbol = gensym(:ReactionSystem): Name assigned to the resulting system.
Returns
ReactionSystem: An incomplete Catalyst system. Callcompletebefore using it to construct a SciML problem.
Rules
stoichmatis species-by-complex and has nonnegative entries.incidencematis complex-by-reaction with entries in(-1, 0, 1).- Every reaction column needs one substrate complex (
-1) and one product complex (1).
Examples
using ReactionNetworkImporters
network = ComplexMatrixNetwork([1.0], [1 0], reshape([-1, 1], 2, 1))
system = loadrxnetwork(network; name = :conversion)
nameof(system)
# output
:conversionReactionNetworkImporters.VarsToNames — Type
VarsToNamesMetadata key for storing BNG variable-to-full-name mappings on a ReactionSystem. Stores a Dict mapping internal symbolic variables (both dynamic species and constant-species parameters) to their full BNG name strings from the .net file.
Fields
None. This fieldless type is used as a metadata key.
See also: has_varstonames, get_varstonames, set_varstonames
ReactionNetworkImporters.GroupsToSyms — Type
GroupsToSymsMetadata key for storing BNG group-name-to-symbol mappings on a ReactionSystem. Stores a Dict mapping String group names to corresponding symbolic observable variables.
Fields
None. This fieldless type is used as a metadata key.
See also: has_groupstosyms, get_groupstosyms, set_groupstosyms
ReactionNetworkImporters.has_varstonames — Function
has_varstonames(rs::ReactionSystem)Return whether rs has a VarsToNames metadata entry.
Arguments
rs::ReactionSystem: System to inspect.
Returns
Bool:truewhen the mapping exists.
ReactionNetworkImporters.get_varstonames — Function
get_varstonames(rs::ReactionSystem)Return the VarsToNames mapping from rs, or nothing when it is absent.
Arguments
rs::ReactionSystem: System to inspect.
Returns
Dictornothing: Mapping from system variables to BioNetGen names.
ReactionNetworkImporters.set_varstonames — Function
set_varstonames(rs::ReactionSystem, m)Return a new ReactionSystem with the VarsToNames metadata set to m.
Arguments
rs::ReactionSystem: System to update.m: Mapping from system variables to BioNetGen names.
Returns
ReactionSystem: Copy ofrscarryingm;rsis not mutated.
ReactionNetworkImporters.has_groupstosyms — Function
has_groupstosyms(rs::ReactionSystem)Return whether rs has a GroupsToSyms metadata entry.
Arguments
rs::ReactionSystem: System to inspect.
Returns
Bool:truewhen the mapping exists.
ReactionNetworkImporters.get_groupstosyms — Function
get_groupstosyms(rs::ReactionSystem)Return the GroupsToSyms mapping from rs, or nothing when it is absent.
Arguments
rs::ReactionSystem: System to inspect.
Returns
Dictornothing: Mapping from BioNetGen group names to observables.
ReactionNetworkImporters.set_groupstosyms — Function
set_groupstosyms(rs::ReactionSystem, m)Return a new ReactionSystem with the GroupsToSyms metadata set to m.
Arguments
rs::ReactionSystem: System to update.m: Mapping from BioNetGen group names to observables.
Returns
ReactionSystem: Copy ofrscarryingm;rsis not mutated.