@@ -153,16 +153,26 @@ def fig_06e_octave(otof_data, save_path, plot=False, use_alias=True, trendline_m
153153 color_dict [alias ] = COCHLEAE_DICT [name ]["color" ]
154154 if mapping == "default" :
155155 freq = values ["frequency[kHz]" ].values
156+ bin_edges , bin_labels = None , None
156157 elif mapping == "mueller" :
157158 freq = values ["frequency-mueller[kHz]" ].values
159+ # We need custom bin edges and bin labels in this case.
160+ bin_edges = [0 , 8 , 12 , 16 , 24 , np .inf ]
161+ bin_labels = [
162+ "4-8" , "8-12" , "12–16" , "16-24" , "24-32"
163+ ]
164+ assert len (bin_edges ) == len (bin_labels ) + 1
158165 else :
159166 raise ValueError ("Choose either 'default' or 'mueller' for tonotopic mapping." )
160167 marker_labels = values ["expression_classification" ].values
161168 marker_pos = len ([1 for i in marker_labels if i == 1 ])
162169 marker_neg = len ([1 for i in marker_labels if i == 2 ])
163170 expression_eff = marker_pos / (marker_pos + marker_neg )
164171 print (f"Cochlea { name } , average expression efficiency { expression_eff } " )
165- octave_binned = frequency_mapping (freq , marker_labels , animal = "mouse" , transduction_efficiency = True )
172+ octave_binned = frequency_mapping (
173+ freq , marker_labels , animal = "mouse" , transduction_efficiency = True ,
174+ bin_edges = bin_edges , bin_labels = bin_labels
175+ )
166176
167177 result ["cochlea" ].extend ([alias ] * len (octave_binned ))
168178 result ["octave_band" ].extend (octave_binned .axes [0 ].values .tolist ())
0 commit comments