On CRISPR, AI and making LEDs blink
In this edition: Exploring the world of CRISPR gene editing, AI, web design, and hardware development.
This edition covers everything I have been interested in over the last year: Gene editing, AI, web design, and a little hardware development.
We'll discuss the potential of CRISPR gene editing, collaborating with AI, building a live stream for my website, and exploring the world of phyllotactic patterns. I'll also discuss the importance of thinking in first principles and looking at what it takes to step into the world of hardware development.
→ CRISPR Gene editing
→ Collaborating with AI
→ Building a live stream for my website
→ Phyllotactic Patterns
→ Ideas and first principles
→ Stepping into hardware development
CRISPR gene editing
CRISPR gene editing is a method of altering the DNA of a cell. It is a relatively new technology that has revolutionized the field of genetics, allowing scientists to make precise changes to an organism's DNA.
Clustered regularly interspaced short palindromic repeats, or CRISPR for short is the name given to a family of DNA sequences that play a key role in the anti-viral defence system of prokaryotic organisms like bacteria. They are signatures that allow bacteria to identify and remember specific viruses to develop immunity.
This technology uses a particular enzyme called Cas-9, which acts like a pair of "molecular scissors" that can cut DNA at specific locations. By providing the Cas-9 enzyme with a short piece of RNA called a guide RNA, researchers can target a particular region of DNA to cut. Once the DNA is cut, the cell's natural repair mechanisms can be used to insert or delete specific genetic sequences, effectively making changes to the organism's genetic code.
Our understanding of CRISPR allows us to create programmable gene editing tools that are used to develop everything from phage-resistant bacterial strains used in yogurt production to genetic vaccines for COVID-19.
The general idea is that whenever bacteria come under attack by a virus, they fight back by copying and incorporating small fragments of the virus's DNA into their genome. These identifiers are then used to disrupt viruses and provide immunity against future attacks.
CRISPR sequences were discovered in the early 1980s by three independent research groups. They were studying genes belonging to Escherichia coli, a type of bacterium that is commonly found in the human gut. These researchers noticed that CRISPR sequences were present in the genes of these bacteria, and that they seemed to have a unique pattern.
Following this discovery, researchers started seeing this pattern in all sorts of microbial genes. By the 2000s, it was also known that CRISPR sequences were always accompanied by another set of genes that came to be known as Cas genes (short for CRISPR-associated genes). These Cas genes encoded enzymes that cut DNA, which play an important role in the CRISPR system. Many different Cas genes have since been identified, and they’re usually named along the line of Cas-9, Cas-13 etc.)
It was only in 2005 that we learned that the spacer sequences found within the CRIPSR system were similar to virus DNA, and the idea that this might be part of a dynamic viral defence system in bacteria began to spread.
This technology was first applied commercially by Danisco in 2008, a danish bio-based company in food manufacturing that used it to improve the immunity of bacterial cultures against viruses.
The applications are many and varied, from transgenics, where DNA is transferred from one organism to another, to growing human organs in hosts such as pigs. We could even edit out disease-causing mutations and create hardier plants, biofuels and many other applications in industrial biotechnology.
We can now engineer organisms using these molecular scissors to cut and splice genetic material. Because of this, we no longer need to wait for generations to affect significant genetic change. For example, researchers have genetically engineered livestock to create resistance to common diseases (including COVID-19). In one case, a bull calf was genetically altered to have a 75% chance of producing males in future offspring.
Interesting reading adjacent to this topic:
Timeline of key events
The Code Breaker by Walter Isaacson (book)
The Secrets of Covid ‘Brain Fog’ Are Starting to Lift
DIY CRISPR gene editing?
All you need is a bacterial culture to work with and some equipment. You can purchase a handy kit that has everything you need on Odin, a store for all your biohacking needs.
Collaborating with AI
In my last email, I talked about using the GPT-3 API. I used it to build a writing tool that used the language model to complete and extend ideas as you typed. As you can see on the example below, some of the prompts are certainly thought provoking.
You type on the left side, and different results from GPT-3 show up on the right. You can use your arrow keys to select a suggestion and hit the tab to insert it.
At the time I made this, ChatGPT, a tool that uses GPT-3 to generate text suggestions in real-time wasn’t yet available but would be what I’d recommend you try out today.
As language models like GPT become more advanced and more widely used, they can help people in a variety of ways. For example, they can assist with research by providing access to vast amounts of information and by making it easier to find and organize relevant information.
Models available today have high-error rates and aren’t always accurate. So it’s generally not a great idea to trust any of these models verbatim.
They can however be great at helping with writing and editing by suggesting alternative phrases or sentences that can improve the clarity and coherence of most kinds of writing. They can even help with creative tasks by providing inspiration and ideas, or by offering suggestions for ways to combine or extend existing ideas.
I like to think of them as partners in thinking, that allow us to tap into large collections of knowledge in a contextual manner.
A couple of other models that I found interesting:
Bloom: The world’s largest multilingual language model
Unlike language models like GPT-3 that function as black boxes hidden behind APIs, Bloom is open source. The project took over a year to complete with over 1000 AI researchers, the largest collaboration of this nature.
Try it at: huggingface.co/bigscience/bloom
An attempt at replicating OpenAI's DALL·E that’s actually pretty good. Although DALLE•E 2 outperforms this in general, it’s to be expected given that this is a simplification of the original model that has the benefit of being able to be trained on less demanding hardware.
Try it at: https://huggingface.co/flax-community/dalle-mini
I wrote this bit a couple months ago and to be honest it’s already outdated. This space is moving so fast.
Building a live stream for my website
I wanted a way to capture some real-time data, get it over to a server in a secure fashion and figure out how to present it with some consideration for latency and bandwidth.
Here're some notes on how I added a live video stream from my workspace onto my personal website.
My current approach is to recreate a live feed using a sequence of images and transition between them to recreate the video-like effect. Serving images from a server is less complicated than setting up a video stream. Additionally, I could host at least a couple thousand live viewers off a small server (2 vcpus, 2 gigs of memory).
Serving images that are ~20-30kb in size each at a frame rate of 30 frames per minute makes up about ~1Mb per minute in bandwidth. For reference, a video stream of roughly the same quality but at a much higher frame-rate only costs about ~2Mb per minute. Definitely room for improvement. For a future upgrade, I'm hoping to take a page out of video compression algorithms and see how far I can compress these individual frames or if there is a way for me to send diffs instead of full images.
It caught me by surprise how many folks were interested in this when I shared it on Reddit. You don't often have people sharing a casual stream outside of the context of places like Twitch or Youtube. In hindsight, I should've added a wave button so visitors could interact with the feed and say Hi.
Keep reading for more details on my blog → udara.io/live-video-feed
Everything has a purpose when you look at a plant, the shape of the leaves, the petals, the thorns on the stem, and the way it grows.
The way the branches grow on a tree, the way the leaves grow on a stem, and the designs that some flowers form, can all be classified into a distinctive class of patterns known as phyllotaxis.
A spiral phyllotactic pattern inspired the design above. It was programmatically generated using D3. You can see it live and play with the code at https://replit.com/@devudara/Phyllotaxis.
In the case of the spiral pattern above, the number of left and right spirals that are successive Fibonacci numbers is notable because it demonstrates the appearance of the Fibonacci sequence in this specific pattern. In the example given, 34 spirals go to one side and 55 to the other, which are both numbers in the Fibonacci sequence (34 is the 12th number in the sequence and 55 is the 13th). This suggests that the arrangement of the spirals in the pattern follows the principles of the Fibonacci sequence.
The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding numbers. The sequence typically starts with 0 and 1, and then the next number is the sum of 0 and 1 (which is 1), followed by 1 and 1 (which is 2), and so on. This sequence appears in various forms in nature, including in the arrangement of leaves on a stem, the branching of trees, and the arrangement of scales on a pinecone.
The pattern of interconnecting spirals that emerges from a simple set of rules is harmonious. This pattern also produces the most efficient packing of seeds mathematically possible within the flower head in plants such as sunflowers.
The simplicity of nature is only overshadowed by its complexity.
Ideas and first principles
Often, fresh ideas start as opinions.
They're based on an intuition or gut feeling. Ideas are the lifeblood of startups; they're what make them tick. They're what makes them move. They're what makes them grow.
But ideas are also the things that cause startups to fail.
When you're trying to build something new, it can be helpful to boil your ideas down to first principles to cut through assumptions and clarify your thinking. It helps us better understand the problems we're dealing with, and in effect helps us pick and improve the right ideas.
Testing your ideas is also important.
Building prototypes, finding ways to get meaningful feedback, and then being able to iterate on them quickly helps us put just the right ideas together. It allows us to refine ideas and ensure that they align with the needs and wants of real people.
Good ideas are essential for the success of a startup.
However, it is important to carefully evaluate and test ideas to ensure that they are feasible and practical. This process of moving between idea generation and testing is what fuels the growth and development of any successful venture.
I had the opportunity to see the Convergence Station exhibit by Meow Wolf, it’s a four-story, immersive exhibit that brings to life four alien worlds. The sheer scale and creativity of the installations are breathtaking, you could spend a whole day walking around and you’d still miss things.
Stepping into hardware development
This year I set up a 3D printer and dived into the world of designing and printing physical objects. So naturally, it was only a matter of time before I wanted to make something blink.
If you've ever asked yourself what a modern workflow for building IoT products from concept to design, code and hardware looks like, you'll find more than a couple of your questions answered here.
For many years I've relied on Raspberry Pi hardware as my platform of choice for prototyping. But, my friend Pankaja, who's been building hardware for almost ten years now, introduced me to some better tools and hardware to modernize my workflow.
Here I use a ESP32 microcontroller driving a Neo-pixel ring of LEDs inside a 3D printed enclosure to play around with a quick hardware prototype. This post isn't a tutorial, you can find hundreds of those elsewhere online, but a brief outline of the new tools and software I picked up.
If you’re interested in the details, you can find them on my website at: udara.io/hardware-development
I’d love to hear your responses as replies to this email or on twitter at @devudara.
– That's all for this time!