/genome-annotation:gene-lookupfrom genome-annotation
Resolves gene and protein accessions from UniProt, Ensembl, FlyBase, WormBase, and NCBI/RefSeq to readable gene symbols. Handles ID detection, cross-referencing, and batch lookups for phylogenetic tree labels or any analysis with biological identifiers.
Ships in genome-annotation. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Resolve accessions to gene symbols across biological databases. Add new databases as we encounter them.
tr|Q9R1A3|...)accession_gene_map.tsv for the tree-formatting skillIdentify the database from the accession pattern:
| Pattern | Database | Example |
|---|---|---|
sp|ACC|ENTRY_SPECIES | UniProt Swiss-Prot | sp|O95631|NET1_HUMAN |
tr|ACC|ACC_SPECIES | UniProt TrEMBL | tr|Q23158|Q23158_CAEEL |
6-10 alphanum (e.g., Q9R1A3) | UniProt accession | A0A8C1NMY5 |
ENS[species]G\d{11} | Ensembl gene | ENSG00000139618, ENSMUSG00000017146 |
ENS[species]P\d{11} | Ensembl protein | ENSP00000369497, ENSDARP00000012345 |
ENS[species]T\d{11} | Ensembl transcript | ENST00000380152 |
FBgn\d{7} | FlyBase gene | FBgn0000490 |
FBpp\d{7} | FlyBase polypeptide | FBpp0082828 |
FBtr\d{7} | FlyBase transcript | FBtr0083387 |
WBGene\d{8} | WormBase gene | WBGene00006763 |
CE\d+ | WormBase protein | CE28580 |
XP_\d+\.\d+ | NCBI RefSeq predicted protein | XP_032238380.2 |
NP_\d+\.\d+ | NCBI RefSeq curated protein | NP_000537.3 |
XM_\d+\.\d+ / NM_\d+\.\d+ | NCBI RefSeq mRNA | NM_000546.6 |
sp| and tr|
labels contain an entry mnemonic, which is not reliable gene identity. For example,
sp|O95631|NET1_HUMAN has accession O95631 and actual gene NTN1, not NET1.GN= field, or the appropriate database
lookup below. A missing gene stays unresolved; retain its accession.accession_gene_map.tsv in the lookup producer's
output directory (for example outs/gene_lookup/). Use accession, gene_name
columns and optionally database, species, source/version evidence. Keep one row
per accession; different accessions may legitimately share a gene name.gene_map_file input
to that file. Validate unique accession keys; never deduplicate sequences by gene name.sp|ACC|ENTRY_SPECIES or tr|ACC|ENTRY_SPECIES in tip labelsQ9R1A3, A0A8C1NMY5)sp|, tr| and bare accessions: use the actual gene field from a supplied mapping
or REST API batch query. Never infer it from the entry mnemonic.GN=...; use that explicit field
only when the header is independently available and matches the accession. A short
tree tip such as sp|O95631|NET1_HUMAN contains no such gene field.# Batch up to ~200 accessions per request
query_str <- paste0("(", paste0("accession:", accessions, collapse = " OR "), ")")
url <- paste0(
"https://rest.uniprot.org/uniprotkb/search?",
"query=", URLencode(query_str, reserved = TRUE),
"&fields=accession,gene_primary&format=tsv&size=500"
)
result <- read.delim(url(url), stringsAsFactors = FALSE)
# Columns: "Entry" (accession), "Gene.Names..primary." (gene symbol)
For cross-database conversions (e.g., FBgn → UniProt, WBGene → UniProt):
https://rest.uniprot.org/idmapping/run with from, to, idshttps://rest.uniprot.org/idmapping/status/{jobId}from=FlyBase, from=WormBase, to=UniProtKBENS + optional species code + feature type letter + 11 digits.
| Species | Gene | Protein |
|---|---|---|
| Human | ENSG00000000000 | ENSP00000000000 |
| Mouse | ENSMUSG00000000000 | ENSMUSP00000000000 |
| Zebrafish | ENSDARG00000000000 | ENSDARP00000000000 |
| Chicken | ENSGALG00000000000 | ENSGALP00000000000 |
| Ciona | ENSCING00000000000 | ENSCINP00000000000 |
Ensembl Metazoa species (Amphimedon, Nematostella, etc.) use the same REST API.
Base URL: https://rest.ensembl.org
Gene IDs → symbol (1 batch call):
/lookup/id with {"ids": ["ENSG...", ...]} (max 1000 per request)display_name fieldProtein IDs → symbol (2 batch calls):
Protein (Translation) objects have NO display_name. Must chain through parents:
Parent transcript IDsdisplay_name (format: GENE-NNN, e.g., BRCA2-201)sub("-\\d+$", "", display_name)# Batch POST (up to 1000 IDs)
resp <- httr2::request("https://rest.ensembl.org") |>
httr2::req_url_path("lookup", "id") |>
httr2::req_headers("Content-Type" = "application/json",
"Accept" = "application/json") |>
httr2::req_body_json(list(ids = id_vector)) |>
httr2::req_perform()
results <- httr2::resp_body_json(resp)
expand=1 fails on protein IDs — returns nullnull for unknown IDs — handle gracefullyENSG...19) and unversioned IDs acceptedFBgn, FBpp, FBtr + 7-digit zero-padded number (e.g., FBgn0000490).
Best approach: FlyBase precomputed bulk file (not the API — it lacks ID-to-symbol endpoints and is unreliable).
For FBgn only — lightweight file:
https://s3ftp.flybase.org/releases/current/precomputed_files/genes/fbgn_annotation_ID_fb_YYYY_NN.tsv.gz
Columns: gene_symbol, organism_abbreviation, primary_FBgn#, ...
For FBgn, FBtr, AND FBpp — expanded file (needed for polypeptide IDs):
https://s3ftp.flybase.org/releases/current/precomputed_files/genes/fbgn_fbtr_fbpp_expanded_fb_YYYY_NN.tsv.gz
Columns: gene_ID, gene_symbol, transcript_ID, polypeptide_ID, ...
~36K rows. Download once, cache locally.
R/Bioconductor alternative (FBgn only):
library(org.Dm.eg.db)
symbols <- AnnotationDbi::mapIds(org.Dm.eg.db,
keys = fbgn_ids, column = "SYMBOL", keytype = "FLYBASE")
Use keytype = "FLYBASE" (not "ENSEMBL") for FBgn IDs.
UniProt ID mapping also works for FBgn → gene symbol (via from=FlyBase,
to=UniProtKB), but does NOT work for FBpp or FBtr.
Dmel\ prefix: FlyBase uses species prefixes for non-melanogaster genes
(e.g., Dvir\Dfd). In UniProt, Drosophila gene names sometimes carry
Dmel\ prefix — strip with sub("^Dmel\\\\", "", gene)dpp),
uppercase initial = dominant or molecular function (e.g., Abd-B)current URL alias always points to latestWBGene + 8-digit zero-padded number (e.g., WBGene00006763)CE + digits (e.g., CE28580)JC8.10, C15F1.7Best approach: WormBase ParaSite REST API (has batch support, works for all nematode species).
POST https://parasite.wormbase.org/rest-19/lookup/id
Content-Type: application/json
Accept: application/json
{"ids": ["WBGene00006763", "WBGene00004930"]}
display_name field (e.g., unc-26, sod-1)rest-19) or follow 307 redirect from /rest/For richer per-gene data (aliases, descriptions), use the WormBase REST API:
GET https://rest.wormbase.org/rest/field/gene/WBGene00006763/name
Returns data.label = gene symbol. No batch support — single-gene queries only.
unc-26,
spc-1). Letter prefix is the "gene class" from mutant phenotypeJC8.10)from=WormBase) works for WBGene IDs but is a multi-step
process — ParaSite is simplerfrom=WBParaSite does NOT work with WBGene IDs in UniProt ID mappingPREFIX_DIGITS.VERSION:
| Prefix | Type | Example |
|---|---|---|
XP_ | Predicted protein | XP_032238380.2 |
NP_ | Curated protein | NP_000537.3 |
XM_ | Predicted mRNA | XM_032382489.2 |
NM_ | Curated mRNA | NM_000546.6 |
Both versioned and unversioned forms accepted by NCBI APIs.
Best approach: NCBI Datasets API (single GET, clean JSON — much simpler than E-utilities).
GET https://api.ncbi.nlm.nih.gov/datasets/v2/gene/accession/{comma_separated_accessions}
reports[].gene.symbolgene_id, description, taxnameurl <- paste0(
"https://api.ncbi.nlm.nih.gov/datasets/v2/gene/accession/",
paste(accessions, collapse = ",")
)
resp <- httr2::request(url) |>
httr2::req_headers(Accept = "application/json") |>
httr2::req_perform()
body <- httr2::resp_body_json(resp)
# body$reports[[i]]$gene$symbol
https://account.ncbi.nlm.nih.gov/settings/, pass via
?api_key=KEY parameterLOC + number as gene symbol (e.g.,
LOC5512993 for Nematostella) — this means no official symbol assignedAll lookups should produce a TSV file (accession_gene_map.tsv) with at minimum:
accession gene_name
Q9R1A3 Sptbn1
Q23158 unc-70
Q9VZU3 betaSpec
XP_032238380.2 LOC5512993
Optional extra columns: database, species, gene_id, source/version evidence.
Do not drop accessions whose gene field is blank or unavailable. A map with only an
accession column is allowed by the tree templates, but supplies no gene names.
Duplicate accession keys stop the consumer for correction; repeated gene symbols do
not merge tree tips or sequences.
The tree-formatting templates load this file automatically:
gene_map_file <- "outs/gene_lookup/accession_gene_map.tsv"
# The tree templates validate accession keys before constructing their lookup.
# Missing/blank gene names retain the accession and are counted in diagnostics.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub musserlab/lab-claude-skills --plugin genome-annotation5 skills in this plugin
/buscoRun BUSCO completeness assessment on genomes, transcriptomes, or predicted proteomes. Generates conda env setup, shared-lineage download, SLURM array scripts with sample-sheet-driven (input × lineage) fan-out, a local single-input fallback, and an aggregator. Use when running BUSCO, assessing genome/transcriptome/proteome completeness, scoring against an odb10 lineage, or when the user mentions "BUSCO", "BUSCO score", "completeness", "C/S/D/F/M", "ortholog completeness", "genome/transcriptome/assembly QC", or asks whether an assembly is complete. Sanitizes FASTA headers automatically — BUSCO 6.x rejects "/" in headers, which trips up IsoSeq3 transcripts. Do NOT load for FCS-GX foreign-sequence screening (use fcs-gx), eggNOG-mapper functional annotation (use eggnog-mapper), or PROST structural homology (use prost-annotation)./hmmerRun HMMER profile-HMM searches (hmmscan / hmmsearch / phmmer / hmmbuild / jackhmmer) for protein-family detection, marker-gene extraction from assemblies, and custom HMM profiles. Generates conda env setup, Pfam-HMM download + hmmpress, SLURM array scripts with sample-sheet fan-out, a local single-input fallback, and a tblout aggregator. Covers nucleotide inputs (6-frame translation with the right genetic code) and protein inputs. Use when the user mentions "HMMER", "hmmscan", "hmmsearch", "phmmer", "Pfam", "profile HMM", "custom HMM", "domain detection", "marker-gene extraction", "CO1 / COX2 / COX3 / cyt-b", or asks to find members of a protein family in a non-model proteome/transcriptome. Do NOT load for whole-proteome functional annotation (use eggnog-mapper, which wraps HMMER), structural homology of distant relatives (use prost-annotation), or BLAST-style top-hit searches without HMMER's profile statistics (use BLAST directly).