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 can a list of possible observable quantities be retrieved from a LEMS file? #103

Closed
jonrkarr opened this issue Jun 8, 2021 · 9 comments
Assignees
Labels
T: enhancement Type: enhancement

Comments

@jonrkarr
Copy link

jonrkarr commented Jun 8, 2021

I.e. quantities that could be plotted, e.g.,

Line id="gna" quantity="hhpop[0]/bioPhys1/membraneProperties/NaConductances/gDensity" scale="1"  color="#000000" timeScale="1ms"/>
@sanjayankur31
Copy link
Member

There isn't a utility function that does this at the moment. One has to use pylems to read the model and then iterate over it to list the "exposures" themselves. The exposures are specified in the neuroml/lems schemas. For example: https://docs.neuroml.org/Userdocs/Schemas/Cells.html#basecellmembpot

We can add a utility function in pyneuroml that reads the lems file and lists all exposures perhaps. Would that help?

@jonrkarr
Copy link
Author

Of the issues I raised, this would be the most helpful to address.

A utility function would be great. Guidance on commands to run would be fine too.

@sanjayankur31
Copy link
Member

Great. This is on our backlog now. I'll open a PR once I have it implemented. I think way would be to read the file to create a LEMS model in PyLEMS, and then iterate over the entities of the model to list all exposures. I'll have to look at the PyLEMS API to see how this can be implemented though.

@jonrkarr
Copy link
Author

I started down this path. Now that I worked out how to read files, its easy to iterate over the components.

What is the convention is for mapping chains of component ids to paths for observables such as hhpop[0]/bioPhys1/membraneProperties/NaConductances/gDensity that can be used with Line and OutputColumn` in LEMS files? If I knew this, this should be quick to implement.

Also, is there analogous way to specify particular values of parameters in the top level LEMS file (something that would override the values indicated in the includes files)?

@sanjayankur31
Copy link
Member

I started down this path. Now that I worked out how to read files, its easy to iterate over the components.

What is the convention is for mapping chains of component ids to paths for observables such as hhpop[0]/bioPhys1/membraneProperties/NaConductances/gDensity that can be used with Line and OutputColumn` in LEMS files? If I knew this, this should be quick to implement.

Sorry, I'm not sure I understand---one will go `"{}/{}".format(id1, id2) and so on to construct the observable path generally. At the moment this path has to be constructed manually by the user as far as I know:

Example: https://docs.neuroml.org/Userdocs/SingleCompartmentHHExample.html#simulating-the-model

Also, is there analogous way to specify particular values of parameters in the top level LEMS file (something that would override the values indicated in the includes files)?

Not that I'm aware of. From what I know, the NML files must be regenerated for each new set of parameters.

@pgleeson will be able to confirm

@jonrkarr
Copy link
Author

The strings used to address exposures (e.g., hhpop[0]/bioPhys1/membraneProperties/NaConductances/gDensity) are not concatenated lists of the ids of components and their children. For example, hhpop is the value of an id attribute, but gDensity is the value of a name attribute. [0] look like an index into an array. What is the convention for these addresses for exposures? I couldn't find documentation for this. The only documentation I found is that this must be a "path to the parameter that will contain the path to the quantity to be recorded".

@sanjayankur31
Copy link
Member

I'm not sure. I think anything can have an ID and the ID can be used to construct the path. In cases where there's only one entity, it seems that the entity name can be used instead of the ID and it resolves fine. I think exposures can be referred to using id too, but since each component will only have one exposure of a particular name, the name can be used too. Populations and other containers that can have multiple entities of the same component type use the index to refer to a particular entity.

I'll discuss this and see if we can add a page to the docs clarifying how this works. I've not found any info in the papers/docs either, so this is certainly missing.

@sanjayankur31
Copy link
Member

We have an issue open here: NeuroML/Documentation#15

@jonrkarr
Copy link
Author

Yes, this in the same issue I'm describing. This can be closed because its redundant with that issue.

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

No branches or pull requests

3 participants