Log: Pilot for my thesis — a top-down 16S classifier


 

 

So this is the project I'll be living with for a while. Writing down how it started, mostly so future-me remembers why πŸ™‚

How it started

I was doing 16S soil microbiome analysis for a lab. Standard stuff.. figure out who's in the sample and how diverse it is. But I kept hitting the same wall.

Most 16S tools classify a sequence at the species (lowest) rank first, then just push that label upward to genus, family, and so on. Problem is, for diversity work researchers often care most about the higher ranks. And that's exactly where it gets shaky. A big chunk of sequences come back as "unknown" up there.

It bugged me. Biological taxonomy is strictly top-down. Domain, phylum, all the way down to species. So why does the classifier run it backwards?

The idea (my thesis)

That question became my thesis topic. What if we classify the higher rank first and go top-down, the way taxonomy actually works? I'm saving the method details for the paper πŸ˜„ but that's the direction.

The pilot (Spring 2026)

This spring I ran a pilot to see how big this project will be, and if it's actually feasible. Before touching the model, I spent most of my time on one boring thing: not fooling myself with data leakage. >> And when I complained it to ML Prof, Professor was super happy (?), assured me that I'm going right direction.

SILVA NR99 is only deduplicated at 99% identity, so tons of near-duplicate sequences still hang around. If those land in both train and test, your accuracy looks amazing and means nothing. So:

  • Clustered sequences at 95% identity with VSEARCH
  • Split at the cluster level, not the sequence level, so near-duplicates stay on the same side
  • Stratified by genus, with a custom rule for rare genera so every evaluable genus still shows up in train / val / test
  • Fit the k-mer vocabulary on the train split only, then just transformed val/test (no sneaky vocab leakage)

Data prep, It took me 10x times than I thought in the beginning. (Even with this clean!! ready-to-use data set)

 

Results, honestly

The pilot result was... fine. Kind of a wash against the baseline πŸ˜…

But I know why, Here, Things I learned from ML classes are coming together. My train and test were both clean, high-quality reference sequences, and I'd removed all the "unknown" taxa.. which is exactly the messy region where a top-down approach should help. On easy data there's just not much room to win.

I submitted this pilot as a final project for ML class, and Professor commented 'It is way above 10/10 for a semester project'!!!  

Also, I'm still excited.

What I want to try next:

  • Push it to more ranks (start way up at phylum/class), not just two
  • Swap in stronger, SOTA classifiers instead of my simple baseline
  • Test on noisy, real-world reads, where the baseline should actually struggle

If the advantage shows up anywhere, it's there. That's the experiment I can't wait to run πŸš€

More logs coming as I break things. Everything is hard until it's not.. guess that's bioinformatics :)

 

Happy Bioinformatics!  

Comments