Dear all,
first, happy new year 2026 to the community and to the developper of Copasi.
I have a question regarding the basico interface to Copasi (which is a very useful tool). Specifically, I want to
- locate the reaction parameter which is mapped to a certain global quantity
- change the mapping of this reaction parameter to point to another global quantity (which I have previously added with add_parameter.
However, the following code does nothing (inp is the name of the initial global quantity, to be replaced by mod_inp
inp='basal_mbmal'
mod_inp = inp+'_mod'
...
rpall = get_reaction_parameters()
print(rpall)
rr=rpall.loc[rpall['mapped_to'] == inp] # find the row which is mapped to inp
param_name = rr.index[0] # find the corresponding reaction parameter name
print("Mapping %s to global %s instead of %s" % (param_name,mod_inp,inp))
set_reaction_parameters(name=param_name,mapped_to=mod_inp)
print(get_reaction_parameters())
...
with output (only keeping the relevant part of the 3 print statements)
…
(synthesis_bmal).basal 0.821282 synthesis_bmal global basal_mbmal
…
Mapping (synthesis_bmal).basal to global basal_mbmal_mod instead of basal_mbmal
…
(synthesis_bmal).basal 0.821282 synthesis_bmal global basal_mbmal
As you can see, the mapping was not changed. So what is wrong in the set_reaction_parameters statement ?
Thank you in advance,
best regards,
Marc