@@ -27,8 +27,15 @@ def curated_clusterings_to_nwb(curated_clustering_keys, nwbfile):
2727 ecephys_module = nwbfile .create_processing_module (name = 'ecephys' ,
2828 description = 'preprocessed ephys data' )
2929
30+ # add additional columns to the electrodes table
31+ electrodes_query = probe .ProbeType .Electrode * probe .ElectrodeConfig .Electrode
32+ for additional_attribute in ['shank' , 'shank_col' , 'shank_row' ]:
33+ nwbfile .add_electrode_column (
34+ name = electrodes_query .heading .attributes [additional_attribute ].name ,
35+ description = electrodes_query .heading .attributes [additional_attribute ].comment )
36+
3037 # add additional columns to the units table
31- units_query = ( ephys .EphysRecording * ephys .ClusteringTask @ ephys .CuratedClustering .Unit )
38+ units_query = ephys .EphysRecording * ephys .ClusteringTask @ ephys .CuratedClustering .Unit
3239 for additional_attribute in ['cluster_quality_label' , 'spike_count' , 'sampling_rate' ,
3340 'spike_times' , 'spike_sites' , 'spike_depths' ]:
3441 nwbfile .add_unit_column (
@@ -68,11 +75,6 @@ def curated_clusterings_to_nwb(curated_clustering_keys, nwbfile):
6875
6976 electrode_query = (probe .ProbeType .Electrode * probe .ElectrodeConfig .Electrode
7077 & electrode_config )
71- for additional_attribute in ['shank' , 'shank_col' , 'shank_row' ]:
72- nwbfile .add_electrode_column (
73- name = electrode_query .heading .attributes [additional_attribute ].name ,
74- description = electrode_query .heading .attributes [additional_attribute ].comment )
75-
7678 for electrode in electrode_query .fetch (as_dict = True ):
7779 nwbfile .add_electrode (
7880 id = electrode ['electrode' ], group = electrode_group ,
0 commit comments