From d1cb46bfb8d5c825c7ad95e432b1305e70af255e Mon Sep 17 00:00:00 2001 From: Torkel Date: Sat, 13 Jul 2024 23:10:15 -0400 Subject: [PATCH] up --- src/network_analysis.jl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/network_analysis.jl b/src/network_analysis.jl index ac8321b948..b453be1bc7 100644 --- a/src/network_analysis.jl +++ b/src/network_analysis.jl @@ -478,12 +478,12 @@ end # additional information of the full network, find the reactions, species, and parameters # that constitute the corresponding sub-reaction network. function subnetworkmapping(linkageclass, allrxs, complextorxsmap, p) - # Finds the reactions that are part of teh sub-reaction network. - rxinds = sort!(collect(Set(rxidx for rcidx in linkageclass - for rxidx in complextorxsmap[rcidx]))) - rxs = allrxs[rxinds] - specset = Set(s for rx in rxs for s in rx.substrates if !isconstant(s)) - for rx in rxs + # Finds the reactions that are part of the`` sub-reaction network. + rxinds = sort!(collect(Set( + rxidx for rcidx in linkageclass for rxidx in complextorxsmap[rcidx]))) + newrxs = allrxs[rxinds] + specset = Set(s for rx in newrxs for s in rx.substrates if !isconstant(s)) + for rx in newrxs for product in rx.products !isconstant(product) && push!(specset, product) end @@ -531,7 +531,7 @@ function subnetworks(rs::ReactionSystem) newrxs, newspecs, newps = subnetworkmapping(lcs[i], rxs, complextorxsmap, p) newname = Symbol(nameof(rs), "_", i) push!(subnetworks, - ReactionSystem(reacs, t, specs, newps; name = newname, spatial_ivs)) + ReactionSystem(newrxs, t, newspecs, newps; name = newname, spatial_ivs)) end subnetworks end