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

Python object model does not load gates into correct attributes when type= is used #205

Open
sanjayankur31 opened this issue Jan 14, 2025 · 1 comment · May be fixed by #206
Open

Python object model does not load gates into correct attributes when type= is used #205

sanjayankur31 opened this issue Jan 14, 2025 · 1 comment · May be fixed by #206
Assignees
Labels
T: bug Type: bug

Comments

@sanjayankur31
Copy link
Contributor

Here's an example channel file:

<neuroml xmlns="http://www.neuroml.org/schema/neuroml2"  xmlns:xs="http://www.w3.org/2001/XMLSchema" 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.1.xsd" id="shal">
    <notes>An ion channel from Nicoletti et al. 2024</notes>

    <ionChannelHH id="shl1" species="k" conductance="10pS">
       
        <gateHHtauInf id="m" instances="3">
            <timeCourse type="shal_m_tau"/>
            <steadyState type="shal_m_inf"/>
        </gateHHtauInf>
        <gateFractional id="h" instances="1">
            <subGate id="hf" fractionalConductance="0.7">
                <steadyState type="shal_h_hf_inf"/>
                <timeCourse type="shal_h_hf_tau"/>
            </subGate>
            <subGate id="hs" fractionalConductance="0.3">
                <steadyState type="shal_h_hs_inf"/>
                <timeCourse type="shal_h_hs_tau"/>
            </subGate>
        </gateFractional>
    </ionChannelHH>
    <ComponentType name="shal_m_inf" extends="baseVoltageDepVariable">
        <Constant name="VOLT_SCALE" dimension="voltage" value="1 mV"/>
        <Constant name="shalsfhit" dimension="none" value="18.0"/>
        <Constant name="vashal" dimension="none" value="11.2"/>
        <Constant name="kashal" dimension="none" value="14.1"/>
        <Dynamics>
            <DerivedVariable name="V" dimension="none" value="(v) / VOLT_SCALE"/>
            <DerivedVariable name="x" dimension="none" exposure="x" value="1/(exp((-V - shalsfhit + vashal)/kashal) + 1)"/>
        </Dynamics>
    </ComponentType>
    <ComponentType name="shal_m_tau" extends="baseVoltageDepTime">
        <Constant name="VOLT_SCALE" dimension="voltage" value="1 mV"/>
        <Constant name="TIME_SCALE" dimension="time" value="1 ms"/>
        <Constant name="ptmshal1" dimension="none" value="13.8"/>
        <Constant name="ptmshal2" dimension="none" value="-17.5165"/>
        <Constant name="ptmshal3" dimension="none" value="12.9213"/>
        <Constant name="ptmshal4" dimension="none" value="-3.7082"/>
        <Constant name="ptmshal5" dimension="none" value="6.4876"/>
        <Constant name="ptmshal6" dimension="none" value="1.8849"/>
        <Constant name="cshal" dimension="none" value="0.1"/>
        <Dynamics>
            <DerivedVariable name="V" dimension="none" value="(v) / VOLT_SCALE"/>
            <DerivedVariable name="t" dimension="time" exposure="t" value="(cshal*(ptmshal1/(exp((-V + ptmshal2)/ptmshal3) + exp((V - ptmshal4)/ptmshal5)) + ptmshal6))* TIME_SCALE"/>
        </Dynamics>
    </ComponentType>
    <ComponentType name="shal_h_hf_inf" extends="baseVoltageDepVariable">
        <Constant name="VOLT_SCALE" dimension="voltage" value="1 mV"/>
        <Constant name="shalsfhit" dimension="none" value="18.0"/>
        <Constant name="kishal" dimension="none" value="8.3"/>
        <Constant name="vishal" dimension="none" value="-33.1"/>
        <Dynamics>
            <DerivedVariable name="V" dimension="none" value="(v) / VOLT_SCALE"/>
            <DerivedVariable name="x" dimension="none" exposure="x" value="1/(exp((V + shalsfhit - vishal)/kishal) + 1)"/>
        </Dynamics>
    </ComponentType>
    <ComponentType name="shal_h_hf_tau" extends="baseVoltageDepTime">
        <Constant name="VOLT_SCALE" dimension="voltage" value="1 mV"/>
        <Constant name="TIME_SCALE" dimension="time" value="1 ms"/>
        <Constant name="pthfshal1" dimension="none" value="539.1584"/>
        <Constant name="pthfshal2" dimension="none" value="-28.199"/>
        <Constant name="pthfshal3" dimension="none" value="4.9199"/>
        <Constant name="pthfshal4" dimension="none" value="27.2811"/>
        <Constant name="cshal" dimension="none" value="0.1"/>
        <Dynamics>
            <DerivedVariable name="V" dimension="none" value="(v) / VOLT_SCALE"/>
            <DerivedVariable name="t" dimension="time" exposure="t" value="(cshal*(pthfshal1/(exp((V - pthfshal2)/pthfshal3) + 1) + pthfshal4))* TIME_SCALE"/>
        </Dynamics>
    </ComponentType>
    <ComponentType name="shal_h_hs_inf" extends="baseVoltageDepVariable">
        <Constant name="VOLT_SCALE" dimension="voltage" value="1 mV"/>
        <Constant name="shalsfhit" dimension="none" value="18.0"/>
        <Constant name="kishal" dimension="none" value="8.3"/>
        <Constant name="vishal" dimension="none" value="-33.1"/>
        <Dynamics>
            <DerivedVariable name="V" dimension="none" value="(v) / VOLT_SCALE"/>
            <DerivedVariable name="x" dimension="none" exposure="x" value="1/(exp((V + shalsfhit - vishal)/kishal) + 1)"/>
        </Dynamics>
    </ComponentType>
    <ComponentType name="shal_h_hs_tau" extends="baseVoltageDepTime">
        <Constant name="VOLT_SCALE" dimension="voltage" value="1 mV"/>
        <Constant name="TIME_SCALE" dimension="time" value="1 ms"/>
        <Constant name="pthsshal1" dimension="none" value="8422.0"/>
        <Constant name="pthsshal2" dimension="none" value="-37.7391"/>
        <Constant name="pthsshal3" dimension="none" value="6.3785"/>
        <Constant name="pthsshal4" dimension="none" value="118.8983"/>
        <Constant name="cshal" dimension="none" value="0.1"/>
        <Dynamics>
            <DerivedVariable name="V" dimension="none" value="(v) / VOLT_SCALE"/>
            <DerivedVariable name="t" dimension="time" exposure="t" value="(cshal*(pthsshal1/(exp((V - pthsshal2)/pthsshal3) + 1) + pthsshal4))* TIME_SCALE"/>
        </Dynamics>
    </ComponentType>
</neuroml>

This will load correctly and channel.gate_fractionals and channel.gates_hh_tau_infs will include the objects for the two gates. However, if these gates are specified using the type= attribute rather than the tag itself, they are loaded in the gates attribute as GateHHUndetermined objects:

        <gate id="m" instances="3" type="gateHHtauInf">
            <timeCourse type="shal_m_tau"/>
            <steadyState type="shal_m_inf"/>
        </gate>
        <gate id="h" instances="1" type="gateFractional">
            <subGate id="hf" fractionalConductance="0.7">
                <steadyState type="shal_h_hf_inf"/>
                <timeCourse type="shal_h_hf_tau"/>
            </subGate>
            <subGate id="hs" fractionalConductance="0.3">
                <steadyState type="shal_h_hs_inf"/>
                <timeCourse type="shal_h_hs_tau"/>
            </subGate>
        </gate>
@sanjayankur31 sanjayankur31 added the T: bug Type: bug label Jan 14, 2025
@sanjayankur31
Copy link
Contributor Author

My initial thought is that the generateds generated parser cannot (does not?) make use of the type attribute. This needs to be confirmed, and if this is the case, we need to:

  • investigate if there's a way to get it to use this attribute
  • if not, do we want to tweak our loader to try to correctly place the "undetermined" objects in the right attributes where possible.

This is important because both ways of writing are valid NeuroML, so it's unexpected when one works and the other doesn't.

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

Successfully merging a pull request may close this issue.

1 participant