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

How to modify k_forward after model built? #283

Open
wupeng1998 opened this issue Sep 26, 2024 · 2 comments
Open

How to modify k_forward after model built? #283

wupeng1998 opened this issue Sep 26, 2024 · 2 comments

Comments

@wupeng1998
Copy link

I tried to use the code to build model:
Combine_PURE=ChemicalReactionNetwork(species = flatten([CRN_TX.species, CRN_TL.species, gfp_species,degraded_species]), reactions = flatten([CRN_TX.reactions, CRN_TL.reactions, Rxn_folding, Rxn_mRNA_degraded, Rxn_protein_degraded]))

After the model is built, i try to modify the k_forward value, such as

Combine_PURE.reactions[0].propensity_type.propensity_dict['parameters']['k_forward'] = 10 or Combine_PURE.reactions[0].propensity_type.k_forward = 10,

but all the attempted updates have not changed. Can the k_forward value only be initialized when the model is built?

@ayush9pandey
Copy link
Collaborator

Hi @wupeng1998

To update a parameter, you'd need to change its value and then recompile the CRN for the change to show up in the model. Various ways in which you might change the parameters is described here: https://github.com/BuildACell/bioCRNpyler/blob/master/examples/5.%20Parameters.ipynb

For quicker turnarounds with changing parameter values, you could use your preferred SBML simulator's parameter update functions after building the CRN structure with BioCRNpyler and saving it as SBML.

@wupeng1998
Copy link
Author

okay,thanks,i will try it

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

No branches or pull requests

2 participants