Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

bio-entrez-link

БесплатноЗапускает вложенные скриптыНе проверен

Find cross-database references between NCBI databases using Biopython Bio.Entrez (ELink). Use when navigating gene to protein/structure, sequence to…

gabrielmoreiraот gabrielmoreira★ 23 звезды на GitHub

Об этом скилле

Version Compatibility

Reference examples tested with: BioPython 1.83+, Entrez Direct 21.0+

Before using code patterns, verify installed versions match. If versions differ:

  • Python: pip show biopython then help(Bio.Entrez.elink) to check signatures
  • CLI: elink -version then elink -help to confirm flags

If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.

Entrez Link

"Find records linked to this record in another NCBI database" -> ELink walks the curated, weekly-maintained link tables between Entrez databases. A link is an asserted relationship (e.g. "this PubMed article describes this nucleotide sequence"), not a similarity hit.

ELink is the navigation layer of Entrez. The decision that matters most is which linkname to use — not which databases. A single (dbfrom, db) pair can have a dozen linkname variants distinguishing curation level, evidence type, and direction. Picking the wrong one is the difference between 5 high-confidence matches and 500 noisy automated assertions.

  • Python: Entrez.elink(dbfrom=..., db=..., id=..., linkname=...) (BioPython)
  • CLI: elink -db pubmed -target gene -name pubmed_gene_rif (Entrez Direct)
  • R: entrez_link(dbfrom=..., db=..., id=...) (rentrez)

Required Setup

from Bio import Entrez
Entrez.email = '[email protected]'
Entrez.api_key = 'optional_api_key'  # raises rate to 10 req/sec

The linkname decision (most important)

For most (dbfrom, db) pairs NCBI exposes multiple link tables. The qualifiers in the name encode the curation level and the evidence source. Choose deliberately.

gene -> protein (representative example)

linkname Returns When to use
gene_protein All linked proteins (curated + automated) Exploration; expect 10-1000x more hits
gene_protein_refseq RefSeq proteins only Reference-quality analyses; orthology
gene_protein_swissprot Reviewed UniProt entries with NCBI cross-ref Functional annotation; literature support

pubmed -> gene

linkname Returns
pubmed_gene Genes mentioned in this paper (text-mined + curated)
pubmed_gene_rif Genes with a Reference Into Function (curated, high-quality)
pubmed_gene_pubmed Other PubMed records sharing gene linkage (rare use)

nucleotide -> protein

linkname Returns
nuccore_protein All proteins encoded by this nucleotide record (CDS-linked)
nuccore_protein_refseq RefSeq proteins only

Discover what link names exist for a pair

h = Entrez.elink(dbfrom='gene', db='protein', id='672', cmd='acheck')
record = Entrez.read(h); h.close()
for ls in record[0]['IdCheckList']['IdLinkSet'][0]['LinkInfo']:
    print(f'{ls["Name"]}  -> {ls["DbTo"]} | {ls["MenuTag"]} ({ls["HtmlTag"]})')

cmd='acheck' is the only authoritative way to enumerate available linknames — they change with each NCBI release.

Decision table: which cmd for which goal

Goal cmd Returns
Get linked records neighbor (default) Linked IDs in target db
Get linked + relevance scores neighbor_score IDs with similarity scores (mostly pubmed_pubmed)
Get >200 source IDs in one go neighbor_history WebEnv + QueryKey for downstream EFetch
Enumerate available links acheck List of all linknames for source IDs
Check if any link exists ncheck Boolean per source ID
Check specific link exists lcheck Boolean per source ID + linkname
Get NCBI HTML link URLs llinks URLs to Entrez record pages
Get external provider links prlinks URLs to journal sites, etc.

The neighbor_history cmd is essential when source id count exceeds ~200 — past that, the URL-length limit makes the comma-joined form fail. With neighbor_history ELink puts results on the history server and returns WebEnv/QueryKey for downstream pickup.

Asymmetric link warning

ELink relationships are not guaranteed symmetric. pubmed_gene and gene_pubmed may return different sets because:

  • Direction-dependent curation: gene-to-PubMed is curated by NCBI staff (GeneRIF); PubMed-to-gene includes text-mining.
  • Cutoffs: some link tables truncate at N best links in one direction but not the other.
  • Index lag asymmetry: when one db updates faster than the other.

If round-trip consistency matters (e.g. "every gene mentioned in this paper, then every paper mentioning each gene"), expect the round-trip set to be larger than the input — and never assume A -> B -> A returns the original ID alone.

Per-database link catalog (curated subset)

gene

Target Common linknames Notes
protein gene_protein, gene_protein_refseq, gene_protein_swissprot RefSeq is the safe default
nuccore gene_nuccore, gene_nuccore_refseqrna, gene_nuccore_refseqgene
Полный SKILL.md на GitHub

Установить bio-entrez-link в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/basic_linking.pyexamples/chain_links.pyexamples/discover_links.pyusage-guide.md

FAQ

Что делает скилл bio-entrez-link?

Find cross-database references between NCBI databases using Biopython Bio.Entrez (ELink). Use when navigating gene to protein/structure, sequence to publication, PubMed to GEO, BioProject to SRA runs, or discovering all link relationships for a record. Covers linkname semantics, cmd= variants, asymmetric link warnings, neighbor_history for >200 input IDs, and per-database link tables.

Как установить скилл bio-entrez-link?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл bio-entrez-link запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить bio-entrez-link с