Closed demian1 closed 12 months ago
Yeah, you are right. Sorry for the mistake. I have already fixed it in the latest GitHub push. Please install it using pip install git+https://github.com/DingWB/PyComplexHeatmap
Please kindly test it and give me feedback if there are any bugs.
Thanks for the quick fix!
I would also recommend the option to pass height_ratios and width_ratios to the function. Something like:
if axis == 1: # horizontally
wspace = col_gap * mm2inch * ax.figure.dpi / (ax.get_window_extent().width / n)
nrows = 1
ncols = n
width_ratios = [cm.data2d.shape[1] for cm in cmlist] if width_ratios is None else width_ratios
height_ratios = None
else: # vertically
hspace = row_gap * mm2inch * ax.figure.dpi / (ax.get_window_extent().height / n)
nrows = n
ncols = 1
width_ratios = None
height_ratios = [cm.data2d.shape[0] for cm in cmlist] if height_ratios is None else height_ratios
I've been playing around with the function on my own data, and it works great so far!
Of course the clustermaps do not align anymore if one provides different number of row or column annotations
That's a good idea. Could you please make a pull request?
Just did
When trying to plot two clustermaps that share one axis, PyComplexHeatmap.clustermap.composite() enforces both column and indexes to be the same as the main cluster map.
This is enforced in the following code:
The parameters
row_order
andcol_order
incm.plot
should be given dynamically depending on whetheraxis = 0
oraxis = 1