File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -1011,6 +1011,21 @@ def make(self, key):
1011
1011
zip (* electrode_query .fetch ("channel" , "electrode" ))
1012
1012
)
1013
1013
1014
+ # Get unit id to quality label mapping
1015
+ cluster_quality_label_map = {}
1016
+ try :
1017
+ cluster_quality_label_map = pd .read_csv (
1018
+ sorting_dir / "sorter_output" / "cluster_KSLabel.tsv" ,
1019
+ delimiter = "\t " ,
1020
+ )
1021
+ cluster_quality_label_map : dict [
1022
+ int , str
1023
+ ] = cluster_quality_label_map .set_index ("cluster_id" )[
1024
+ "KSLabel"
1025
+ ].to_dict () # {unit: quality_label}
1026
+ except FileNotFoundError :
1027
+ pass
1028
+
1014
1029
# Get channel to electrode mapping
1015
1030
channel2depth_map = dict (zip (* electrode_query .fetch ("channel" , "y_coord" )))
1016
1031
@@ -1038,7 +1053,9 @@ def make(self, key):
1038
1053
units .append (
1039
1054
{
1040
1055
"unit" : unit_id ,
1041
- "cluster_quality_label" : "n.a." ,
1056
+ "cluster_quality_label" : cluster_quality_label_map .get (
1057
+ unit_id , "n.a."
1058
+ ),
1042
1059
"spike_times" : si_sorting .get_unit_spike_train (
1043
1060
unit_id , return_times = True
1044
1061
),
You can’t perform that action at this time.
0 commit comments