AliClu - Temporal sequence alignment for clustering longitudinal clinical data

Kishan Rama, Helena Canhão, Alexandra M. Carvalho, Susana Vinga

Research output: Contribution to journalArticlepeer-review

1 Citation (Scopus)
19 Downloads (Pure)


BACKGROUND: Patient stratification is a critical task in clinical decision making since it can allow physicians to choose treatments in a personalized way. Given the increasing availability of electronic medical records (EMRs) with longitudinal data, one crucial problem is how to efficiently cluster the patients based on the temporal information from medical appointments. In this work, we propose applying the Temporal Needleman-Wunsch (TNW) algorithm to align discrete sequences with the transition time information between symbols. These symbols may correspond to a patient's current therapy, their overall health status, or any other discrete state. The transition time information represents the duration of each of those states. The obtained TNW pairwise scores are then used to perform hierarchical clustering. To find the best number of clusters and assess their stability, a resampling technique is applied. RESULTS: We propose the AliClu, a novel tool for clustering temporal clinical data based on the TNW algorithm coupled with clustering validity assessments through bootstrapping. The AliClu was applied for the analysis of the rheumatoid arthritis EMRs obtained from the Portuguese database of rheumatologic patient visits ( In particular, the AliClu was used for the analysis of therapy switches, which were coded as letters corresponding to biologic drugs and included their durations before each change occurred. The obtained optimized clusters allow one to stratify the patients based on their temporal therapy profiles and to support the identification of common features for those groups. CONCLUSIONS: The AliClu is a promising computational strategy to analyse longitudinal patient data by providing validated clusters and by unravelling the patterns that exist in clinical outcomes. Patient stratification is performed in an automatic or semi-automatic way, allowing one to tune the alignment, clustering, and validation parameters. The AliClu is freely available at

Original languageEnglish
Article number289
Number of pages1
JournalBMC Medical Informatics and Decision Making
Issue number1
Publication statusPublished - 30 Dec 2019


  • Bootstrap
  • Clustering
  • clustering indices
  • Temporal sequence alignment


Dive into the research topics of 'AliClu - Temporal sequence alignment for clustering longitudinal clinical data'. Together they form a unique fingerprint.

Cite this