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
50 stars 24 forks source link

LEMS does not like RDF metadata (while using `pynml-channelanalysis`)? #224

Closed sanjayankur31 closed 2 weeks ago

sanjayankur31 commented 4 months ago

Filing this here to begin with, but the issue is in jNeuroML/jLEMS.

I have a channel file

<?xml version="1.0" encoding="ISO-8859-1"?>
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2.3.xsd" id="Kv1">

    <notes>NeuroML file containing a single Channel description</notes>

    <ionChannel id="Kv1" conductance="10pS" type="ionChannelHH" species="k">

        <notes>Voltage-gated low threshold potassium current from Kv1 subunits

The time kinetics are from the Original paper (Akeman reduce the time constatant to about 1/3);
activation curve are from original paper; inactivation data are from Stephane's paper Fig 6E 
(This current should be a combination of kv1.2 which is not sensitive to TEA and kv4.3 which is not completely blocked).
Not sure this steady state inactivation curve is right, but it would not affect the normal firing of PC. It is used to 
reproduce history dependence of development of secondary spikes. Kv4 seems not to be able to do it according to its fast inactivation kinetics.
Ik1 inactivates very slow. We set the inactivation time constant to 1000 ms. 
NEURON implementation of a potassium channel from Kv1.1 subunits
We should also refer to Gating, modulation and subunit composition of voltage-gated K+channels in dendritic inhibitory interneurones of rathippocampus
In this paper,they observe a slow delayed rectifier K current. This current is surprisingly not sensitive to 4AP,but sensitive to high does
TEA. Compared with the paper by Marco Martin 5698 • The Journal of Neuroscience, July 2, 2003 • 23(13):5698 –5707, the K currents measured in the
dendrite, about 20% of the K currents is still resistant to even 3 mM 4-AP. However, 10 mM TEA can decrease the K currents to only 10%, suggesting a K
current sensitive  to high concentration TEA instead of 4AP, similar with the work by CC Lien. I guess in the soma, there should be IK1.

Kinetic data taken from: Zerr et al., J.Neurosci. 18 (1998) 2842
Vhalf = -28.8 +/- 2.3 mV; k = 8.1 +/- 0.9 mV

The voltage dependency of the rate constants was approximated by:

alpha = ca * exp(-(v+cva)/cka)
beta = cb * exp(-(v+cvb)/ckb)

Parameters ca, cva, cka, cb, cvb, ckb
are defined in the CONSTANT block.

Laboratory for Neuronal Circuit Dynamics
RIKEN Brain Science Institute, Wako City, Japan
http://www.neurodynamics.brain.riken.jp

Reference: Akemann and Knoepfel, J.Neurosci. 26 (2006) 4602
Date of Implementation: April 2005
Contact: akemann@brain.riken.jp
    </notes>

        <annotation>
            <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:bqmodel="http://biomodels.net/model-qualifiers/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/" >
              <rdf:Description rdf:about="Kv1">
                <dc:title>NeuroML conversion of Kv1 channel from Zang et al</dc:title>
                <dc:description>Voltage-gated low threshold potassium current from Kv1 subunits</dc:description>
                <bqbiol:isPartOf>
                  <rdf:Bag rdf:nodeID="N175e43a2dfd441418ba29dec98af5cd3">
                    <rdf:_1 rdf:resource="http://uri.neuinfo.org/nif/nifstd/sao471801888"/>
                  </rdf:Bag>
                </bqbiol:isPartOf>
                <dc:source>
                  <rdf:Bag rdf:nodeID="Nbaa0739c57db4b7687c33900c4b2faa2">
                    <rdf:_1 rdf:resource="https://modeldb.science/243446?tab=1"/>
                  </rdf:Bag>
                </dc:source>
                <dc:source>
                  <rdf:Bag rdf:nodeID="N2be1ac1cce214c449225712a3c7aafb0">
                    <rdf:_1 rdf:resource="https://github.com/ModelDBRepository/243446"/>
                  </rdf:Bag>
                </dc:source>
                <bqmodel:isDerivedFrom>
                  <rdf:Bag rdf:nodeID="N80bef60b52f0453db129a34a61eb5c4e">
                    <rdf:_1 rdf:resource="https://modeldb.science/80769"/>
                  </rdf:Bag>
                </bqmodel:isDerivedFrom>
                <bqmodel:isDescribedBy>
                  <rdf:Bag rdf:nodeID="N180e8c5986e841e08c74d70c3e7dbbc0">
                    <rdf:_1 rdf:resource="https://doi.org/10.1523/JNEUROSCI.5204-05.2006"/>
                  </rdf:Bag>
                </bqmodel:isDescribedBy>
                <dc:creator>
                  <rdf:Bag rdf:nodeID="N8b98b0cfff494db5b1cff91a63fd854a">
                    <rdf:_1>Walther Akemann</rdf:_1>
                    <rdf:_2>akemann at brain.riken.jp</rdf:_2>
                  </rdf:Bag>
                </dc:creator>
                <dc:contributor>
                  <rdf:Bag rdf:nodeID="N03b462aa2c594118bf5082aa2117d309">
                    <rdf:_1>Ankur Sinha</rdf:_1>
                    <rdf:_2>https://orcid.org/0000-0001-7568-7167</rdf:_2>
                  </rdf:Bag>
                </dc:contributor>
                <dcterms:created>
                  <rdf:Description rdf:nodeID="Nb92c74a0c6f6410e90a980afc990e1ba">
                    <dcterms:W3CDTF>2024-04-26</dcterms:W3CDTF>
                  </rdf:Description>
                </dcterms:created>
              </rdf:Description>
            </rdf:RDF>
        </annotation>

        <gate id="n" type="gateHHrates" instances="4">
            <q10Settings type="q10ExpTemp" experimentalTemp="22degC" q10Factor="3" />
            <forwardRate type="HHExpRate" rate="0.12889 per_ms" midpoint="-45mV" scale="33.90877mV"/>
            <reverseRate type="HHExpRate" rate="0.12889 per_ms" midpoint="-45mV" scale="-12.42101mV"/>
        </gate>
        <gate id="h" type="gateHHtauInf" instances="1">
            <q10Settings type="q10ExpTemp" experimentalTemp="22degC" q10Factor="3" />
            <timeCourse type="fixedTimeCourse" tau="1000ms" />
            <steadyState type="HHSigmoidVariable" rate="1" midpoint="-66.16mV" scale="-6.1881mV"/>
        </gate>

    </ionChannel>

</neuroml>

Running pynml-chananalysis on this fails:

$ pynml-channelanalysis Kv1.channel.nml
pyNeuroML >>> INFO - Loading NeuroML2 file: Kv1.channel.nml
pyNeuroML >>> INFO -
Analysing channels from files: ['Kv1.channel.nml']

pyNeuroML >>> INFO - Loading NeuroML2 file: Kv1.channel.nml
pyNeuroML >>> INFO - Generating LEMS file to investigate Kv1 in Kv1.channel.nml, -100mV->100mV, 6.3degC
pyNeuroML >>> INFO - Loading NeuroML2 file: Kv1.channel.nml
pyNeuroML >>> INFO - Loading LEMS file: /home/asinha/Documents/02_Code/00_mine/models/ZangEtAl2018/NeuroML2/channels/LEMS_Test_Kv1.xml and running with jNeuroML
pyNeuroML >>> INFO - Executing: (java -Xmx400M  -Djava.awt.headless=true -jar  "/home/asinha/Documents/02_Code/00_mine/NeuroML/software/pyNeuroML/pyneuroml/utils/./../lib/jNeuroML-0.13.0-jar-with-dependencies.jar"  /home/asinha/Documents/02_Code/00_mine/models/ZangEtAl2018/NeuroML2/channels/LEMS_Test_Kv1.xml  -nogui -I '') in directory: .
pyNeuroML >>> CRITICAL - *** Problem running command:
       Command 'java -Xmx400M  -Djava.awt.headless=true -jar  "/home/asinha/Documents/02_Code/00_mine/NeuroML/software/pyNeuroML/pyneuroml/utils/./../lib/jNeuroML-0.13.0-jar-with-dependencies.jar"  /home/asinha/Documents/02_Code/00_mine/models/ZangEtAl2018/NeuroML2/channels/LEMS_Test_Kv1.xml  -nogui -I ''' returned non-zero exit status 1.
pyNeuroML >>> CRITICAL -  jNeuroML >>   jNeuroML v0.13.0
 jNeuroML >>  Loading: /home/asinha/Documents/02_Code/00_mine/models/ZangEtAl2018/NeuroML2/channels/LEMS_Test_Kv1.xml with jLEMS, NO GUI mode...
 jNeuroML >>  org.lemsml.jlems.core.sim.ContentError: No such type dc:title, 226 existing types:
...

if I remove the contents of the annotation, it all works.

Should we just be making the parser ignore anything inside annotations?

sanjayankur31 commented 4 months ago

I think I know what's happening. The dc:* bits aren't defined in our component types:

https://github.com/NeuroML/NeuroML2/blob/352244cff605cb1ba24fa7c11757dc818fe90fd2/NeuroML2CoreTypes/NeuroMLCoreCompTypes.xml#L67

These are suggested by the Biosimulations metadata format so we should perhaps include them. Although, these aren't included in the combine specifications, so maybe they're only for simulations and not model files?

Possibly another thing to ask the COMBINE folks.