Within-motif heterogeneity

Clustering of peaks

Define constants and paths

Helper functions

For plotting and organizing things

Import TF-MoDISco results

Run motif subclustering

Import motif hits

For each motif, determine the peaks that contain it

Within-motif heterogeneity

For each motif, show the subclusters that exist within the TF-MoDISco-identified subpatterns

Peak clustering

For each peak, cluster the peaks by embeddings to highlight the structure of different peaks and different motifs