Welcome to The Nonlinear Library, where we use Text-to-Speech software to convert the best writing from the Rationalist and EA communities into audio. This is: Sequencing Intro, published by jefftk on August 29, 2022 on LessWrong.
I've been working in computational bio for a
couple months now and I've been learning a lot. There's still a ton I don't know, but I'm currently at a stage where I've put some pieces together while still remembering what it was like not to understand them, which is often a good time to try to write introductory stuff. Trying to explain things is also a good way of making sure I understand them myself. So, here's an dump of what I've been learning:
The biological world primarily stores information with nucleic acids. These are series of nucleotides, often called
bases: A, C, G, and T. For example, a
strand of nucleotides could look like:
The two main kinds of nucleic acid are DNA and RNA. They differ in a few ways, but from a computational perspective they're very similar. Physical RNA will have U instead of T, though in sequencing data you'll often see it with with T anyway.
Each base has a complement: A bonds with T, and G with C. A nucleic acid that comprises two bonded strands is called double stranded. Each base in one strand will be bonded to its complement:
CCGACTCTGTCACGGGTCTAGCAATGTGGTAAGCA
This is the famous double helix and makes for a more stable structure than single stranded nucleic acid.
Going from a physical nucleic acid to a sequence on a computer is sequencing, and the reverse is synthesis. I'm only going to talk about the former; I haven't learned much about the latter.
The most common sequencing method today is Next
Generation Sequencing, commonly called Illumina sequencing after the main vendor. Bases are dyed and the machine reads their colors. The output of sequencing is a large number of short reads. Each read is a sequence of 50-300 bases, usually around 150. In setting up the sequencing run you choose how many bases to read, and different applications will make the most sense with different lengths. Accuracy drops off as you read farther along the strand. Note the lengths we're talking about are way less than the length of a full nucleic acid, which is generally at least thousands of bases. Not getting the full picture is a big downside of this kind of sequencing.
Let's get some real data to play with. When people publish a paper that depends on sequencing they generally upload their raw data to the NIH's National Center for
Biotechnology Information (NCBI). Here's a paper I've been looking at recently, which sequenced wastewater: RNA
Viromics of Southern California Wastewater and Detection of SARS-CoV-2
Single-Nucleotide Variants. If you look down to the "Data availability" section, you'll see:
Raw sequencing data have been deposited on the NCBI Sequence Read
Archive under accession number PRJNA729801, and representative code can be found at.
The GitHub link is helpful for getting metadata (what does each sample represent?) and understanding how they processed it (what tools did they use and how?), but for now we're looking for sequencing data. The accession number is "PRJNA729801", and while we could click through and download it from the NCBI, the user interface on the European mirror (European Nucleotide Archive) is much better. We go to
their landing page and enter the accession number:
This takes us to a page that describes the data:
We want to sanity check the title to make sure we didn't end up with the wrong data set, and "Metatranscriptomic sequencing of Southern
California wastewater" sounds about right.
Scrolling down there are links:
We could download all of this data, but it would be about 80GB compressed. For now, let's just download a single
fastq.gz file, at ~150MB: SRR14530724_1.fastq.gz.
These files are generally both very large and very repetitive, so they're a natural candidate for compression. The most common option is gzip, and that's what they've us...