NeuroML / NeuroML2

This repository hosts the NeuroML 2 Schema, the ComponentType definitions in LEMS and the core documentation of NeuroML2.
https://docs.neuroml.org
GNU Lesser General Public License v3.0
49 stars 24 forks source link

Include morphology from another file #150

Open pgleeson opened 3 years ago

pgleeson commented 3 years ago

Is your feature request related to a problem? Please describe. Use one NML morphology in multiple active files

Describe the solution you'd like Be able to include with one line the morphology section from another cell

Perhaps something like:

<neuroml>

  <include href="pyr_morphology.nml"/>
  <include href="pyr_biophysics.nml"/>

    <cell id="pyr_full" morphology="pyr_morphology/morph" biophysical_properties="pyr_biophysics/biophysicalProperties">

        <notes>Points to definitions in other cells</notes>

    </cell>
</neuroml>

See https://github.com/pgleeson/morphology_include/blob/main/pyr_full.cell.nml

spanag commented 2 months ago

FWIW, Eden handles <morphology>s and <biophysicalProperties> outside the <cell> as attributes, as seen on: https://gitlab.com/c7859/neurocomputing-lab/Inferior_OliveEMC/eden/-/blob/main/eden/NeuroML.cpp#L5303 and 5330 . Because the <biophysicalProperties> can thus be used with different morphs in different cell types, they get re-interpreted for each cell type. This behaviour was guessed by reading the schema, see https://github.com/NeuroML/NeuroML2/blob/NMLv2.1/Schemas/NeuroML2/NeuroML_v2.1.xsd#L1534 .

If we point to a LEMS path to hijack the morphologies of a different cell type, it's a bit irregular and we have to make sure no e.g dynamic properties are ever allowed to happen because they would expose the links. How difficult would it be to spawn a child component as a subclass of an existing LEMS component, when the attribute is present? IIRC there is <Structure> support to do this, if only it wasn't optional.