Motif discovery and binding-site prediction in DNA and RNA are central tasks in regulatory genomics, but the methodological landscape is split between interpretable but rigid position weight matrices (PWMs) and high-performing but opaque machine-learning models.
KDM is a unifying framework in which both motifs and sequences are represented as probability distributions over a shared k-mer dictionary, embedded via the Hellinger transformation. This common geometry enables motif–sequence scoring, motif–motif comparison, de novo discovery and binding prediction with a single primitive: the Bhattacharyya coefficient.
A collaborative project with the Pozzoli lab @ Scientific Institute IRCCS E. Medea.
Four tools are instantiated on this representation:
| Tool | Purpose |
|---|---|
KDMFind | Unsupervised de novo motif discovery via projective non-negative matrix factorization (PNMF) |
KDMMap | Positional Enrichment (PE) and Class Enrichment (CE) of motifs in labelled sequences |
KDMMatch | Information-content-aware motif matching / annotation |
KDM-LRLM | Binding prediction with Lasso-regularized logistic regression |
Represent — known motifs (via PWM2KDM) and positive/negative
sequence sets (via k-mer encoding) enter the same pipeline. Embed — both become
distributions over the dictionary D, Hellinger-embedded as motif matrix W and
sequence matrix V. Compare, score, discover, predict — a single
primitive, the Bhattacharyya coefficient BC = WTV, serves all four tools.
All the methods are implemented in a C++ library. We provide an R package as a wrapper.
⚠️ The current versions are those used in the paper. Both the library and the package are still under development to provide full access to all the functions and related parameters.
The functions in this tutorial are a simplified interface to the KDM library. To reproduce the results reported in the paper, use the scripts in
CODE/R-SCRIPTSof the GitHub repository, where cross-validation folds are fixed within the datasets. Numbers obtained with this tutorial may therefore differ slightly from those in the paper.
The pages below follow a single worked example end to end — discovering the motifs bound by NRF1 from a set of bound and unbound sequences, annotating them, and training a predictive model.
KDMDictionary, k-mer length, gaps, strandednesstrain/test and pseq/nseq layoutKDMFind and the kdmotifs objectKDMMap, KDMMatch and buildKDMReferenceKDM.LRLM training, evaluation and predictionKDMDictionary() # 1. choose the k-mer space
readRDS() # 2. load bound (pseq) and unbound (nseq) sequences
KDMFind() # 3. discover motifs de novo
KDMMap() # 4. where are they, and are they enriched?
KDMMatch() # 5. what known factors do they correspond to?
KDM.LRLM.train() # 6. build a predictive model
KDM.LRLM.performance() # 7. evaluate it on held-out sequences