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

Can different branches have a different nseg? #415

Closed
Tunenip opened this issue Sep 13, 2024 · 6 comments
Closed

Can different branches have a different nseg? #415

Tunenip opened this issue Sep 13, 2024 · 6 comments

Comments

@Tunenip
Copy link

Tunenip commented Sep 13, 2024

1.Can different branch has different nseg?
Like NEURON, I wanna set different branch with differen nseg, but when I give a list to that, the cell.show() can not work.

2.When setting dt !=0.025, traces change a lot.
I tried to set dt = 0.01 or other values which are not 0.025, but the voltage traces changed a lot, I dont konw why.

3.Can init_state() in channel class receive public channel_states as input?
Sometimes the init_states() needs the cai as input.

@michaeldeistler
Copy link
Contributor

Hi! Thanks for reaching out!

  1. Right now this is not possible, but we are working on it. I will get back to you once there is news. For now I recommend using nseg=4 for all branches and splitting very long branches into two subbranches (for swc files you can do this with jx.read_swc(..., max_branch_len=x), where x is the maximal branch length in micrometer, above which the branch will be splitted into two subbranches).
  2. You have to change delta_t in the jx.step_current(..., delta_t=xxx) and in jx.integrate(..., delta_t=xxx). See also here.
  3. That's a good point, I had not yet thought about this. I will try to make it possible asap.

Hope this helps!
Michael

@Tunenip
Copy link
Author

Tunenip commented Sep 13, 2024

Thanks for your help! I realized the mistake was that I only changed the dt in jx.step_current(). I appreciate your assistance and hope you make great progress too!

@michaeldeistler
Copy link
Contributor

Quick update: Point 3 (public states in init_state) is solved now:

pip install jaxley --upgrade

I also started working on Point 1 (different nseg), but this will still take a few days.

Cheers
Michael

@michaeldeistler michaeldeistler changed the title 1.Can different branch has different nseg? 2.When setting dt !=0.025, traces change a lot. 3.Can init_state() in channel class receive public channel_states as input? Can different branches have a different nseg? Sep 13, 2024
@michaeldeistler
Copy link
Contributor

Hi there, quick update regarding having a different number of nseg per branch. The new version of Jaxley (v0.3.0) supports the following:

comp = jx.Compartment()
branch1 = jx.Branch(comp, nseg=1)
branch2 = jx.Branch(comp, nseg=2)
branch3 = jx.Branch(comp, nseg=4)
cell = jx.Cell([branch1, branch2, branch3], parents=[-1, 0, 0])

Currently, you cannot modify the nseg after initialization, but we are also working on this, see here.

Hope this helps!
Michael

@Tunenip
Copy link
Author

Tunenip commented Oct 5, 2024

Thanks! It really helps a lot!

@michaeldeistler
Copy link
Contributor

This is now finished and release: pip install jaxley --upgrade.

You can set the number of compartment per branch with the set_ncomp() method:

cell.branch.set_ncomp(6)

I will close this issue for now, but please let us know if anything is not working as expected!
Michael

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

No branches or pull requests

2 participants