Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

network_analysis cleanup: Updating ratematrix to be more similar to new matrix API functions #1172

Merged
merged 6 commits into from
Jan 17, 2025

Conversation

vyudu
Copy link
Collaborator

@vyudu vyudu commented Jan 10, 2025

src/network_analysis.jl Show resolved Hide resolved
src/network_analysis.jl Outdated Show resolved Hide resolved
@@ -1069,50 +1038,74 @@ function iscomplexbalanced(rs::ReactionSystem, parametermap)
end

"""
ratematrix(rs::ReactionSystem, parametermap)
adjacencymat(rs::ReactionSystem, pmap = Dict(); sparse = false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this require ismassaction, and if so is that being checked anywhere?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More generally, it would be good if any of these methods that only make sense with fixed rate constants (in the Catalyst sense) return an informative error if they get an invalid system.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have added them. I think fluxmat and adjacencymat should work with reactions with fixed rate constants that aren't necessarily mass action (which is the case for generalized mass action systems e.g., the CatalystNetworkAnalysis stuff does some stuff with that) and the massactionvector should work with just mass action reactions

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, if they should work more generally then the checks aren't needed. I just want to make sure we don't have people using them for systems they aren't intended / expected to work with.

LMK how you want to proceed (I'm fine keeping the checks or dropping them if you feel they aren't actually needed here).

Copy link
Collaborator Author

@vyudu vyudu Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the check currently is good, we do still wanna check that stuff like k*A, A --> B isn't allowed in the adjacencymat/fluxmat since you could no longer use it in the ODE system decomposition if it is time-dependent. But in theory something like k, A --> B that doesn't have mass action kinetics (e.g. the rate law is k*A^2 or something) is fine and constructing the adjacencymat/fluxmat for such a reaction is useful in some cases.

@isaacsas
Copy link
Member

OK, then feel free to merge if you are happy with this.

@vyudu vyudu merged commit 127c49c into SciML:master Jan 17, 2025
13 checks passed
@vyudu vyudu deleted the network-analysis-touchup branch January 17, 2025 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants