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 bycompute_regression()).model – Fitted
statsmodelsquantile regression result object with apredictmethod and aparamsattribute.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