zhengrongbin / MEBOCOST

A python-based package and software to predict metabolite mediated cell-cell communications by single-cell RNA-seq data
BSD 3-Clause "New" or "Revised" License
63 stars 10 forks source link

'ERROR: #25

Closed seekning closed 2 months ago

seekning commented 3 months ago

thank you so much for providing so good package!!! when running this :

circle plot to show communications between cell groups

mebo_obj.commu_network_plot( sender_focus=[], metabolite_focus=[], sensor_focus=[], receiver_focus=[], and_or='and', pval_method='permutation_test_fdr', pval_cutoff=0.05, node_cmap='tab20', figsize=(6.1, 3.5), line_cmap='bwr', line_color_vmin=None, line_color_vmax=None, linewidth_norm=(0.2, 1), node_size_norm=(50, 200), adjust_text_pos_node=True, node_text_hidden = False, node_text_font=10, save=None, show_plot=T, comm_score_col='Commu_Score', comm_score_cutoff=0.1, text_outline=True, return_fig=False )

it appears that : ValueError Traceback (most recent call last) Cell In[17], line 2 1 ## circle plot to show communications between cell groups ----> 2 mebo_obj.commu_network_plot( 3 sender_focus=[], 4 metabolite_focus=[], 5 sensor_focus=[], 6 receiver_focus=[], 7 and_or='and', 8 pval_method='permutation_test_fdr', 9 pval_cutoff=0.05, 10 node_cmap='tab20', 11 figsize='auto', 12 line_cmap='bwr', 13 line_color_vmin=None, 14 line_color_vmax=None, 15 linewidth_norm=(0.2, 1), 16 node_size_norm=(50, 200), 17 adjust_text_pos_node=True, 18 node_text_hidden = False, 19 node_text_font=10, 20 save=None, 21 show_plot=True, 22 comm_score_col='Commu_Score', 23 comm_score_cutoff=0, 24 text_outline=True, 25 return_fig=False 26 ) 28 ### the "overall score" represent the sum of -log10(FDR) of detected metabolite-sensor communications between a pair of cell types

File ~/miniconda3/envs/mebocost/lib/python3.8/site-packages/mebocost-1.0.3-py3.8.egg/mebocost/mebocost.py:1418, in create_obj.commu_network_plot(self, sender_focus, metabolite_focus, sensor_focus, receiver_focus, remove_unrelevant, and_or, pval_method, pval_cutoff, node_cmap, figsize, line_cmap, line_color_vmin, line_color_vmax, linewidth_norm, node_size_norm, adjust_text_pos_node, node_text_hidden, node_text_font, save, show_plot, comm_score_col, comm_score_cutoff, cutoff_prop, text_outline, return_fig) 1415 else: 1416 Pdf = None -> 1418 fig = CP._commu_networkplot(commu_res=comm_res, sender_focus = sender_focus, metabolite_focus = metabolite_focus, 1419 sensor_focus = sensor_focus, receiver_focus = receiver_focus, and_or = and_or, 1420 pval_method = pval_method, 1421 pval_cutoff = pval_cutoff, node_cmap = node_cmap, figsize = figsize, line_cmap = line_cmap, 1422 line_color_vmin = line_color_vmin, line_color_vmax = line_color_vmax, 1423 linewidth_norm = linewidth_norm, node_text_hidden = node_text_hidden, 1424 node_size_norm = node_size_norm, adjust_text_pos_node = adjust_text_pos_node, 1425 comm_score_col = comm_score_col, comm_score_cutoff = comm_score_cutoff, cutoff_prop = cutoff_prop, 1426 node_text_font = node_text_font, pdf = Pdf, show_plot = show_plot, text_outline = text_outline, 1427 return_fig = return_fig) 1428 if save is not None and save is not False and isinstance(save, str): 1429 Pdf.close()

File ~/miniconda3/envs/mebocost/lib/python3.8/site-packages/mebocost-1.0.3-py3.8.egg/mebocost/crosstalk_plots.py:929, in _commu_networkplot(commu_res, sender_focus, metabolite_focus, sensor_focus, receiver_focus, remove_unrelevant, and_or, pval_method, pval_cutoff, node_cmap, figsize, line_cmap, line_color_vmin, line_color_vmax, line_width_col, linewidth_norm, node_size_norm, adjust_text_pos_node, node_text_hidden, node_text_font, pdf, save_plot, show_plot, comm_score_col, comm_score_cutoff, cutoff_prop, text_outline, return_fig) 927 sm = matplotlib.cm.ScalarMappable(cmap=plt.cm.get_cmap(line_cmap), norm = edge_color_norm) 928 sm.set_array([]) --> 929 cbar = plt.colorbar(sm, shrink = .5, location = 'left') 930 cbar.set_label(label='Overall Score',fontsize = 10) 931 rightfig.axis('off')

File ~/miniconda3/envs/mebocost/lib/python3.8/site-packages/matplotlib/pyplot.py:2053, in colorbar(mappable, cax, ax, kwargs) 2048 if mappable is None: 2049 raise RuntimeError('No mappable was found to use for colorbar ' 2050 'creation. First define a mappable such as ' 2051 'an image (with imshow) or a contour set (' 2052 'with contourf).') -> 2053 ret = gcf().colorbar(mappable, cax=cax, ax=ax, kwargs) 2054 return ret

File ~/miniconda3/envs/mebocost/lib/python3.8/site-packages/matplotlib/figure.py:1256, in FigureBase.colorbar(self, mappable, cax, ax, use_gridspec, *kwargs) 1254 if cax is None: 1255 if ax is None: -> 1256 raise ValueError( 1257 'Unable to determine Axes to steal space for Colorbar. ' 1258 'Either provide the cax argument to use as the Axes for ' 1259 'the Colorbar, provide the ax argument to steal space ' 1260 'from it, or add mappable* to an Axes.') 1261 current_ax = self.gca() 1262 userax = False

ValueError: Unable to determine Axes to steal space for Colorbar. Either provide the cax argument to use as the Axes for the Colorbar, provide the ax argument to steal space from it, or add mappable to an Axes.

could you please help to find where the bug is?thank you so much for making progress for all the humanbeing>_<