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

convenient way to handle parameters during reaction building #213

Open
zoltuz opened this issue Dec 18, 2020 · 1 comment
Open

convenient way to handle parameters during reaction building #213

zoltuz opened this issue Dec 18, 2020 · 1 comment
Milestone

Comments

@zoltuz
Copy link
Member

zoltuz commented Dec 18, 2020

It would be nice to have a get_parameters() (or similar) function that accepts a list of parameter strings (with the same part_id, and mechanism) and returns a dictionary of parameters.

p =  component.get_parameters(['ktl','kb','ku','length'], part_id = part_id, mechanism = self)

#RNAP DNA Binding
r1 = Reaction.from_massaction([transcript, self.ribosome], [bound_complex], k_forward = p.kb, k_reverse = p.ku)
#Transcription
r2 = Reaction.from_massaction(self.fuels + [bound_complex], self.fuels + [transcript, self.ribosome, protein],
    k_forward = parameter_to_value(p.ktl.value)/parameter_to_value(p.length))
#Fuel consumption
r3 = Reaction.from_massaction(self.fuels + [bound_complex], [bound_complex]+self.wastes, k_forward = p.ktl)

Orignal code

ktl =  component.get_parameter("ktl", part_id = part_id, mechanism = self)
kb = component.get_parameter("kb", part_id = part_id, mechanism = self)
ku = component.get_parameter("ku", part_id = part_id, mechanism = self)
L = component.get_parameter("length", part_id = part_id, mechanism = self)

#RNAP DNA Binding
r1 = Reaction.from_massaction([transcript, self.ribosome], [bound_complex], k_forward = kb, k_reverse = ku)
#Transcription
r2 = Reaction.from_massaction(self.fuels + [bound_complex], self.fuels + [transcript, self.ribosome, protein],
    k_forward = parameter_to_value(ktl.value)/parameter_to_value(L))
#Fuel consumption
r3 = Reaction.from_massaction(self.fuels + [bound_complex], [bound_complex]+self.wastes, k_forward = ktl)
@zoltuz zoltuz added this to the Low Priority milestone Dec 18, 2020
@WilliamIX
Copy link
Collaborator

yeah that is a nice feature. Will definitely add it to a future update!

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