Can't remove a custom-made kinetic law using sbioremovefromlibrary

1 回表示 (過去 30 日間)
SimBio_User
SimBio_User 2023 年 4 月 24 日
回答済み: Jeremy Huard 2023 年 4 月 24 日
I am using MATLAB R2022b in case it is relevant.
I am trying to remove a kinetic law that I have added in my user-defined library. I have called it "Uni-Uni MM reversible with e0". I use sbioremovefromlibrary function for such a purpose. However, I only get the following as output:
Warning: Kinetic law named 'Uni-Uni MM reversible with e0' is being used by reaction kinetic
law(s), and cannot be deleted. Type the following command to find kinetic laws using it.
klusedby = sbioselect('Type','kineticlaw','KineticLawName','Uni-Uni MM reversible with e0')
How do I proceed from here? I would also want to change the rate expression instead of removing it from the library. However, I don't know if that is possible

採用された回答

Jeremy Huard
Jeremy Huard 2023 年 4 月 24 日
Hi,
the easiest way to manage the user-defined library might be from within the Model Builder app:
That said, you can still modify a user-defined kinetic law programmatically with:
kl = sbioselect(sbioroot, Name='Uni-Uni MM reversible with e0',Type='abstract_kinetic_law');
kl.Expression = '<edit the expression here>'
If you want to remove an existing user-defined kinetic law programmatically that is already used in a model, you can do the following:
kl = sbioselect(sbioroot, Name='mylaw1',Type='abstract_kinetic_law');
% find reactions in model that use this kinetic law
reacObj = findUsages(kl, modelObj);
% set the kinetic law of these reaction to 'Unknown' but keeping the same reaction rates
% by reassigning the Reaction Rate to itself
arrayfun(@(x) set(x,'ReactionRate',x.Reaction.Rate), reacObj);
% remove kinetic law from library
sbioremovefromlibrary(kl)
Best regards,
Jérémy

その他の回答 (0 件)

コミュニティ

その他の回答  SimBiology コミュニティ

カテゴリ

Help Center および File ExchangeExtend Modeling Environment についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by