Add SONATA point-process cell support - #51
Conversation
The logic for loading from sonata files is to swap out the list of parameters if the BBP TYPE is not present Likewise, when instantiating a synapse object, if no TYPE field is present, assume it is for allen and create a Exp2Syn synapse
…e instantiated. The reporting adds try/except since these don't have a soma
… target point neurons and deliver replay spikes to the proper netcon
Removed call to finalize for point process type cells since this is not needed
Updated allen tests to collection cell_info and get ExpSyn data as consequence
…re netcon code Remove more unused code sections; can be added when use case example is available
Added additional test for invalid Mechanism given to HocPointProcessCell
darshanmandge
left a comment
There was a problem hiding this comment.
Thank you, @jamesgking, for adding this to bluecellulab! I have left some comments.
Refactor to conform better to existing BlueCellulab structures
darshanmandge
left a comment
There was a problem hiding this comment.
Thanks a lot, @jamesgking!
| self, | ||
| cell_id: Optional[CellId], | ||
| mechanism_name: str, | ||
| spike_threshold: float = 1.0, |
There was a problem hiding this comment.
That is a strange default value for spike threshold. Maybe we could use -30.0, as is done in https://github.com/openbraininstitute/BlueCelluLab/blob/main/bluecellulab/cell/core.py#L526
There was a problem hiding this comment.
For point-process cells, spikes are already emitted as events so the threshold is only kept for API compatibility. 0.0 feels like a better neutral default than 1.0 or -30.0.
There was a problem hiding this comment.
Ok, I didn't know that it was different for point process cells. Sounds good then!
| duration = getattr(stimulus, "duration", np.inf) | ||
|
|
||
| spikes_of_interest = spikes_of_interest[ | ||
| (spikes_of_interest >= delay) & (spikes_of_interest <= duration) |
There was a problem hiding this comment.
Shouldn't keep spikes between delay and duration + delay? Instead of delay and duration?
There was a problem hiding this comment.
Good catch. This logic exists in core Cell.add_synapse_replay() too but I think it is wrong there as well: duration should be interpreted as a length, so the stop time is delay + duration. I will fix both core.py and point_process.py for consistency.
There was a problem hiding this comment.
If you haven't started, I can do this now. Or maybe you want the change in Cell as a separate commit to make the change easier to track in git history?
| vs = h.VecStim() | ||
| vs.play(vec) | ||
|
|
||
| if self.pointcell is None: |
There was a problem hiding this comment.
We could put this check before the for loop imo
| delay: float # ms | ||
| weight: float # NetCon weight | ||
|
|
||
| # isec: int = -1 |
There was a problem hiding this comment.
Why is this commented out?
This should be removed maybe?
AurelienJaquier
left a comment
There was a problem hiding this comment.
looks good to me!
This PR adds support for SONATA point-process cells.
Point-process cells are instantiated from SONATA model_type = "point_process" and model_template, mapping directly to NEURON point mechanisms defined in HOC/MOD files.
What is included