Bioinformatics Databases

Lesson 16 of 20 · 10 min

db_xref: How Records Point at Each Other

By the end of this lesson you will be able to open any RefSeq record, read its cross-references like a map, and follow BRCA1 out to OMIM, CCDS, and the Conserved Domain Database without guessing which field means what.

The pointer, not the destination

You already know the pieces this lesson connects. NCBI Gene: the Gene-Centric Hub introduced db_xref as "a typed pointer of the form database:identifier" and showed Gene ID 672 radiating out to HGNC, Ensembl, and OMIM. RefSeq: Curated Reference Sequences showed the COMMENT block on NM_007294 naming the raw accessions it was built from. This lesson is the mechanics behind both: exactly which tag does which job, and how far you can trust it.

A db_xref lives inside a feature — the gene feature, the CDS feature — as a qualifier line. It is not free text; it always has the shape db_xref="DATABASE:ID", so a script can parse it without guessing. That structure is what makes cross-referencing automatable instead of a manual lookup chore.

Reading BRCA1's own db_xrefs

Fetch NM_007294 in full GenBank format and look inside the gene feature. Live in 2026 it carries:

db_xrefPoints toWhat it means
GeneID:672NCBI Genethe gene-centric hub record for BRCA1
HGNC:HGNC:1100HGNCthe approved symbol authority
MIM:113705OMIMthe inherited-disease and phenotype entry
CCDS:CCDS11453.1CCDSthe Consensus CDS project's agreed coding sequence

The CDS feature on the same record repeats GeneID, HGNC, MIM, and CCDS, because the coding region is the part those databases actually care about. CCDS (Consensus CDS) is a joint NCBI/Ensembl/HGNC project that certifies one coding sequence as identical across annotation pipelines — a db_xref to it is a second, independent stamp of agreement, and a separate kind of consensus from the single-agreed-transcript project covered later in this module.

python
from Bio import Entrez, SeqIO

Entrez.email = "[email protected]"        # NCBI requires a contact address
with Entrez.efetch(db="nuccore", id="NM_007294",
                   rettype="gb", retmode="text") as handle:
    record = SeqIO.read(handle, "genbank")

for feature in record.features:
    if feature.type == "gene":
        print(feature.qualifiers.get("db_xref"))
        # ['taxon:9606', 'GeneID:672', 'HGNC:HGNC:1100', 'MIM:113705']

The protein record adds CDD

Fetch the paired protein, NP_009225, and a new database shows up. Its Region features — the annotated domains along the sequence — each carry a db_xref into CDD, NCBI's own Conserved Domain Database of protein-domain models: CDD:438161 and CDD:463719 on the live record. Those two hits mark BRCA1's BRCT-repeat region, the same domain whose crystal structure you can look up directly at 1JNX in the PDB, and its RING domain, solved in complex with BARD1 at 1JM7. A db_xref on a sequence record and an accession in a structure database are two views of the identical fold.

Gotcha: UniProt is not a db_xref on the RefSeq protein record — check and you will not find a UniProtKB: line. Instead, individual feature annotations (phosphorylation sites, disordered regions) carry a comment saying they were "propagated from UniProtKB/Swiss-Prot (P38398.2)." That is citation, not a formal pointer. Do not assume every cross-database relationship uses the same mechanism — some are typed db_xref tags you can parse, others are prose you have to read.

COMMENT: provenance, not cross-reference

Do not confuse a db_xref with the COMMENT field. A db_xref says "this record corresponds to that record, right now, in another database." COMMENT says "this record was built from these other records." On NM_007294 the COMMENT reads: "The reference sequence was derived from AL701927.1, U14680.1, BC072418.1, BU617173.1 and BU679389.1" — five raw INSDC submissions RefSeq's curators merged into one clean transcript.

That is the difference between lateral and vertical links. db_xref points sideways, to a peer record in another resource. COMMENT points backward, to the archive evidence a curated record rests on. Both matter for reproducibility, but they answer different questions: "where else does this concept live" versus "what was this record made from."

Chaining xrefs into a dossier

None of this is useful in isolation — it is useful because the pointers chain. Start at Gene ID 672, follow its db_xref to MIM:113705 for the clinical picture, follow RefSeq's db_xref to CCDS:CCDS11453.1 for the cross-pipeline-agreed coding sequence, follow the protein's db_xref to CDD:438161 for the BRCT domain model, and you have assembled a dossier without ever typing "BRCA1" into a second search box. Every hop was a typed, parseable pointer.

The next lesson turns this into a repeatable skill rather than a one-off trace: ID Mapping in Practice takes a list of identifiers in one namespace and converts it in bulk to another, using exactly the db_xref relationships you just learned to read by hand.