A biological sequence is a string of letters that stands for a molecule. Once a sequence is written as text it can be stored, compared, searched and shared, which is the basis of almost everything in bioinformatics.
Sequences as text
DNA uses four letters, one for each base. RNA uses the same idea with a different fourth base. Proteins use a longer alphabet, with one letter for each amino acid. Extra letters are often used for ambiguity, for example when a position could be one of two bases.
The simplest way to store a sequence is a plain text format such as FASTA. Each entry has one header line that starts with a marker symbol, followed by the sequence itself on the lines below. Because the format is so simple, almost every program can read it.
What a header usually contains
The header is free text, but it often holds an identifier, a short description and the organism. Some collections add the length or a database label. Conventions differ, so read a few headers from a source before you write a script that depends on their layout.
Shared collections
Sequences are kept in large shared collections such as GenBank and RefSeq for nucleotides, and UniProt for proteins. A collection can hold entries as flat files, which are long text records with labelled lines, or as structured records in a relational system that can be queried by field.
- Collections are often redundant, because many people submit the same gene or very similar versions of it.
- Curated layers exist to reduce that redundancy and to add reviewed information. A reference collection such as RefSeq is an example of the idea.
- Curated and unreviewed entries usually sit side by side, so check which kind you are reading. The guide on a first look at public databases explains the difference.
Searching for sequences
There are three common ways to find an entry. You can search by text, such as a gene name or organism. You can search by identifier, which is the most precise route when you already have an accession. Or you can search by similarity, where you supply a sequence and a program such as BLAST finds entries that resemble it.
Names are convenient but ambiguous, and identifiers are exact but need a source. The note on understanding gene identifiers covers how to avoid mixing similar names.
Quality and error caveats
Public sequences come from many laboratories, and not every entry is perfect. Sequencing errors, contamination, wrong species labels and out of date descriptions all occur. Predicted entries may carry names inferred from similarity rather than shown by experiment.
Treat a sequence as evidence, not as a final truth. Compare more than one source where it matters, and note which version of the entry you used.
Where to go next
Continue with reading a database record to learn how the parts of an entry fit together, and keep the glossary open for unfamiliar terms.