{% extends "sharedTemplates/base.html" %} {% block title %}Dendogram{% endblock %} {% block body %}
Dendogram

A dendrogram is a tree-like diagram that shows the arrangement of clusters produced by hierarchical clustering. Each leaf on the right side represents one sample, and branches merge at heights corresponding to the distance (dissimilarity) between clusters. Shorter branch lengths mean samples are more similar. On this page, we cluster samples based on the Jaccard distance between their allele sets, then draw the dendrogram horizontally so you can easily read sample labels and compare branch lengths.

How the Jaccard Distance Works

First, we compute the Jaccard index between two samples A and B:

J(A, B) = |A ∩ B| / |A ∪ B|

This gives a value between 0 (no shared alleles) and 1 (identical allele sets). We then convert it to a distance:

dJ(A, B) = 1 − J(A, B)

A smaller Jaccard distance means the two samples share more alleles, so they cluster closer together in the dendrogram.

Example

Imagine two samples with these allele sets:

  • Sample 1: { A, B, C }
  • Sample 2: { B, C, D, E }
  • Intersection = { B, C } → size = 2
  • Union = { A, B, C, D, E } → size = 5
  • Jaccard index = 2 / 5 = 0.40
  • Jaccard distance = 1 − 0.40 = 0.60

So these two samples have a distance of 0.60, which is the height at which their branches meet in the dendrogram.

Dendrogram

{% for region, dendrogram_div in dendrogram_divs.items() %}

{{ region }}

{{ dendrogram_div|safe }}
{% endfor %} {% endblock %}