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

record synaptic currents #363

Closed
coschroeder opened this issue May 22, 2024 · 6 comments · Fixed by #523
Closed

record synaptic currents #363

coschroeder opened this issue May 22, 2024 · 6 comments · Fixed by #523

Comments

@coschroeder
Copy link
Contributor

at the moment it is not possible to record that

@huangziwei
Copy link
Contributor

huangziwei commented Jun 13, 2024

synaptic currents actually got recorded (only) in network level, as {synapse_name}_current in states.

    net0.cell(0).branch(0).loc(0.5).stimulate(current, verbose=False)

    # record the membrane potential of the pre- and post-synaptic compartments
    net0.cell(0).branch(0).loc(0.5).record(verbose=False)
    net0.cell(1).branch(0).loc(0.5).record(verbose=False)

    net0.cell(1).branch(0).loc(0.5).record("AMPA_R", verbose=False)
    net0.cell(1).branch(0).loc(0.5).record("AMPA_C", verbose=False)

    net0.record("AMPA_current", verbose=False)

maybe we should update the synapses to the same convention used in channel.

@jnsbck jnsbck linked a pull request Nov 8, 2024 that will close this issue
@jnsbck jnsbck removed a link to a pull request Nov 8, 2024
@ntolley
Copy link
Contributor

ntolley commented Nov 12, 2024

Is there any interest in adding functionality for recording extracellular fields (since they're calculated directly from these currents)?

I'm planning to start playing around with jaxley to simulate LFP/EEG, happy to try and contribute if there's interest in a dedicated API

@michaeldeistler
Copy link
Contributor

Yes, it would definitely be great to have this! Let me know if you need any input or would like to discuss, I would be happy to have a quick chat over zoom!

Michael

Aside: my guess is that achieving this will require to have access to x, y, z of postsynaptic compartments. Once #464 is merged, those can be accessed by doing:

net._update_nodes_with_xyz()
net.copy_node_property_to_edges("x", "post")
net.edges

@ntolley
Copy link
Contributor

ntolley commented Nov 19, 2024

Working on this a bit more, I think it might be useful to add a column to net.recordings that indicates which compartment the recordings corresponds to. Perhaps adding the glocal_comp_index as a column here:
image

What do you think? This can be handled with some bookkeeping in the code, but adding it as a column would help merging the dataframes for downstream analyses

@ntolley
Copy link
Contributor

ntolley commented Nov 19, 2024

I'm actually realizing that the index on this dataframe does seem to correspond to global_comp_index! At least the index values repeat when adding recordings for multiple current types...

@jnsbck
Copy link
Contributor

jnsbck commented Nov 19, 2024

Indeed, the index of whatever you are recording is written to rec_index, see

jaxley/jaxley/modules/base.py

Lines 1479 to 1481 in 32068e9

in_view = self._nodes_in_view if state in comp_states else self._edges_in_view
new_recs = pd.DataFrame(in_view, columns=["rec_index"])
. This can be the edge or comp index depending on whether the state is part of a synapse or channel.

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

Successfully merging a pull request may close this issue.

5 participants