Stability-Driven Hierarchical Clustering for Multi-Endpoint Survival Phenotyping

Implements the stability-driven hierarchical clustering framework for multi-endpoint patient phenotyping described in Roy Chowdhury et al., "A stability-driven hierarchical clustering framework for multi-endpoint patient phenotyping in oncology" (submitted to Computers in Biology and Medicine). Provides survival feature-space embedding for multiple time-to-event endpoints, a competing-risks data-generating mechanism for simulation, an exhaustive sweep over valid distance-linkage-K configurations, bootstrap Jaccard cluster-stability assessment, a chaining- artefact diagnostic (Delta_CA), cluster-number selection combining silhouette width, the gap statistic and bootstrap stability, and benchmarking against k-means and Gaussian mixture models.


survPhenoStab

Stability-driven hierarchical clustering for multi-endpoint survival phenotyping in R, implementing the framework from Roy Chowdhury et al., "A stability-driven hierarchical clustering framework for multi-endpoint patient phenotyping in oncology: methodological evaluation and real-data application" (submitted to Computers in Biology and Medicine, CIBM-S-26-03855).

Installation

# install.packages("devtools")
devtools::install_local("survPhenoStab_0.1.0.tar.gz")

What's ported vs. newly written

Function Status
embed_survival() ported from the manuscript's feature-space embedding (Eq. 2)
sim_competing_risks() ported from run_mc_python.py::gen_dataset()
cosine_dist(), cluster_assign(), cluster_configs() ported from run_mc_python.py::cosine_dist_matrix() / cluster_and_assign(); Manhattan distance is added here (see caveat below)
boot_jaccard(), jaccard_per_cluster() ported from jmin_for_config() / jaccard_per_cluster()
silhouette_width() ported from silhouette_score()
logrank_test() ported from logrank_chisq()
chaining_diagnostic() new — Delta_CA = ARI - J_min (Eq. 5), using mclust::adjustedRandIndex() for ARI, which had no implementation in the supplied code
select_k() new — silhouette + gap statistic (cluster::clusGap, one-SE rule) + bootstrap stability curve + 5% minimum cluster size (Section 2.5.5), which had no implementation in the supplied code
benchmark_methods() new — k-means / Gaussian mixture (mclust::Mclust) / Ward-Euclidean comparison (Section 5, Table 6), which had no implementation in the supplied code
mc_replicate() ported from run_mc_python.py's one_replicate() + main loop

Two things this port surfaced in the manuscript

  1. Manhattan distance has no corresponding code in the CBM_Submission zip. cluster_and_assign() in run_mc_python.py only implements 'cosine' and 'euclidean' (it raises ValueError on anything else), yet the manuscript's Table 2 reports concrete Manhattan-distance rows, and Table 2's own footnote states those values (and the single-linkage rows) were "interpolated by their relative ordering at B = 100 sweeps and should be re-run at B = 500 for the final submission." This package's cluster_assign() does implement Manhattan distance (stats::dist(method = "manhattan")), so it can be used to actually compute what the manuscript currently reports as interpolated.

  2. The "9 valid distance-linkage combinations" / "27 configurations" arithmetic does not follow from the manuscript's own stated restriction. Section 2.4 states Ward.D2 is "not combined with non-Euclidean metrics." With 3 distances x 3 linkages (Ward.D2, complete, average), excluding Ward.D2 from both Manhattan and cosine leaves 7 valid pairs, not 9 (9 - 2 = 7), i.e. 21 configurations, not 27. cluster_configs() implements the mathematically consistent 7-pair / 21-configuration grid and documents the discrepancy inline.

Both are worth checking against your LaTeX source before the next revision — independent of the novelty concerns already being addressed.

Reproduction status against the manuscript's published numbers

  • Real-data (colon) results: reproduced almost exactly (cluster sizes identical; log-rank chi-squared within 0.5 of the published 1164.3 / 1072.9). The colon dataset is fixed, so only bootstrap resampling depends on the RNG stream, and that stream differs between R and the original Python/numpy code — hence a small tolerance rather than bit-exact equality.
  • Simulation results: R's RNG stream is entirely different from numpy's, so a single seed does not reproduce the same simulated dataset, and a single-replicate comparison (like the manuscript's Table 2 primary replicate) can and does land on either side of the cosine-average/Ward-Euclidean comparison from run to run — which is exactly the sampling variability the manuscript's own Monte Carlo study documents (delta positive in "only" 88% of replicates). What does reproduce reliably is the manuscript's actual robust claim: averaged over many replicates, cosine-average beats Ward-Euclidean, confirmed by a significant paired Wilcoxon test (see tests/testthat/).

Reproducing the manuscript's headline numbers

library(survPhenoStab)
mc <- mc_replicate(M = 200, n = 518, B = 200, base_seed = 1000)
mc            # compare against mean Delta J_min = 0.152, 88% positive
plot(mc)      # reproduces Figure 2

See vignette("survPhenoStab-intro") for a full walk-through.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("survPhenoStab")

0.1.0 by Oindrila Roy Chowdhury, 15 hours ago


Browse source code at https://github.com/cran/survPhenoStab


Authors: Oindrila Roy Chowdhury [aut, cre] , Bapan Kalita [aut] , Dilip Chandra Nath [aut] , Atanu Bhattacharjee [aut]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports stats, graphics, grDevices, cluster, survival, rmarkdown, utils

Depends on mclust

Suggests testthat, knitr, markdown


See at CRAN