In my previous post, I explored how Anthropic’s swarm of 950 Claude agents spent 21 hours discovering novel CRISPR-like enzymes. Their revolutionary approach didn’t rely on matching simple sequences of letters, as traditional alignment tools like BLAST searches do. Instead, they treated biology as a language. By converting protein sequences into high-dimensional structural embeddings—mathematical vectors that represent how a protein folds in 3D space—they could identify molecular machines that fold the same way, even if their underlying amino acid “spelling” looks completely unrelated.
Today, my AI agent and I decided to scale up our native PostgreSQL extension, pg_bio, to test this Anthropic-style methodology locally.
The results were mind-blowing. We replicated their core structural discovery pipeline in less than 90 seconds. Here is exactly how we did it, the shape of our data, and the astonishing biological “orphan” we discovered.
The Data: Shaping Biology into PostgreSQL
To do this right, we needed scale. We wrote a high-performance Python streaming pipeline (scripts/stream_uniprot_bulk.py) to chunk and stream the massive Swiss-Prot dataset (575,747 manually annotated proteins) directly into our local database.
The shape of the data is where pg_bio shines. Instead of having messy CSVs or FASTA files scattered across a hard drive, everything is centralized using native SQL types:
CREATE TABLE proteins (
uniprot_id VARCHAR(15) PRIMARY KEY,
name TEXT NOT NULL,
sequence TEXT NOT NULL,
-- Here is the magic: ESM-2 structural embeddings stored natively
embedding vector(1280) NOT NULL
);
-- We also store 3D spatial representations using Morton Z-Order Curves
CREATE TABLE protein_attention_maps (
uniprot_id VARCHAR(15) REFERENCES proteins(uniprot_id),
residue_indices INTEGER[],
attention_weights REAL[]
);
By storing the structural embeddings as vector(1280), we can natively leverage pgvector. We built a Hierarchical Navigable Small World (HNSW) index over the entire half-a-million protein dataset. This index allows PostgreSQL to calculate graph-based K-Nearest Neighbors (KNN) in milliseconds, mapping out the shape of these proteins in complex 1280-dimensional space, rather than taking hours to sequentially compare them.
The Approach: Batch De-Orphanization
In biology, an orphan protein is one that lacks identifiable relatives—or homologs—across other species. It exists in isolation, leaving scientists to puzzle over its evolutionary origins. Often, genes might exist in the same chromosomal neighborhood across species (a phenomenon called synteny), but if their sequences drift too far apart, traditional sequence-based tools like BLAST won’t catch the relationship.
Anthropic’s agents tackled this problem by taking known CRISPR targets and testing them against massive metagenomic databases of uncharacterized environmental samples. We built a batch_deorphanizer.py script to do the exact same thing using pure SQL. Our script dynamically queries the database for all known CRISPR proteins, and then fires an ultra-fast HNSW vector query against the “Dark Proteome”—the 16,300+ proteins in our Swiss-Prot database whose function is completely labeled as Uncharacterized or Hypothetical.
Here is the exact SQL query we used to mathematically bridge the gap between known science and the unknown:
WITH target AS (
SELECT embedding as emb
FROM proteins
WHERE uniprot_id = %s -- (e.g., a known Cas9 protein)
)
SELECT
p.uniprot_id,
p.name,
(p.embedding <=> t.emb) as distance
FROM proteins p, target t
WHERE (p.name ILIKE '%uncharacterized%' OR p.name ILIKE '%hypothetical%')
ORDER BY p.embedding <=> t.emb ASC
LIMIT 1;
Because of the HNSW index, PostgreSQL executes this 1280-dimensional matrix calculation against 16,000 uncharacterized proteins in roughly 2 milliseconds per target.
The Discovery: Fanzors in the Algal Genome
We ran the script targeting the CRISPR family. Almost immediately, the terminal output flagged an astonishing structural match:
CAS9_FRATN CRISPR-associated endonuclease Cas9 -> YCF78_STIHE (Distance: 0.337)
CS13A_LACNK CRISPR-associated endoribonuclease Cas13a -> YCF78_STIHE (Distance: 0.340)
The script found an uncharacterized protein called YCF78_STIHE. Despite having absolutely no textual sequence similarity to our CRISPR “bait” enzymes, this protein exists at a mathematical vector distance of ~0.34 from both Cas9 (a DNA-cutting enzyme) and Cas13a (an RNA-cutting enzyme).
What makes this extraordinary is the taxonomy. Our “bait” organisms come from entirely distinct walks of life: Francisella tularensis, a highly infectious pathogenic bacterium that causes rabbit fever, and Lachnospiraceae bacterium, a friendly microbe found quietly residing in the mammalian gut. Yet our target organism is something completely different.
STIHE stands for Stigeoclonium helveticum, which is a Eukaryotic Green Alga.
We found a massive 3,707 amino-acid chloroplast membrane protein in a freshwater alga that structurally aligns with the diverse bacterial immune systems of mammalian pathogens and gut microbes! This is exactly the signature of Fanzors—eukaryotic RNA-guided nucleases that act as the distant evolutionary cousins of the famous CRISPR systems.
Because this protein has drifted so far from its evolutionary relatives, it has no text-based homology, and standard BLAST searches ignore it completely. But in the 1280-dimensional folded space inside PostgreSQL, it is a structural twin.
🧬 Did You Know? Biological Curiosities
- The Lethal Bait: Francisella tularensis, the source of our Cas9, is considered one of the most infectious known bacteria. A microscopic dose of just 10 cells is enough to cause severe illness!
- The Friendly Bait: Lachnospiraceae bacterium, our Cas13a source, belongs to a family of microbes that ferments dietary fibers into beneficial short-chain fatty acids in your gut, protecting against inflammation.
- The Green Discovery: Stigeoclonium helveticum is a branching, filamentous green alga that thrives in slow-moving freshwater. Its complex chloroplasts harbor molecular relics from ancient bacterial symbiotes, making it a perfect evolutionary hiding place for ancient gene-editing machineries like Fanzors!
An Open Invitation to Scientists
If you had told me a week ago that I would be mining algal genomes for novel gene-editing tools using PostgreSQL, I wouldn’t have believed you.
I am a software engineer, a database builder, and a newcomer to this biological frontier. I am building pg_bio because I believe that if we give scientists and AI agents native database primitives to query biology mathematically, we will cure diseases and discover new molecular machines magnitudes faster than we do today.
But I need your help. I want to play along, learn, and build the infrastructure you actually need.
Are you a structural biologist, a geneticist, or a biochemist? Does a 3,707 amino acid putative Fanzor in Stigeoclonium helveticum sound like something you want to fold in AlphaFold and test in a wet lab?
Please reach out to me on X/Twitter or LinkedIn. Let’s cross-pollinate database engineering with cutting-edge synthetic biology.
(You can find the code for pg_bio and the Batch De-Orphanizer on my GitHub)
Related Discoveries
If you enjoyed this deep dive into Fanzors, be sure to check out our other foray into the dark proteome, where we unearth distant relatives of another powerful molecular machine: Unearthing Argonaute: Exploring the Dark Proteome.
This automated discovery was generated by the pg_bio continuous discovery script.
Check out more of our pipeline’s findings in the Bioinformatics discoveries section!