Skip to content
Legendrea edited this page Oct 6, 2025 · 22 revisions

Welcome to the Phylogenetic-tree-study wiki!

Table of Contents

1 What we’re doing

We compare 16S rRNA “barcodes” from ~30 bacteria and archaea.
Some stretches of the barcode never change (great anchor points), others change a lot (great for telling bugs apart).
Finding out which is which helps with things like CRISPR diagnostics or editing.


2 Key things we’ve learned so far

# Take-away In everyday words
1 Mixing classic and ML trees We build family trees the traditional way and run unsupervised-learning to double-check who’s related.
2 Bigger, messier dataset The study grew from 6 to 30 drug-resistant clinical bugs—real-world chaos included.
3 Motif hunting with MEME We spotted repeating patterns: one looks like a “staple” from a jumping gene (transposase), the other is a universal 16S stripe.
4 Therapy angle (early days) Those patterns could be CRISPR bullseyes, but we still have to prove they aren’t everywhere we don’t want to cut.
5 Cosine-similarity map (new!) See Section 3—turns counts of tiny DNA words into a colour map that shows who’s almost identical, who’s miles apart.

3 Behind the scenes — cosine_similarity.ipynb

“Think of each genome as a bag of tiny LEGO bricks (k-mers).
Cosine similarity asks: do two bugs have bricks in the same proportions?”

Step-by-step, minus the code:

  1. Load sequences – grabs the same FASTA file used elsewhere.
  2. Break into k-mers (k = 6) – slides a 6-letter window, counts how many times each “brick” shows up.
  3. Vectorise – every sample becomes a long row of numbers (brick counts).
  4. Cosine similarity – measures the angle between two rows.
    • 0° = identical bug patterns (cosine = 1)
    • 90° = completely unrelated bugs (cosine = 0)
    • 180° = opposite bug patterns (cosine = -1)
  5. Plot a tree-diagrams – if you are in the same clade we are related. The bigger the U formed the further we are related.
    "In phylogenetic trees, organisms in the same clade are related through common ancestry. The deeper the branching point (common ancestor), the more distantly related the organisms are."

Visual clarification:

   A ─┐
      ├─── closer relationship (shallow branching)
   B ─┘

   C ─┐
      │
      ├─── more distant relationship (deeper branching)
      │
   D ─┘

Why it’s handy

  • Fast sanity check before diving into heavier phylogeny tools.
  • Highlights oddballs (outliers pop out as lonely blue rows).
  • Pairs well with motifs – we can ask if shared motifs track with cosine clusters.

*(Open the notebook in Jupyter or Colab to see the full code and figure) – file path: cosine_similarity.ipynb


4 Next on the radar

  • Swap 6-mers for DNA-BERT embeddings and compare results.
  • Mask the transposase-like motif and rerun cosine similarity—does clustering change?
  • Feed the similarity matrix into UMAP for a 2-D “map” of our bugs.

5 FAQ — plain talk & analogies

What is a phylogenetic tree? A family tree for microbes or genes. Close branches = close relatives.
What is antimicrobial resistance (AMR)? Like weeds that laugh at weed-killer, some bacteria shrug off antibiotics.
What are nitrogenous bases? DNA/RNA is a zipper with four coloured teeth: A, T (or U), G, C. The colour pattern is the code.
Why 16S rRNA? It’s a grocery-store barcode: short, easy to scan, parts never change, parts do—perfect for ID.
What do GC and GA content tell me? Tasting soup for salt. Too salty (or not salty enough) hints the recipe comes from somewhere else.
What is a k-mer? Slide a 3-letter window across “HELLO”: HEL, ELL, LLO. Those little chunks are k-mers in DNA.
What is a motif? A catchy riff that pops up in many songs. In DNA, it’s a short pattern that repeats because it matters.
Define gene therapy. Fixing a typo in the body’s instruction manual so the machine runs better.
What is CRISPR? GPS-guided scissors that snip DNA at the address you type in.
Paralogous vs. orthologous genes? Paralogues = twin copies born inside one genome. Orthologues = cousins in different species.

Credit:

Last updated 2025-10-06