DEV Community

SWC ecosystem
SWC ecosystem

Posted on

DNA as Code: What Developers Should Know About How Proteins Are Designed for Precision Fermentation


Brazilian startup Future Cow produces milk proteins without cows: yeast makes them following instructions built into its DNA. In October, the company presented its project at the online Pitch Day International. Let’s look at how this “instruction set” works from a programmer’s point of view and try working with it in Python.
Source Code: Four Characters
DNA can be represented as a string over an alphabet of four characters: A, T, G and C. The cell reads it in triplets called codons. Each codon corresponds to one amino acid, and a protein is a chain of amino acids. There are 64 codons and 20 amino acids, so the code is redundant: the same amino acid can be encoded by several different codons. There are also service “instructions”: the ATG codon usually starts a protein, and three stop codons end it.
Extending the analogy, a gene is like a function, codons are like instructions, and the protein is the result of running it. The cell acts as the runtime that reads the code and builds the protein.
Reading a Gene in Python
The open-source Biopython library is available for working with sequences. Below is a DNA fragment that encodes the beginning of beta-lactoglobulin, a whey protein and the main protein of milk whey. This is its signal peptide, a short segment that tells the cell the protein should be exported.

`from Bio.Seq import Seq

dna = Seq("ATGAAGTGCCTCCTGCTTGCCCTGGCCCTCACCTGTGGCGCCCAGGCC")
print(dna.translate())
# MKCLLLALALTCGAQA`
Enter fullscreen mode Exit fullscreen mode

Each letter in the result stands for one amino acid: M (methionine), K (lysine), C (cysteine) and so on. The full sequences of cow milk proteins, including beta-lactoglobulin and the caseins, are available in open databases such as UniProt and GenBank of the US National Center for Biotechnology Information (NCBI). They can be downloaded programmatically through the Bio.Entrez module of the same library.
Compiling for a Different Architecture
Things get interesting when the cow gene has to be “run” in yeast. The genetic code is shared, but different organisms prefer different codons for the same amino acid. This is called codon usage. If the cow codons are left unchanged, yeast will assemble the protein more slowly. So the sequence is rewritten: the amino acids stay the same, and the codons are replaced with the ones the host organism reads more readily. The process is called codon optimization, and for a developer it looks very much like compiling the same code for a different processor architecture.
Counting which codons appear in the sequence takes a couple of lines:

from collections import Counter

s = str(dna)
codons = [s[i:i+3] for i in range(0, len(s), 3)]
print(Counter(codons).most_common(3))
# [('GCC', 4), ('CTC', 2), ('CTG', 2)]
Enter fullscreen mode Exit fullscreen mode

A simplified optimization looks like this: for each amino acid, take the codon the host organism uses most often. Frequency tables for different organisms are published in open sources, for example the Codon Usage Database. In practice, tools take more parameters into account: the content of G and C nucleotides, repeats, and regions that interfere with the cell’s work. But the basic idea stays the same.

`# frequencies here are illustrative
host_preferred = {"M": "ATG", "K": "AAA", "C": "TGT", "L": "TTG",
                  "A": "GCT", "T": "ACT", "G": "GGT", "Q": "CAA"}

protein = str(dna.translate())
optimized = "".join(host_preferred[aa] for aa in protein)
assert str(Seq(optimized).translate()) == protein`

Enter fullscreen mode Exit fullscreen mode

The last line does what a developer would do in any project: it checks that the result did not change after “compilation” and the new sequence encodes the same protein.
Build and Deployment
The optimized gene is inserted into a genetic construct. It can be compared to a package that contains, besides the code itself, service elements: a promoter that switches gene reading on, a signal peptide responsible for exporting the protein from the cell, and a terminator that ends reading. The finished construct is introduced into yeast, the cells that produce the most protein are selected, and they are grown in a bioreactor. The protein is released into the nutrient medium, after which it is separated, purified and dried.
Future Cow has taken this path from 15-liter laboratory fermenters to the semi-industrial pilot plants of Brazil’s national research center CNPEM. According to company founder Leonardo Vieira, they have already produced Brazil’s first whey protein identical to cow’s whey protein, and the company plans to release its first industrial batch in 2027.
Where to Start If You’re Curious
To try working with biological sequences, it is enough to install Biopython and open its official tutorial: it has sections on reading FASTA and GenBank formats, translation, sequence alignment and working with NCBI databases. Specialized editors exist for designing genetic constructs, but many basic operations, from finding a reading frame to counting codons, are easy to write yourself. It is a good way to see that behind precision fermentation, besides biology, there is familiar developer work with strings, dictionaries and checks.
The community vote results will be taken into account when deciding whether to place the project on the SWC Field showcase.

This material is for informational purposes only and is not individual investment advice or an offer to acquire any financial instruments. Company information is based on data from the companies themselves and open sources.

Top comments (0)