Hi @anilbey,
I've encountered some challenges while stimulating Excitatory Plastic cells with the GluSynapse mechanism on the SSCx_plasticity circuit. Specifically, I selected a L5_TPC cell and transitioned its synapses to GluSynapse using the modoverride function. However, during the cell initialization process, I was met with an error indicating a missing parameter within the GluSynapse mechanism.
Could you kindly assist me in addressing this issue?
For your reference, I've attached the simulation configuration and a snippet of the node_set to this ticket. Your assistance would be greatly appreciated. Thank you in advance!
Python snippet:
import neuron
neuron.h.nrnunit_use_legacy(True)
neuron.load_mechanisms("./circuit_sonata/")
from bluecellulab import SSim
cfg_json = "/path-to-cfg/simulation_config.json"
sim = SSim(cfg_json,print_cellstate=True)
cell_id = 170923
pre_gid = ('S1nonbarrel_neurons', 170983)
sim.instantiate_gids([('S1nonbarrel_neurons',cell_id)], add_synapses=True, pre_spike_trains={pre_gid: [1000.]}, intersect_pre_gids=[pre_gid])
t_stop = 2000.0
sim.run(t_stop)
Bug Trace:
---------------------------------------------------------------------------
BluepySnapError Traceback (most recent call last)
(ssim_bluecellulab_L5.ipynb) Cell 1 line 3
---> [35](L5TTPC_L5TTPC/138728-158705/ssim_bluecellulab_L5.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=34) sim.instantiate_gids([('S1nonbarrel_neurons',cell_id)], add_synapses=True,
[36](ssim_bluecellulab_L5.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=35) pre_spike_trains={pre_gid: [1000.]},
[37](ssim_bluecellulab_L5.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=36) intersect_pre_gids=[pre_gid])
[38](ssim_bluecellulab_L5.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=37) t_stop = 2000.0
[39](ssim_bluecellulab_L5.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=38) sim.run(t_stop)
File [---/BlueCelluLab/bluecellulab/ssim.py:255), in SSim.instantiate_gids(self, cells, add_replay, add_stimuli, add_synapses, add_minis, add_noise_stimuli, add_hyperpolarizing_stimuli, add_relativelinear_stimuli, add_pulse_stimuli, add_projections, intersect_pre_gids, interconnect_cells, pre_spike_trains, add_shotnoise_stimuli, add_ornstein_uhlenbeck_stimuli)
253 self._add_cells(cell_ids)
254 if add_synapses:
--> 255 self._add_synapses(
256 pre_gids=pre_gids,
257 add_minis=add_minis,
258 projections=projections)
259 if add_replay or interconnect_cells or pre_spike_trains:
260 if add_replay and not add_synapses:
File [---/BlueCelluLab/bluecellulab/ssim.py:368), in SSim._add_synapses(self, pre_gids, add_minis, projections)
366 """Instantiate all the synapses."""
367 for cell_id in self.cells:
--> 368 self._add_cell_synapses(
369 cell_id, pre_gids=pre_gids,
370 add_minis=add_minis,
371 projections=projections)
File [---/BlueCelluLab/bluecellulab/ssim.py:376), in SSim._add_cell_synapses(self, cell_id, pre_gids, add_minis, projections)
373 def _add_cell_synapses(
374 self, cell_id: CellId, pre_gids=None, add_minis=False, projections=None
375 ) -> None:
--> 376 syn_descriptions = self.get_syn_descriptions(
377 cell_id, projections=projections)
379 if pre_gids is not None:
380 if self.circuit_format == CircuitFormat.SONATA:
File [---/BlueCelluLab/bluecellulab/ssim.py:429), in SSim.get_syn_descriptions(self, cell_id, projections)
427 syn_description_builder = bluecellulab.synapse.SynDescription()
428 if self.circuit_access.config.is_glusynapse_used:
--> 429 return syn_description_builder.glusynapse_syn_description(
430 self.circuit_access,
431 cell_id,
432 projections,
433 )
434 else:
435 return syn_description_builder.gabaab_ampanmda_syn_description(
436 self.circuit_access,
437 cell_id,
438 projections,
439 )
File [---/BlueCelluLab/bluecellulab/synapse/synapse_params.py:54), in SynDescription.glusynapse_syn_description(self, circuit, gid, projections)
50 glusynapse_only_properties = [
51 "volume_CR", "rho0_GB", "Use_d_TM", "Use_p_TM", "gmax_d_AMPA",
52 "gmax_p_AMPA", "theta_d", "theta_p"]
53 all_properties = self.common_properties + glusynapse_only_properties
---> 54 return circuit.extract_synapses(gid, all_properties, projections)
File [---/BlueCelluLab/bluecellulab/circuit/circuit_access.py:664), in SonataCircuitAccess.extract_synapses(self, cell_id, properties, projections)
662 print(snap_properties)
663 print(afferent_edges)
--> 664 synapses: pd.DataFrame = edge.get(afferent_edges, snap_properties)
665 column_names = list(synapses.columns)
666 synapses.columns = pd.Index(properties_from_snap(column_names))
File [---/site-packages/bluepysnap/edges/edge_population.py:306), in EdgePopulation.get(self, edge_ids, properties)
304 edge_ids = self.ids(edge_ids)
305 selection = libsonata.Selection(edge_ids)
--> 306 return self._get(selection, properties)
File [---/site-packages/bluepysnap/edges/edge_population.py:195), in EdgePopulation._get(self, selection, properties)
193 result = pd.DataFrame(index=edge_ids)
194 for p in properties:
--> 195 result[p] = self._get_property(p, selection)
196 else:
197 if len(edge_ids) == 0:
File [---/site-packages/bluepysnap/edges/edge_population.py:176), in EdgePopulation._get_property(self, prop, selection)
172 result = self._population.get_dynamics_attribute(
173 prop.split(DYNAMICS_PREFIX)[1], selection
174 )
175 else:
--> 176 raise BluepySnapError(f"No such property: {prop}")
177 return result
BluepySnapError: No such property: volume_CR
node_set snippet to add cells:
{
"test_circuit": {
"node_id": [
170923,
170982
],
"population": "S1nonbarrel_neurons"
},
Simulation_config.json
{
"manifest": {
"$CURRENT_DIR": "."
},
"run": {
"dt": 0.025,
"tstop": 2000.0,
"random_seed": 12345
},
"conditions": {
"extracellular_calcium": 2.0,
"v_init": -80.0,
"spike_location": "AIS",
"mechanisms": {
"ProbAMPANMDA_EMS": {
"init_depleted": true,
"minis_single_vesicle": true
},
"ProbGABAAB_EMS": {
"init_depleted": true,
"minis_single_vesicle": true
},
"GluSynapse": {
"init_depleted": false,
"minis_single_vesicle": true,
"cao_CR": 2.0
}
}
},
"target_simulator": "CORENEURON",
"network": "/path-to-cfg/circuit_config.json",
"node_sets_file": "./node_sets.json",
"node_set": "test_circuit",
"output": {
"output_dir": "./reporting",
"spikes_file": "out.h5"
},
"reports": {
"soma": {
"cells": "hex_O1ExcitatoryPlastic",
"type": "compartment",
"variable_name": "v",
"unit": "mV",
"dt": 1.0,
"start_time": 0.0,
"end_time": 122500.0
},
"rho": {
"cells": "hex_O1ExcitatoryPlastic",
"type": "synapse",
"sections": "all",
"variable_name": "GluSynapse.rho_GB",
"unit": "nd",
"dt": 0.025,
"start_time": 0.0,
"end_time": 122500.0
},
"effcai_GB": {
"cells": "hex_O1ExcitatoryPlastic",
"type": "synapse",
"sections": "all",
"variable_name": "GluSynapse.effcai_GB",
"unit": "mM",
"dt": 0.025,
"start_time": 0.0,
"end_time": 122500.0
}
},
"inputs": {
"s1_syns_spikes": {
"node_set": "hex_O1ExcitatoryPlastic",
"input_type": "spikes",
"delay": 0.0,
"duration": 2000.0,
"module": "synapse_replay",
"spike_file": "./input_spikes/s1_syn_spikes.dat",
"source": "hex_O1"
}
},
"connection_overrides": [
{
"name": "plasticity",
"source": "hex_O1Excitatory",
"target": "hex_O1Excitatory",
"modoverride": "GluSynapse",
"weight": 1.0
},
{
"name": "init",
"source": "hex_O1",
"target": "hex_O1",
"spont_minis": 0.0,
"weight": 1.0
},
{
"name": "VPM_init",
"source": "proj_Thalamocortical_VPM_Source",
"target": "hex_O1",
"spont_minis": 0.0,
"weight": 1.0
},
{
"name": "POm_init",
"source": "proj_Thalamocortical_POM_Source",
"target": "hex_O1",
"spont_minis": 0.0,
"weight": 1.0
},
{
"name": "Make_Use_1",
"source": "hex_O1",
"target": "hex_O1",
"synapse_configure": "%s.Use = 1 %s.Use_GB = 1 %s.Use_p = 1 %s.gmax0_AMPA = gmax_p_AMPA %s.rho_GB = 1 %s.rho0_GB = 1 %s.gmax_AMPA = %s.gmax_p_AMPA"
}
]
}