You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to plot mutation and other categorical data. I'm not able to use the sample order. I use object type but not working this is the code and the error:
sample_order=list(all_plusrna['ID'])
sample_order
['Sample361',
'Sample671',
'Sample646',
'Sample677',
'Sample675',
'Sample662']
aut_comut = comut.CoMut()
# define order of comut BEFORE any data is added
aut_comut.samples = sample_order
aut_comut.add_categorical_data(mut2, name='Mutation')
aut_comut.plot_comut()
typeError: 'int' object is not iterable
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/tmp/ipykernel_3276/2140078995.py in <module>
4 aut_comut.add_categorical_data(mut2, name='Mutation')
5
----> 6 aut_comut.plot_comut()
~/anaconda3/envs/beatrix/lib/python3.9/site-packages/comut/comut.py in plot_comut(self, fig, spec, x_padding, y_padding, tri_padding, heights, hspace, subplot_hspace, widths, wspace, structure, figsize)
1496 plot_name = plot[0]
1497 ax = fig.add_subplot(spec[num_subplots - i - 1, comut_idx], sharex=sharex)
-> 1498 ax = self._plot_data_on_axis(ax=ax, plot_name=plot_name, x_padding=x_padding, y_padding=y_padding, tri_padding=tri_padding)
1499
1500 # extract all sideplots on this axis
~/anaconda3/envs/beatrix/lib/python3.9/site-packages/comut/comut.py in _plot_data_on_axis(self, ax, plot_name, x_padding, y_padding, tri_padding)
1188 borders = self._plots[plot_name]['borders'] if plot_type == 'categorical' else []
1189 tick_style = self._plots[plot_name]['tick_style']
-> 1190 ax = self._plot_patch_data(ax=ax, data=data, name=plot_name, mapping=mapping, borders=borders,
1191 x_padding=x_padding, y_padding=y_padding, tri_padding=tri_padding,
1192 tick_style=tick_style)
~/anaconda3/envs/beatrix/lib/python3.9/site-packages/comut/comut.py in _plot_patch_data(self, ax, data, name, mapping, borders, tick_style, x_padding, y_padding, tri_padding)
731 x_base, y_base = j + x_padding, i + y_padding
732
--> 733 cell_tuple = tuple(data.iloc[i, j])
734
735 # remove box borders from cell tuple
TypeError: 'int' object is not iterable
I would like to plot mutation and other categorical data. I'm not able to use the sample order. I use object type but not working this is the code and the error:
I use this version:
The text was updated successfully, but these errors were encountered: