Lesson 9 of 20 · 9 min
Project and Sample Accessions Across INSDC
By the end of this lesson you will be able to take a raw-data accession from any methods section — PRJNA28911, SAMN12345678, SRR000001 — and know instantly which archive issued it, what kind of object it names, and how to walk from a whole study down to a single file of reads. This is how you trace a dataset back to its source.
So far this module has been about sequences: NM_007294, P38398, one molecule per record. Raw sequencing data is different. When a lab sequences tumours, the output is not one record but a nested pile — a project, the samples inside it, and the individual sequencing runs those samples produced. Each layer gets its own accession, and the prefix tells you both the layer and the archive.
The same entity, three prefixes
Recall from earlier in the course that the world's raw sequence data is held by the INSDC — the International Nucleotide Sequence Database Collaboration, the partnership of NCBI (USA), ENA (Europe), and DDBJ (Japan). The three archives mirror each other nightly: a record submitted to one appears in all three within a day.
Here is the wrinkle. A BioProject — the top-level record describing one research effort, its goals and its scope — is a single real thing, but each archive stamps it with its own prefix. Same project, three accessions depending on which mirror you are looking at. The pattern repeats for every layer.
| Object | What it names | NCBI | ENA | DDBJ |
|---|---|---|---|---|
| BioProject | The whole study | PRJNA… | PRJEB… | PRJDB… |
| BioSample | One biological source (a tumour, a cell line) | SAMN… | SAMEA… | SAMD… |
| SRA run | One file-set of reads from one sequencing run | SRR… | ERR… | DRR… |
Read the leading letters the way you learned to read a RefSeq prefix a few lessons back. PRJ = project, SAM = sample; the letter after that (N, E, D) is the archive of origin. For runs, the whole prefix shifts: SRA / ENA / DDBJ. See SRR and you know NCBI issued it; see ERR and you know it came in through Europe.
How a study nests
The layers are not siblings — they nest, and understanding the nesting is what lets you navigate a submission. From the top down:
- BioProject (
PRJNA…) — the umbrella. "We sequenced 180 individuals." - BioSample (
SAMN…) — one biological source under that project. One per individual, tissue, or condition. - Experiment (
SRX…/ERX…/DRX…) — a library (prepared DNA/RNA) run on one instrument. Each experiment points at exactly one BioSample. - Run (
SRR…) — the actual data: one set of read files the sequencer emitted. This is what you download.
There is also a Study object (SRP… / ERP… / DRP…), the SRA's own record for the project that a PRJNA maps onto — you will see both accessions for the same effort. The 1000 Genomes Project, for instance, carries BioProject accession PRJNA28889, and its pilot-phase data carries SRA study accession SRP000031: same effort, two labels.
The rule to hold onto: you fetch a Run, never a Project. A BioProject is a description; the reads live in the SRR/ERR/DRR records hanging off its experiments.
Tracing BRCA1 back to reads
Say you are reading a breast-cancer paper that reports a variant in BRCA1 — the tumour-suppressor gene threaded through this whole module (NCBI Gene 672, RefSeq mRNA NM_007294, protein P38398). The variant call is only as trustworthy as the reads behind it, so you want the raw data.
The methods section cites a run: SRR000001. That single accession is a thread you can pull. NCBI's EFetch returns the run's XML, which names the experiment, sample, and study it belongs to:
efetch -db sra -id SRR000001 -format xml | grep -E "PRIMARY_ID|EXTERNAL_ID"Run SRR000001 resolves to experiment SRX000007, and up the chain to study SRP000001 / BioProject PRJNA33627. Now you have walked from one file of reads back to the study that produced it — the reverse of how the data was deposited.
In Biopython, the same walk uses Bio.Entrez. You already met Entrez.email and the 3 req/s unauthenticated cap in What an Accession Number Is:
from Bio import Entrez
Entrez.email = "[email protected]" # NCBI requires a contact address
# From a run accession, find the BioProject it belongs to.
handle = Entrez.esearch(db="sra", term="SRR000001")
sra_uid = Entrez.read(handle)["IdList"][0]
link = Entrez.elink(dbfrom="sra", db="bioproject", id=sra_uid)
proj_uid = Entrez.read(link)[0]["LinkSetDb"][0]["Link"][0]["Id"]
summary = Entrez.esummary(db="bioproject", id=proj_uid)
print(Entrez.read(summary)["DocumentSummarySet"]["DocumentSummary"][0]["Project_Acc"])
# -> PRJNA33627ELink is the workhorse here: it hops between Entrez databases along curated links, turning a run UID into its BioProject UID. The point for now is that the accession is the trail — one identifier is enough to walk the whole hierarchy.
A gotcha that catches everyone once: download tools take a Run accession, not a Project. Handing a PRJNA record to a fetcher like fasterq-dump will fail or do nothing useful — you must first expand the project into its list of SRR runs, then download those. Try it yourself: pick any BioProject in the ENA browser, note how it fans out into dozens of runs, and confirm that only the SRR / ERR rows have files attached.
Why the mirror matters
Because the three archives replicate, SRR000001 (NCBI) and its ERR shadow at ENA point at the same reads — you can fetch from whichever mirror is faster or closer. This is not duplication to be cleaned up; it is deliberate redundancy so the data survives any one archive going dark — our fasterq-dump download guide walks through both routes.
It also means a paper citing PRJEB… and a paper citing the equivalent PRJNA… may be describing one dataset. When accessions look different but the sample counts and titles match, suspect a mirror before you assume two studies. The prefix told you which door you came in; the data behind it is shared.
You can now read a raw-data accession the way you read a sequence accession: layer, archive, and position in the nest, all from the leading letters — and walk from a single run all the way up to the project that made it.