netmap.downstream.gene_clustering.plot_regression_and_dendrogram

netmap.downstream.gene_clustering.plot_regression_and_dendrogram(df, model, cutoff_distance, correlation_threshold, dist_linkage)[source]

Plot the hierarchical clustering dendrogram alongside the quantile regression fit.

Produces a two-panel figure: the left panel shows the dendrogram with the cut distance marked; the right panel shows the cophenetic/correlation scatter with the fitted quantile regression line and the automatic cutoff lines.

Parameters:
  • df (pd.DataFrame) – Filtered DataFrame with columns 'cophenet' and 'corr' used for the regression (already subset to the linear region by compute_regression()).

  • model – Fitted statsmodels quantile regression result object with a predict method and a params attribute.

  • cutoff_distance (float or None) – Horizontal/vertical cutoff lines drawn on both panels. Skipped if None.

  • correlation_threshold (float) – Horizontal dashed line drawn on the regression panel to mark the target correlation level.

  • dist_linkage – Linkage matrix passed to scipy.cluster.hierarchy.dendrogram.

Returns:

Displays the figure via plt.show().

Return type:

None