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

Warning when reaction is added with metabolites not yet in model #797

Closed
HettieC opened this issue Oct 26, 2023 · 2 comments
Closed

Warning when reaction is added with metabolites not yet in model #797

HettieC opened this issue Oct 26, 2023 · 2 comments
Labels
minor Easy fix with low priority, likely just cosmetic quality improves maintainability and code clarity
Milestone

Comments

@HettieC
Copy link
Contributor

HettieC commented Oct 26, 2023

When adding reactions to a model, currently cobrexa allows you to add them if the metabolites used are not present in the model and only throws an error when you later try to do something with the model. The error also only mentions one metabolite that is not present, instead of listing them

E.g.

using COBREXA
model = StandardModel("")
add_reaction!(
    model,
    Reaction("R";
    metabolites = Dict(
        "m1" => -1,
        "m2" => 1
        )
    )
)
display(model)

Gives the error:

ERROR: DomainError with m2:
Metabolite m2 not found in model but occurs in stoichiometry of R

It would be nice if when calling add_reaction! an error was thrown if any metabolites are not already in the model, or if when calling display(model) a list of the missing metabolites was given instead of just one.

@exaexa
Copy link
Collaborator

exaexa commented Oct 26, 2023

Hi! I actually assume this is the intended behavior -- the checking is actually quite costly. I agree this is not very user-friendly; we might want to do something about this later.

@exaexa exaexa added quality improves maintainability and code clarity minor Easy fix with low priority, likely just cosmetic labels Oct 26, 2023
@exaexa exaexa added this to the Wishlist milestone Dec 9, 2023
@exaexa
Copy link
Collaborator

exaexa commented May 14, 2024

deprecated by AbstractFBCModels interface

@exaexa exaexa closed this as completed May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Easy fix with low priority, likely just cosmetic quality improves maintainability and code clarity
Projects
None yet
Development

No branches or pull requests

2 participants