@@ -130,11 +130,11 @@ def fig_02d_01(save_path, plot=False):
130130 plt .close ()
131131
132132
133- def fig_02d_02 (save_path , plot = False ):
133+ def fig_02d_02 (save_path , filter_zeros = True , plot = False ):
134134 """Bar plot showing the distribution of synapse markers per IHC segmentation average over multiple clochleae.
135135 """
136136 cochleae = ['M_LR_000226_L' , 'M_LR_000226_R' , 'M_LR_000227_L' , 'M_LR_000227_R' ]
137- ihc_version = "ihc_counts_v4 "
137+ ihc_version = "ihc_counts_v4c "
138138 synapse_dir = f"/mnt/vast-nhr/projects/nim00007/data/moser/cochlea-lightsheet/predictions/synapses/{ ihc_version } "
139139
140140 max_dist = 3
@@ -147,6 +147,8 @@ def fig_02d_02(save_path, plot=False):
147147 synapse_file = os .path .join (synapse_dir , f"ihc_count_{ cochlea } .tsv" )
148148 ihc_table = pd .read_csv (synapse_file , sep = "\t " )
149149 syn_per_ihc = list (ihc_table ["synapse_count" ])
150+ if filter_zeros :
151+ syn_per_ihc = [s for s in syn_per_ihc if s != 0 ]
150152 results .append (syn_per_ihc )
151153
152154 results = [np .clip (r , 0 , cap ) for r in results ]
@@ -187,7 +189,10 @@ def fig_02d_02(save_path, plot=False):
187189
188190 plt .xticks (x_ticks , fontsize = main_tick_size )
189191 plt .yticks (y_ticks , fontsize = main_tick_size )
190- plt .ylabel ('Proportion of IHCs [%]' , fontsize = main_label_size )
192+ if plot_density :
193+ plt .ylabel ('Proportion of IHCs [%]' , fontsize = main_label_size )
194+ else :
195+ plt .ylabel ('Number of IHCs' , fontsize = main_label_size )
191196 plt .xlabel (f"Ribbon Synapses per IHC @ { max_dist } µm" , fontsize = main_label_size )
192197
193198 plt .title ('Average Synapses per IHC for a Dataset of 4 Cochleae' )
0 commit comments