Mining Bioplastic Factories in the Dark Proteome using AI and SQL

A pg_bio Case Study How we used PostgreSQL and 1024-dimensional AI vectors to discover a completely undocumented, bioplastic-synthesizing enzyme hiding in the genome of a methane-producing archaeon.

We are facing a global plastic crisis. The world is desperately searching for natural, biological alternatives to petroleum-based plastics. One of the most promising solutions is PHA (polyhydroxyalkanoates)—a type of biodegradable plastic synthesized entirely by bacteria using a specialized molecular machine called a Polymerase.

While running a massive overnight background discovery process against the Dark Proteome, our pg_bio engine hit the jackpot. We used a known PHA Polymerase as our “Bait” and went fishing.

Within seconds, PostgreSQL returned this:

Known Target (Bait) Orphan Discovery Organism Vector Distance Hybrid Score
PHA Polymerase (PhaE) Q0W356 Methanosaeta 0.0680 0.3040

The Biology: Discovering a Microscopic Plastic Factory

Our bait was Poly(3-hydroxyalkanoate) polymerase subunit PhaE, the biological engine responsible for stringing together carbon molecules to create biodegradable bioplastic.

Our SQL query instantly identified Q0W356, a completely uncharacterized sequence found in the genome of Methanosaeta. Methanosaeta is a fascinating archaeon that produces methane and typically thrives in anaerobic environments like deep-sea vents and wastewater treatment sludge.

With a Vector Distance of 0.0680, the AI structural model is screaming that the 3D backbone of Q0W356 is a near-perfect identical clone of our bioplastic factory. What used to take months of wet-lab assay testing was just accomplished in milliseconds. We just assigned a highly complex, incredibly valuable biotech function to a previously mysterious string of DNA.


The SQL Behind the Discovery

How do you search for a 3D shape? You convert the proteins into 1024-dimensional floating-point vectors and let PostgreSQL calculate the Cosine Distance.

Here is the exact query that found our bioplastic enzyme:

WITH closest_structures AS (
    -- STEP 1: AI Structural Search
    -- Use pgvector to find the closest 3D shapes to our Polymerase Bait
    SELECT uniprot_id, name, sequence, embedding,
           (embedding <=> v_polymerase_bait) as dist
    FROM proteins
    ORDER BY embedding <=> v_polymerase_bait ASC
    LIMIT 100
)
-- STEP 2: Relational Filtering & Classical Re-Ranking
SELECT c.uniprot_id, c.name, c.dist,
       -- STEP 3: The Hybrid Operator (<~>)
       -- Rigorously verify the sequence alignment of the AI match
       (ROW(c.embedding, c.sequence)::bio_feature <~> ROW(v_bait, v_seq)::bio_feature) as hybrid_score
FROM closest_structures c
WHERE c.name ILIKE '%uncharacterized%'     -- Search the Dark Proteome
  AND c.dist <= 0.35                       -- Ensure high structural confidence
ORDER BY hybrid_score ASC
LIMIT 1;

See it to Believe it (Interactive 3D)

Don’t just trust the math—trust your eyes. Below is a 3D visualization comparing a known bioplastic Polymerase against our new discovery from the Dark Proteome.

Notice how the massive, sprawling Alpha-helices form identical architectural scaffolds. This is the physical channel where carbon molecules are strung together into plastic polymers!

Known Bait (PHA Polymerase)

Our Discovery (Distance: 0.068)

(The physical similarities are undeniable. A distance of 0.068 represents a near-perfect structural clone!)


Conclusion

Biology is no longer limited to test tubes. By treating proteins as high-dimensional vectors and querying them with standard relational SQL, software engineers can now actively participate in discovering enzymes that could help solve the global plastic crisis. The Dark Proteome is full of incredible machines just waiting to be indexed.

Jônatas Davi Paganini

Jônatas Davi Paganini

Senior developer and technical consultant with 20+ years of experience specializing in PostgreSQL, TimescaleDB, and distributed systems. Expert in database optimization, microservices architecture, and team enablement. Passionate about sharing knowledge through writing, speaking, and mentoring.

1/1