The gut microbiome and insomnia

It’s funny to think that we’re still human when the 39 trillion microbial cells inhabiting our bodies right now account for more than our human cells. Even more mind-blowing is to know that our guests digest food that we can’t, help our immune system, and even communicate with our brains.

Today we can be sure that the human microbiome has to do with many diseases which include diabetes, obesity, insomnia, depression, some types of cancer, Alzheimer’s, HIV, and autism (just to mention the big names).

Currently the gut microbiome is analyzed through a stool sample. My personal hope for the future is either that we will create a probiotic biosensor to get this data or that we will be able to have that biosensor in our WC that could even send that information to our smartphones… too futuristic?

In this blog post, I will first explain some biotech tools to analyze microbiomes, and then focus on sleep-gut correlations, which include some brain science as well.

Reading microbiomes

The first step to read the stories of our bugs is to sequence their genomes, or only fragments of those (that depends on the end goal of the study). Afterwards, bioinformatic tools are used to arrange that information into useful parameters (e.g. obtaining the diversity index in a population). Further, AI can even to diagnose diseases based on gut microbiome data.

Amplicon and shotgun sequencing 🧬 🔫

The majority of papers I’ve read on the gut microbiome (30+ for sure) mention something called the “16S region”. This is a highly conserved bacterial DNA sequence that codes for the 30S subunit (small subunit) of rRNA (ribosomal RNA). In English, it’s the sequence we care about because it changes a lot from microbe to microbe. Like a fingerprint, it allows the identification of specific bacteria down to the genus level.

Amplicon sequencing uses PCR (Polymerase Chain Reaction) to amplify the 16S sequence and then sequence it. It’s cheaper and faster than shotgun sequencing and it allows scientists to obtain the relative abundance of a bacterial species in a community. One drawback is that it doesn’t work for viruses (no 16S region).

Shotgun sequencing is a metagenomic tool. This means that it’s used to analyze the whole genome of a population in a sample. The overall explanation is the following:

  1. Break genomes randomly into smaller fragments called reads
  2. Sequence each of those individual pieces
  3. Use software to find overlaps between the reads
  4. Join the reads that overlap to form ‘contigs’
  5. Join a lot of contigs to complete the full genome sequence

The genome needs to be broken down because of the limited capacity of sequencing tools to read long fragments.

The following is a simple example of the results of a gut microbiome sequencing. These are different phylum, which in taxonomy is way less specific than a species, but still helpful in many microbiome studies.

Artificial Intelligence

Several different models have been used for 3 main purposes: diagnosing diseases based on the gut microbiome, finding the troublemaker microbe in a patient, and to find biomarkers.

Globally, colorectal cancer is the third most common type of cancer, making up about 10% of all cases. Around 50% of individuals with colorectal cancer do not report any symptoms. The main screening test is colonoscopy which is unfortunately invasive and expensive.

Yes, the gut microbiome is correlated with this disease too. It’s been suggested that E. coli can down regulate DNA repair proteins and promote tumorigenesis that way.

One study used Machine Learning, specifically a random forrest classifier, to select taxa that best discriminates a healthy sample from a colorectal cancer one. Bayesian Networks have been used in other studies as well, creating an alternative to current diagnostics.


Sleep helps us repair our bodies, recover energy, perform well the next day, and more. Lack of sleep has been linked to a higher risk for conditions like type 2 diabetes, high blood pressure, heart disease, stroke, poor mental health, and early death.

Recently, the book “Why we sleep” has become quite famous among the health-aware and to me, this TED Talk made it more than clear: sleep is the super power most of us have.


There’s a reason to sleep when there’s no natural light. Our bodies know when it’s day and when it’s night and program different activities accordingly. The circadian rhythm is that schedule.

According to general estimates, 10–30% of adults live with some form of insomnia (inability to fall or remain asleep). This condition may be exacerbated by external factors and behavior but it is characterized for having its roots inside the body.

Therefore, it’s time to really dive into some sleep zzz-science. The short answer to why we sleep is melatonin. Now the curious will ask: and how is this substance produced?

Melatonin regulates the circadian rhythm and it is produced by the pineal gland when the brain stops receiving light signals (at night). The whole story is a both complex and fascinating:

The circadian rhythm has its headquarters in a region of the hypothalamus that is commonly known as the master clock: the SupraChiasmatic Nuclei (SCN). This is the scene where the sleep story takes place. In the following list, I include both a scientific and a more colloquial explanation:

  1. Eyes tell send the brain light signals: the SCN receives input from photosensitive ganglion cells in the retina
  2. Neurons in the master clock activate genes according according to those signals: neurons in the ventrolateral SCN can activate their genes according to light input
  3. Those neurons tell other neurons what’s going on: they relay this information throughout the SCN allowing synchronization of the circadian rhythm
  4. In the day, the master clock blocks the pineal gland through substances: if there’s light, SCN secretes gamma-amino butyric acid to inhibit the neurons that synapse in the paraventricular nucleus (PVN) of the hypothalamus with the pineal gland
  5. At night, the master clock tells the pineal gland to produce melatonin: when there is no light, the SCN secretes glutamate, responsible for the PVN transmission of the signal along the pathway to the pineal gland
  6. The pineal gland transforms tryptophan (an amino acid) into serotonin and then into melatonin: the pineal gland uses available tryptophan, decarboxylates it to get serotonin, and acetylates serotonin using AA-NAT to produce melatonin
  7. Once produced, melatonin is taken to the rest of the body through the Cerebrospinal Fluid (CSF). In humans, melatonin’s half-life in blood is around 40 minutes

There are 2 main sleep stages: REM and NREM (rapid and non-rapid eye movement). In NREM1, muscles relax and body movements begin to slow down. NREM2 is deeper and it’s the longest stage. In NREM3, heartbeat, breathing, and brain wave activity are at their lowest levels, so it’s the most important one to crush the next day. Finally, REM is when breathing and heart rate begin to increase and when dreams come true! 🥴

5 ways 🦠 affects sleep

After reading several papers that studied the correlation between the gut microbiome and sleep, I identified 5 important facts: 1) the gut microbiome’s diversity is positively correlated with sleep time and efficiency 2) the gut microbiome seems to have its own circadian rhythm 3) microbiota produce specific metabolites that influence sleep 4) microbiome composition changes between healthy and insomnia subjects 5) the vagus nerve is the bridge between microbes and the brain.

#1 — In Gut microbiome and sleep physiology, researchers compared the Shannon diversity of insomnia and healthy subjects, and found that it was the most correlated measure with sleep time and efficiency. They also found that IL-6 and IL-1ß production can be stimulated through the microbiome and that these are correlated with microbiome diversity. Further, they show a positive correlation between Bacteroidetes richness and diversity and sleep efficiency, as well as a positive correlation between richness of Firmicutes and sleep efficiency.

For the curious: IL-1ß is a somnogenic factor. Its administration increases spontaneous sleep and fatigue. IL-6 is not a direct somnogenic factor but it is positively associated with gut microbiome richness, time in bed, and total sleep time. Sleep onset coincides with high levels of IL-6 and it remains high during the night.

#2 — Microbiota Diurnal Rhythmicity Programs Host Transcriptome Oscillations. It’s been found that the gut microbiome also follows the circadian rhythm. It influences the transcription of circadian clocks as much as their expression influences the composition of the gut microbiome: a bi-directional pathway.

#3 — Dietary prebiotics alter novel microbial dependent fecal metabolites that improve sleep tested a diet with prebiotics on their subjects, improving REM and NREM sleep and preventing the decreased (alpha) diversity that results from stress. These prebiotics increased the presence of metabolites that include: Glycerol Glucoside Derivative, Ethanebis(thioate) Derivative, Disaccharide, and Pyrimidine Nucleotide 1.

In Effect of sleep deprivation on the human metabolome found that during sleep deprivation, tryptophan, serotonin, taurin, 8 acylcarnitines, 13 glycerophospholipids, and 3 sphingolipids had higher levels than in sleep conditions. Serotonin had the biggest change between the two conditions.

#4 — Gut Microbiota as an Objective Measurement for Auxiliary Diagnosis of Insomnia Disorder used bioinformatic tools including Artificial Neural Networks to create an alternative diagnostic tool for insomnia. After 4 weeks of sleep deprivation in mice, predominant bacteria were Lachnospiraceae and Ruminococcaceae, while Lactobacillaceae was reduced and after partial sleep deprivation in young individuals, the Firmicutes/Bacteroidetes ratio increased. They highlight that the importance of using biomarkers to establish a framework to analyze insomnia microbiomes.

#5 — The Role of Microbiome in Insomnia, Circadian Disturbance and Depression explains the Brain-Gut Microbiome Axis (BGM Axis) very well. There are 3 bi-directional pathways to consider:

  1. Immunoregulatory: gut microbiota interact with immune cells, ultimately influencing cytokine, cytokinetic reaction factor, and prostaglandin E2
  2. Neuroendocrine: over 20 types of enteroendocrine cells reside in the intestine. The gut microbiome can influence the hypothalamic-pituitary-adrenal (HPA) axis and the central nervous system by regulating the secretion of neurotransmitters like serotonin, tryptophan, and cortisol
  3. Vagus nerve: the intestinal nervous system forms synapses with the vagus nerve which connects the intestine with the brain. Sensory neurons that are in contact with microbiota also form synapses with motor neurons which control hormone secretion

To my interest, they also say that 90% of serotonin is produced in chromaffin cells, which are influenced by microbes, that Escherichia coli and Enterococcus also produce high amounts of 5-HT, and that the metabolism of tryptophan is regulated by the BGMA. Being serotonin the precursor to melatonin, it’s interesting to think of this simple fact that may or may not be playing a role in insomnia.

The Vagus Nerve at the Interface of the Microbiota-Gut-Brain Axis mentions that microbiota communicate with the brain through the spinal cord, the hypothalamic pituitary adrenal axis, cytokines, and short-chain fatty acids (SCFAs). So when we say that the gut microbiome communicates indirectly with the brain, we mean that it uses intestine endocrine cells as a first bridge.

That paper also explains that afferent fibers are distributed through all the layers of the digestive tract without crossing the epithelial layer. Thus, they can only communicate with microbiota through the diffusion of metabolites like serotonin secreted by enteroendocrine cells (EECs) or through epithelial cells. Similarly, EECs have toll-like receptors (TLRs) for microbiota metabolites such as SCFAs. Some people suggest that then using probiotics to stimulate afferent fibers can help treat certain diseases.

Microbes for good

The way I see it, these are the great salvation to getting a fecal transplant. Let me explain: there are good microbes and bad bugs. We always want to find homeostasis and have the greatest diversity of microbes possible, or else we would be in trouble, and when we are, one way of fixing things is by ingesting someone else’s microbes… from their poop!

Today synthetic biology offers the option to engineer those bacteria to do much more. A company called Synlogic has been partnering with Ginkgo Bioworks to create living medicines for rare diseases and cancer and ZBiotics created a probiotic to cure hangover!

Of course, simpler probiotics are already used to boost the immune system, reduce the risk of obesity, treat insomnia, and much more. They are not regulated by the FDA but they’re unlikely to hurt you.

When I think of probiotics, the first thing that comes to mind is a medicine, a treatment. However, synbio is opening the doors to using bacteria as diagnostic tools through mechanisms like quorum sensing. The ideal case: a microbe pill that does both diagnostics and therapeutics.

Question marks

The living medicines concept is quite recent of course. There are still some questions to be answered through research and development.

The first one that comes to mind is “which microbe?”. Even when Lacotobacillus and E.coli are well characterized for bioengineering, they’re not the most common types of microbes in the gut which brings doubts around how they will interact with other microbes and how easy they will find it to colonize the gut. Researchers are starting to see how species like B. thetaiotaomicron work as probiotics.

Let’s talk biosecurity. It’s unlikely that these living medicines are let to clinical use without implementing some sort of kill switch. At first sight, I don’t think that should be any difficult to implement… it just needs to work.

Bug💤: an idea

“Engineer E.coli to sense and/or produce: IL-6, serotonin, Glycerol Glucoside Derivative, Ethanebis(thioate) Derivative, Pyrimidine Nucleotide 1, vitamin B, or arachidonic acid”. Of course, biotech it’s easier said than done!

I imagine that the first step would be identifying which molecule is the most correlated with sleep and learning more about the metabolic pathway behind its existence.

The reason to choose E.coli at first is to make the bioengineering process easier. It appears that this microbe is common in the human body. Quickly skimming through some articles, I read that it’s not super abundant (<1%) which may either be an opportunity or a drawback. I’m not sure yet.

What model organism am I thinking of? Even though many studies are being done in mice, I think that gut-on-a-chip is an interesting alternative that can optimize for both accuracy and ethics.

Yet another idea that comes to mind is looking at what microbes insomnia patients are missing (compared to healthy people), and personalizing a probiotic mix for them. Since we know that gut microbiome diversity is strongly correlated with good sleep, this might just be easier than creating a living medicine.

I’m currently exploring other project ideas that I could build during the next 4 months. If I continue with this research project, my next steps would be learning how to analyze gut microbiomes with R, reaching out to experts in the field who help me figure out which metabolite could be the most important one, and learning more about the experiment pipelines that that the simplest experiment would involve.

That said, I’d appreciate if you could connect me with anyone in the field. I hope this article has been interesting. Stay tuned to read about my following idea sprints :)

Hey! I’m S🧠FIA, an ambitious teenager developing projects at the intersection of synthetic biology, microbiomes, and AI.
Just for growth, I also innovate at TKS🦄, create content, play the piano, read, and 🌎 connect with new people on a weekly basis (hit me up!).



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store