IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
IOStream.flush timed out
def get_bokeh_plot(embedding, selectidx, clusteridx, trait_df, umap_string, color_palette = hex_colors_40): plot_dict =dict( x = embedding[selectidx, 0], y = embedding[selectidx, 1], trait_type_code = [f"{x}"for x in clusteridx], h2_alpha = [min(0.6, 10* x) for x in trait_df['estimates.final.h2_observed'].fillna(1e-6).tolist()], fulldesc = [f"{i} | {trait_df.loc[i, 'short_description']} | {trait_df.loc[i, 'estimates.final.h2_observed']:.3f} | {trait_df.loc[i, 'Neff']:.2f}"for i in selectidx], ) color_mapping = CategoricalColorMapper(factors = [f"{x}"for x in np.unique(clusteridx)], palette = color_palette) plot_tooltips = [ ("Desc", "@fulldesc"), ] ax = bokeh_figure( width =800, height =800, tooltips = plot_tooltips, title = umap_string , ) ax.circle('x', 'y', size =10, source = ColumnDataSource(plot_dict), color =dict(field='trait_type_code', transform = color_mapping), line_alpha =dict(field='h2_alpha'), fill_alpha =dict(field='h2_alpha'), ) ax.title.text_font_size ='20pt' ax.axis.major_label_text_font_size ='20pt' ax.axis.axis_line_width =2 ax.axis.major_tick_line_width =2 ax.grid.visible =Falsereturn ax
Code
selectidx = np.array(trait_df.index)clusteridx = get_llm_cluster_index(selectidx, "ls-da3m0ns/bge_large_medical", "kmeans")axlist = [get_bokeh_plot(embedding, selectidx, clusteridx, trait_df, metric) for metric, embedding in umap_embeddings.items()]# put all the plots in a VBoxp = bokeh_column(*axlist)# show the resultsbokeh_show(p)