Lesson 6 of 20 · 11 min
Reading a Prefix: Provenance and Molecule Type
By the end of this lesson you will be able to glance at an accession and, before you fetch a single byte, say where it came from and what kind of molecule it names — reading NM_007294 as "a curated, reviewed messenger-RNA record" as fluently as you read a phone number.
The RefSeq two-letter code
The previous lesson, What an Accession Number Is, established that an accession is a stable, permanent ID for one database record. This lesson makes the point that those IDs are not random. The characters carry meaning, and once you can decode them you can triage a spreadsheet of a thousand IDs without opening one.
RefSeq — NCBI's Reference Sequence collection, a curated, non-redundant set of "best" sequences — uses a small, readable grammar. Every RefSeq accession opens with two letters, then an underscore, then digits: NM_007294.
Read the two letters as two separate questions.
The first letter answers how was this made?
Nmeans curated or reviewed — a person or a validated pipeline stood behind it.Xmeans automated / model — predicted computationally from a genome annotation, not individually vetted.
The second letter answers what molecule is this?
M— an mRNA (messenger RNA, the transcript).P— a protein.C— a complete genomic molecule (a whole chromosome or replicon).R— a non-coding RNA.
Snap those two answers together and the common prefixes fall out: NM_ is a curated mRNA, NP_ a curated protein, NC_ a curated genomic sequence, NR_ a curated non-coding RNA. Swap the first letter to X and you get the automated twins: XM_, XP_, XR_ (there is no XC_ — model pipelines predict transcripts and proteins, not whole chromosomes).
BRCA1, read three ways
The whole scheme lands the moment you line up our thread gene against it. Every one of these is a real, live BRCA1 record you can open at NCBI today.
| Prefix | First letter → provenance | Second letter → molecule | BRCA1 example |
|---|---|---|---|
NM_ | N curated | M mRNA | NM_007294 |
NP_ | N curated | P protein | NP_009225 |
NC_ | N curated | C complete genomic | NC_000017 (chr17) |
NR_ | N curated | R non-coding RNA | — (BRCA1 is coding) |
XM_ | X model | M mRNA | XM_… (predicted transcript) |
XP_ | X model | P protein | XP_… (predicted protein) |
XR_ | X model | R non-coding RNA | XR_… (predicted ncRNA) |
NM_007294 and NP_009225 are a matched pair: the curated transcript and the curated protein it encodes, translated one into the other. NC_000017 is the human chromosome 17 they sit on. The molecule type told you their relationship before you read a word of annotation.
The one-glance test
Here is the single most useful rule in this whole module, and it is almost embarrassingly simple.
INSDC accessions never contain an underscore. RefSeq accessions always do.
Recall from Why Bioinformatics Runs on Databases that the INSDC (International Nucleotide Sequence Database Collaboration) is the GenBank / ENA / DDBJ archive of raw submissions — every sequence anyone deposited. RefSeq is the curated layer NCBI builds on top of that archive. The underscore is the visible seam between the two worlds.
So a GenBank accession looks like U14680 or BC072418 — letters, then digits, no underscore. A RefSeq accession looks like NM_007294 — always that underscore after the two-letter code. You can sort archive records from reference records by eye, in bulk, with nothing but a _ check.
def is_refseq(acc):
# RefSeq: two letters, underscore, digits. INSDC never has "_".
return "_" in acc
print(is_refseq("NM_007294")) # True -> curated RefSeq
print(is_refseq("U14680")) # False -> raw GenBank submissionOne exception will trip you if you take the underscore rule too literally: assembly accessions. A whole genome assembly — the assembled set of sequences for an organism — gets its own ID like GCF_000001405 (RefSeq assembly) or GCA_000001405 (GenBank assembly). Those carry underscores but are a completely separate namespace: they name a genome build, not a sequence record. So the precise rule is: an underscore means "not a raw INSDC sequence" — either a RefSeq sequence (NM_, NP_, NC_…) or a GCA_/GCF_ assembly. Never a bare GenBank submission.
Why provenance is a decision, not trivia
The N versus X distinction is where reading a prefix stops being a party trick and starts protecting your results.
An NM_ record has been curated: its exon boundaries, its coding region, its start codon were checked. An XM_ record is a machine's best guess from a genome annotation, and for a well-studied gene like BRCA1 you almost always want the curated one. For an obscure gene in a newly sequenced organism, an XM_ prediction may be all that exists — useful, but flagged in your own mind as provisional.
You can enforce this in code. When you fetch records with Biopython's Entrez module, filter on the prefix before you trust an ID:
from Bio import Entrez
Entrez.email = "[email protected]" # NCBI requires an identity
candidates = ["NM_007294", "XM_017023511", "NR_027676"]
curated_mrna = [a for a in candidates
if a.startswith("NM_")]
print(curated_mrna) # ['NM_007294']Two letters told you provenance and molecule type; the underscore told you archive versus reference. That is the entire lesson, and it will save you from ever again fetching a predicted protein when you meant the reviewed one. The prefix is only half of an accession's identity, though — notice that the real record is NM_007294.4, not NM_007294. That trailing .4 is a second, independent piece of bookkeeping, and it changes for reasons that have nothing to do with provenance or molecule type.