tirank.Visualization.plot_genepair

tirank.Visualization.plot_genepair(df, data_type, savePath=None)[source]

Plots and saves a clustered heatmap of a gene-pair matrix.

If the input DataFrame has more rows than columns, it is sampled to be square. Hierarchical clustering (‘average’ linkage, ‘euclidean’ metric) is then applied to both rows and columns, and the resulting reordered DataFrame is plotted as a heatmap.

Parameters:
  • df (pd.DataFrame) – The gene-pair DataFrame (e.g., samples vs. gene-pairs).

  • data_type (str) – A string identifier (e.g., “bulk”, “sc”) used to name the output file.

  • savePath (str, optional) – The root directory containing the ‘2_preprocessing’ subfolder where the plot will be saved. Defaults to None.

Returns:

None