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

Record values of other observables #5

Open
4 of 5 tasks
jonrkarr opened this issue Aug 18, 2021 · 2 comments
Open
4 of 5 tasks

Record values of other observables #5

jonrkarr opened this issue Aug 18, 2021 · 2 comments

Comments

@jonrkarr
Copy link
Member

jonrkarr commented Aug 18, 2021

  • Constant species
  • Parameters
  • Species and parameters set via assignment rules
  • Reaction fluxes
  • Compartment sizes
@jmrohwer
Copy link
Contributor

Assignment rules can now be tracked. See PySCeS/pysces#57 (comment). Fixed in latest PySCeS Release (1.0.2).

@jmrohwer
Copy link
Contributor

This continues the discussion from here where certain model outputs are not recorded.

The unrecorded variables are all assignment rules. In fact they are recorded by PySCeS, so it is a wrapper issue. Staying with Biomodels 297. I've had a brief look at the wrapper code. The wrapper records the simulation results here:

results = model.data_sim.getAllSimData(lbls=False)

@luciansmith I have verified that this array contains all the simulation data including the assignment rules, in fact it is the same data as in the model.sim DataFrame (refer here), just presented as a numpy array with or without labels.

It therefore has to do with filtering of the model attributes which as far as I can see happens here:

dynamic_ids = ['Time'] + list(model.species) + list(model.reactions)
fixed_ids = (set(model.parameters) | set(model.__compartments__.keys())).difference(set(model.__rules__.keys()))

The rules are not part dynamic_ids nor fixed_ids as far as I can tell. I know too little about the wrapper implementation in general to be able to tell how this is generally done, or what would need to change for them to be recorded.

The assignment and rate rules are in a dictionary mod.__rules__ where the ID of each rule is the key. For each key (rule) the value is another dictionary with the following keys:

  • name (the SBML ID of the rule, this is the same as the key in the top-level dict)
  • formula
  • type (assignment or rate)
  • symbols (list of symbols in the rule)
  • code string (formula adapted with class references so it can be executed in PySCeS)

Hopefully this will give you sufficient info to track this down further. Unfortunately I don't have time in the coming weeks to work on this myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants