GithubHelp home page GithubHelp logo

lems / jlems Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 10.0 6.94 MB

Java Interpreter for the Low Entropy Model Specification language

Home Page: https://docs.neuroml.org/Userdocs/Software/jLEMS.html

License: MIT License

Shell 0.01% Java 70.17% XSLT 4.70% CSS 0.18% Batchfile 0.01% HTML 24.92%

jlems's Introduction

LEMS

Java CI with Maven pages-build-deployment

The Low Entropy Model Specification language. This repository contains the Schema for the language, some examples and code for generating the documentation.

LEMS Documentation

See http://lems.github.io/LEMS

For more details on LEMS see:

Robert C. Cannon, Padraig Gleeson, Sharon Crook, Gautham Ganapathy, Boris Marin, Eugenio Piasini and R. Angus Silver, LEMS: A language for expressing complex biological models in concise and hierarchical form and its use in underpinning NeuroML 2, Frontiers in Neuroinformatics 2014, doi: 10.3389/fninf.2014.00079

Java based LEMS interpreter/simulator

jLEMS (see also here).

jLEMS can be used to parse and execute any LEMS model. For an application which adds NeuroML 2 ComponentType definitions and various options for importing & exporting LEMS to other formats, see jNeuroML.

Python based LEMS interpreter/simulator

PyLEMS (see also here).

This code is distributed under the terms of the GNU General Public License v3.

jlems's People

Contributors

adrianq avatar borismarin avatar dependabot[bot] avatar finnk avatar hugh-osborne avatar jlleitschuh avatar pgleeson avatar robertcannon avatar sanjayankur31 avatar tarelli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jlems's Issues

Rewrite matches expected test error

@pgleeson the API branch (I brought in the changes from api_merged) is failing to build. The testReadFromString test in XMLExamplesReaderTest is failing when testing the file input.xml
XMLExamplesReaderTest.testReadFromString:56 Rewrite matches expected:<12111> but was:<12057>

I'm commenting this test in the api branch for now until we fix it.

Time resolution for condition testing

Checking a condition (OnCondition element in dynamics) at the end of a step is a bit inaccurate (see bounce example without zeroing the height for a serious failure). Integrators should at least interpolate, and maybe solve for the exact time when the condition is passed.

vfgen xml generation

VectorFieldGENerator http://www.warrenweckesser.net/vfgen/index.html
automatically generates code for many differential equation solvers and analysis tools (including xpp, matlab, lsoda) from a xml description of the dynamics. It would be very convenient translating preparsed flattened LEMS to vfgen, instead of having to rewrite exporters for all those formats.

Bóris

Legend for GUI frame

A legend should be added to the plot frame showing what's plotted against each colour trace.

This could be as a tooltip when the mouse floats over the graph or as a menu option with a popup dialog

Super in Dynamics breaks reserialization.

On resolving dynamics with a <Super/> element, the contents of the supertype dynamics are copied.
Serializing the component type then writes them out in full so it is different from the original.

Allow jLEMS to include files specified for inclusion in a NeuroML file

Include inside comments are still read

An Include element inside an XML comment in a Lems file is still read in & processed, e.g.

    <!-- Including file with a <neuroml> root, a "real" NeuroML 2 file 
    <Include file="NML2_SingleCompHHCell.nml"/>-->

Correct framing of GUI

Framing of the plot against the labelled axed needs to be fixed. When the gui opens initially the lines on the plot (corresponding to the real plotted values) are out of alignment with the axis labels:

Example1_001

Also, when the window is resized, the plot area should ideally resize also:

Example1_003

Remove ComponentReference

After discussions at UCL with @robertcannon, we have decided that ComponentReferences are just adding entropy to LEMS, since all the cases where they are used can be straightforwardly implemented using Child(ren)s. Relates to #32.

Move to use Maven?

It would be nice if jLEMS used maven for the build so we could easily integrate it with all the other maven projects we have. I could help setting this up.

Add -include command line option

Add an option to specify a folder with xml files which can be included in the main model file, e.g.

./lems -include ../NeuroML2/NeuroML2CoreTypes examples/LEMS_NML2_Ex0_IaF.xml

Robert, assign this to me if you're happy with this change

Tests for component flattening

Need tests for the three ways of running a model: plain tree, flattened component behavior, and flattened components.

Discrete dynamics

Robert and I have discussed the possibility of supporting systems defined in terms of maps instead of odes. We ended up considering an StateUpdate element. For example, take the Logistic map: x_{n+1} = mu * x_n * (1 - x_n) where mu is a parameter. The dynamics would be defined as something like this:

<Dynamics>
        <StateVariable name="x" dimension="none" exposure="x"/>
        <StateUpdate variable="x" value="mu * x * (1 - x)"/>
</Dynamics>

There are several discrete time (a.k.a maps) neuronal models:
http://www.sciencedirect.com/science/article/pii/S0370157310003224

MathML support

There is some preliminary support for exporting expressions to MathML from ParseTrees, but this is not yet complete.

Will be needed for conversion to SBML & others...

Discussion list

Not specifically a jLEMS thing, but we could do with one along the lines of openworm-discuss. Probably the same one for jLEMS and pyLEMS.

Flattener does not handle DerivedParameter or ConditionalDerivedVariable

Both elements are missing from https://github.com/LEMS/jLEMS/blob/master/src/main/java/org/lemsml/jlems/core/flatten/ComponentFlattener.java, and lead to errors when some NeuroML2 comp types are flattened.

@robertcannon, can you have a look at this? This can be a test case for making changes to jLEMS (in a branch of yours on jLEMS) and potentially merging them back to jLEMSDev. The versions should end up being pretty much the same (apart from ReceivePort/EventPort). Note Constant was also missing from ComponentFlattener and I've added that in jLEMS.

A more general way to set initial conditions for state variables

This is more of a philosophical issue. From my point of view, initial conditions are more related to particular runs of a given model than to the general definition of the dynamics and parameters. In other (code) words:

<Parameter name="x0" description="initial condition"/>
...
<OnStart>
            <StateAssignment variable="x" value="x0"/>
</OnStart>

and then define x0 in each run. It would be interesting having mechanisms to grab initial conditions from data files, possibly generated by a previous simulation. That would require the definition of a standard format for storing timeseries.

Decide location of API package

@tarelli's api branch is nearly ready to merge, though the final issue is that LEMSDocumentReader uses java.io.File, which is not allowed in the org.lemsml.jlems.core.* by https://github.com/LEMS/jLEMS/blob/development2/src/test/java/org/lemsml/jlems/test/CoreDependenciesTest.java.

This can be resolved by moving the api package from org.lemsml.jlems.core.api to org.lemsml.jlems.api. This is probably reasonable since it's best that core remains fully approved by @robertcannon (e.g. so that it works with GWT), though it would require updating all Geppetto repos using jLEMS.

Thoughts?

Deprecate <NamedDimensionalType> ?

The only Element from the previous list (#55) that is not used in the NeuroML2 schamata (dev branch) is <NamedDimensionalType>. Candidate for deprecation?

Support instances in populations & allow modification of properties of component instances

For example:

<populationList id="ipop" component="izMixed" size="3">
    <instance id="0"/>
    <instance id="1"/>
    <instance id="2"/>        
    <!-- Or ideally: -->
              <instance id="0"><location x="0" y="0" z="0"/></instance>

</populationList>

See https://github.com/NeuroML/NeuroML2/blob/master/NeuroML2CoreTypes/LEMS_NML2_Ex13_Instances.xml
and
https://github.com/NeuroML/NeuroML2/blob/master/NeuroML2CoreTypes/Networks.xml#L56

Scaling of variables in OutputFile

It would be useful being able to do

<OutputColumn id="v" quantity="pop/0/hh/v" scale="1mV"

similarly to what's already done here:

<Line id="V" quantity="pop/0/hh/v" scale="1mV" color="#ffffff" timeScale="1ms"

Code generation in build process?

I'm not a fan of the code generation for jlems.model during the build process. Since the types in this repository are meant to be fairly stable now, it would be better to do the one-off schema generation and then a one-off generation of jlems.model from the schema and check it in. Most future schema changes should only add new classes, not modify existing ones.

Flattening of populations

Hi
I have been working on matlab and C(+cvode) exporters, and I would like to know whether there would be a way of flattening at the entire network level. In other words, what I need is just a large system of ODEs, comprising each cell dynamics, for all cells in a population, for all populations -- as well as the ODEs associated with connectivity (i.e. synaptic dynamics). I am basing these new exporters on the Brian exporter.

Remove speculative elements that are not part of any spec

The core.type.geometry package is not used in any models and could be removed entirely so it doesn't appear in the docs. Likewise, core.type.procedure should probably be removed.

core.type.structure is tricky - some parts are used in some example models, but it is still only a proof of concept, not a candidate for standardization.

Improve File menu items & better window event handling

At the moment the File menu includes a number of options that are not needed/implemented:

selection_139

@robertcannon is it ok to remove open/save/import until they are required/implemented? It's probably fine for now to have jLEMS as a one model per session applicaton, and saving data controlled by what's in the Simulation element.

This menu could be reduced to:

  • Close window
  • Exit

Also, currently closing one window (via a window event, not a menu selection) in a model with multiple windows closes the whole application. This should probably be changed to just closing that window unless its the last open.

Tidy README, decide Version, update links to docs

README should point out that this is still a work in progress & give some more info
URL to docs still refs the Sourceforge version & uses older format
Version numbering should be consistent (0.9.0?)

Implement SingleSimulation CompType & allow recording Lems simulations to file

Create example with simple single simulation element, as in previous Lems.

This should allow recording of displayed variables to file, e.g.:

        <Simulation id="sim1" length="400ms" step="0.01ms" target="net2">
                <Display id="d1" title="Ex6: Cells with ..." timeScale="1ms">
                        <Line id="l2" quantity="pasPop[0]/v" scale="1mV" color="#00ffff" save="pas6_v.dat"/>
                </Display>

                <Display id="d2" title="Ex6: Cells with ..." timeScale="1ms">
                        <Line id ="l1" quantity="pasPop[0]/nmdaSyn1/g" scale="1nS"  color="#1111FF" save="ex6_syn.dat"/>
                </Display>

        </Simulation>```

Allow <Include>ing of xml with root different from <Lems>

A statement like:

should allow a file with root to be included, the root ignored, and everything inside treated as normal lems components.

This simple extension should allow any type of xml to be imported and using 'root' makes it clear that it's just the top level element that should be ignored (an error can be thrown if the root is different). In future some more complex XPath/XInclude based expression could be used to pick out the appropriate element, but this should not be needed for now.

Rootfinding based events

In NeuroML, we do

            <StateVariable name="spiking" dimension="none"/>
            <OnCondition test="v .gt. thresh .and. spiking .lt. 0.5">
                <StateAssignment variable="spiking" value="1"/>
                <EventOut port="spike"/>
            </OnCondition>

            <OnCondition test="v .lt. thresh">
                <StateAssignment variable="spiking" value="0"/>
            </OnCondition>

to detect spikes. This involves the creation of a new state variable, and some "ad hoc" logic. This degree of "imperativeness" seems to go against the declarative philosophy of NeuroML/LEMS.
I would suggest defining and detecting events as zero-crossings of state functions in a given direction, i.e., we would just need to say something like

            <OnCondition test="v - thresh" direction="increasing">
                <EventOut port="spike"/>
            </OnCondition>

this would simplify the component, but jLEMS would then need to store history in order to detect events. @robertcannon, would that require drastic changes to the interpreter?

Lems Elements

Below, the list of Lems Elements defined in the current schema. @robertcannon @pgleeson Could you please tick those that are (known to be / potentially) deprecated?

  • Target
  • Include
  • Dimension
  • Unit
  • DerivedParameter
  • Constant
  • ComponentReference
  • Child
  • Attachments
  • EventPort
  • Fixed
  • Link
  • Children
  • Path
  • Text
  • StateVariable
  • DerivedVariable
  • ConditionalDerivedVariable
  • Case
  • TimeDerivative
  • OnStart
  • OnEntry
  • OnEvent
  • OnCondition
  • EventOut
  • StateAssignment
  • Regime
  • Transition
  • Component
  • ComponentType
  • NamedDimensionalType
  • Property
  • Parameter
  • IndexParameter
  • Requirement
  • Exposure
  • ComponentRequirement
  • InstanceRequirement
  • Dynamics
  • Structure
  • ChildInstance
  • MultiInstantiate
  • ForEach
  • With
  • Tunnel
  • EventConnection
  • Assign
  • OnCondition
  • KineticScheme
  • Simulation
  • DataDisplay
  • Record
  • Run
  • DataWriter

Refine Simulation element

Allow missing xmin etc. - means making optional attrs
also timescale

Longer term - make "datagenerator" which can be used for displays or outputfile

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.