/bio-entrez-link
<!--
$ npx -y skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-entrez-link --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/bio-entrez-link
Context preview
The summary Claude sees to decide when to auto-load this skill.
<!--
SKILL.md
bio-entrez-link.SKILL.md<!--
COPYRIGHT NOTICE
This file is part of the "Universal Biomedical Skills" project.
Copyright (c) 2026 MD BABU MIA, PhD <md.babu.mia@mssm.edu>
All Rights Reserved.
#
This code is proprietary and confidential.
Unauthorized copying of this file, via any medium is strictly prohibited.
#
Provenance: Authenticated by MD BABU MIA
-->
--- name: bio-entrez-link description: Find cross-references between NCBI databases using Biopython Bio.Entrez. Use when navigating from genes to proteins, sequences to publications, finding related records, or discovering database relationships. tool_type: python primary_tool: Bio.Entrez measurable_outcome: Execute skill workflow successfully with valid output within 15 minutes. allowed-tools:
- read_file
- run_shell_command
---
Entrez Link
Navigate between NCBI databases using Biopython's Entrez module (ELink utility).
Required Setup
from Bio import Entrez
Entrez.email = 'your.email@example.com' # Required by NCBI
Entrez.api_key = 'your_api_key' # Optional, raises rate limit
Core Function
Entrez.elink() - Cross-Database Links
Find related records in the same or different databases.
# Find proteins linked to a gene
handle = Entrez.elink(dbfrom='gene', db='protein', id='672')
record = Entrez.read(handle)
handle.close()
# Extract linked IDs
linkset = record[0]
if linkset['LinkSetDb']:
links = linkset['LinkSetDb'][0]['Link']
protein_ids = [link['Id'] for link in links]
print(f"Found {len(protein_ids)} linked proteins")**Key Parameters:** | Parameter | Description | Example | |-----------|-------------|---------| | `dbfrom` | Source database | `'gene'` | | `db` | Target database | `'protein'` | | `id` | Source record ID(s) | `'672'` or `'672,675'` | | `linkname` | Specific link type | `'gene_protein_refseq'` | | `cmd` | Link command | `'neighbor'`, `'neighbor_score'` |
ELink Result Structure
record[0] # First linkset
record[0]['DbFrom'] # Source database
record[0]['IdList'] # Input IDs
record[0]['LinkSetDb'] # List of link results
record[0]['LinkSetDb'][0]['DbTo'] # Target database
record[0]['LinkSetDb'][0]['LinkName'] # Link name
record[0]['LinkSetDb'][0]['Link'] # List of linked records
record[0]['LinkSetDb'][0]['Link'][0]['Id'] # Linked ID
Common Link Paths
Gene to Other Databases
| From | To | Link Name | Description | |------|-----|-----------|-------------| | gene | protein | `gene_protein` | All proteins | | gene | protein | `gene_protein_refseq` | RefSeq proteins only | | gene | nucleotide | `gene_nuccore` | Nucleotide sequences | | gene | nucleotide | `gene_nuccore_refseqrna` | RefSeq mRNA | | gene | pubmed | `gene_pubmed` | Related publications | | gene | homologene | `gene_homologene` | Homologs | | gene | snp | `gene_snp` | SNPs in gene | | gene | clinvar | `gene_clinvar` | Clinical variants |
Nucleotide to Other Databases
| From | To | Link Name | Description | |------|-----|-----------|-------------| | nucleotide | protein | `nuccore_protein` | Encoded proteins | | nucleotide | gene | `nuccore_gene` | Gene records | | nucleotide | pubmed | `nuccore_pubmed` | Publications | | nucleotide | taxonomy | `nuccore_taxonomy` | Organism taxonomy | | nucleotide | biosample | `nuccore_biosample` | Sample info | | nucleotide | sra | `nuccore_sra` | Related SRA data |
Protein to Other Databases
| From | To | Link Name | Description | |------|-----|-----------|-------------| | protein | nucleotide | `protein_nuccore` | Coding sequences | | protein | gene | `protein_gene` | Gene records | | protein | pubmed | `protein_pubmed` | Publications | | protein | structure | `protein_structure` | 3D structures | | protein | cdd | `protein_cdd` | Conserved domains |
PubMed Links
| From | To | Link Name | Description | |------|-----|-----------|-------------| | pubmed | pubmed | `pubmed_pubmed` | Related articles | | pubmed | gene | `pubmed_gene` | Mentioned genes | | pubmed | protein | `pubmed_protein` | Mentioned proteins | | pubmed | nucleotide | `pubmed_nuccore` | Mentioned sequences |
Code Patterns
Gene to Protein
from Bio import Entrez
Entrez.email = 'your.email@example.com'
def get_proteins_for_gene(gene_id):
handle = Entrez.elink(dbfrom='gene', db='protein', id=gene_id, linkname='gene_protein_refseq')
record = Entrez.read(handle)
handle.close()
if not record[0]['LinkSetDb']:
return []
return [link['Id'] for link in record[0]['LinkSetDb'][0]['Link']]
protein_ids = get_proteins_for_gene('672') # BRCA1
print(f"RefSeq proteins: {protein_ids[:5]}")Nucleotide to Gene
def get_gene_for_nucleotide(nuc_id):
handle = Entrez.elink(dbfrom='nucleotide', db='gene', id=nuc_id)
record = Entrez.read(handle)
handle.close()
if not record[0]['LinkSetDb']:
return None
return record[0]['LinkSetDb'][0]['Link'][0]['Id']
gene_id = get_gene_for_nucleotide('NM_007294')
print(f"Gene ID: {gene_id}")Find Related PubMed Articles
def get_related_articles(pmid, max_results=10):
handle = Entrez.elink(dbfrom='pubmed', db='pubmed', id=pmid, linkname='pubmed_pubmed')
record = Entrez.read(handle)
handle.close()
if not record[0]['LinkSetDb']:
return []
links = record[0]['LinkSetDb'][0]['Link']
return [link['Id'] for link in links[:max_results]]
related = get_related_articles('35412348')
print(f"Related articles: {related}")Get All Available Links
def discover_links(db, record_id):
handle = Entrez.elink(dbfrom=db, id=record_id, cmd='acheck')
record = Entrez.read(handle)
handle.close()
links = {}
for linkset in record[0].get('LinkSetDb', []):
links[linkset['LinkName']] = linkset['DbTo']
return links
available = discover_links('gene', '672')
for name, target in available.items():
print(f"Read more
<!--
COPYRIGHT NOTICE
This file is part of the "Universal Biomedical Skills" project.
Copyright (c) 2026 MD BABU MIA, PhD <md.babu.mia@mssm.edu>
All Rights Reserved.
#
This code is proprietary and confidential.
Unauthorized copying of this file, via any medium is strictly prohibited.
#
Provenance: Authenticated by MD BABU MIA
-->
--- name: bio-entrez-link description: Find cross-references between NCBI databases using Biopython Bio.Entrez. Use when navigating from genes to proteins, sequences to publications, finding related records, or discovering database relationships. tool_type: python primary_tool: Bio.Entrez measurable_outcome: Execute skill workflow successfully with valid output within 15 minutes. allowed-tools:
- read_file
- run_shell_command
---
Entrez Link
Navigate between NCBI databases using Biopython's Entrez module (ELink utility).
Required Setup
from Bio import Entrez Entrez.email = 'your.email@example.com' # Required by NCBI Entrez.api_key = 'your_api_key' # Optional, raises rate limit
Core Function
Entrez.elink() - Cross-Database Links
Find related records in the same or different databases.
# Find proteins linked to a gene
handle = Entrez.elink(dbfrom='gene', db='protein', id='672')
record = Entrez.read(handle)
handle.close()
# Extract linked IDs
linkset = record[0]
if linkset['LinkSetDb']:
links = linkset['LinkSetDb'][0]['Link']
protein_ids = [link['Id'] for link in links]
print(f"Found {len(protein_ids)} linked proteins")**Key Parameters:** | Parameter | Description | Example | |-----------|-------------|---------| | `dbfrom` | Source database | `'gene'` | | `db` | Target database | `'protein'` | | `id` | Source record ID(s) | `'672'` or `'672,675'` | | `linkname` | Specific link type | `'gene_protein_refseq'` | | `cmd` | Link command | `'neighbor'`, `'neighbor_score'` |
ELink Result Structure
record[0] # First linkset record[0]['DbFrom'] # Source database record[0]['IdList'] # Input IDs record[0]['LinkSetDb'] # List of link results record[0]['LinkSetDb'][0]['DbTo'] # Target database record[0]['LinkSetDb'][0]['LinkName'] # Link name record[0]['LinkSetDb'][0]['Link'] # List of linked records record[0]['LinkSetDb'][0]['Link'][0]['Id'] # Linked ID
Common Link Paths
Gene to Other Databases
| From | To | Link Name | Description | |------|-----|-----------|-------------| | gene | protein | `gene_protein` | All proteins | | gene | protein | `gene_protein_refseq` | RefSeq proteins only | | gene | nucleotide | `gene_nuccore` | Nucleotide sequences | | gene | nucleotide | `gene_nuccore_refseqrna` | RefSeq mRNA | | gene | pubmed | `gene_pubmed` | Related publications | | gene | homologene | `gene_homologene` | Homologs | | gene | snp | `gene_snp` | SNPs in gene | | gene | clinvar | `gene_clinvar` | Clinical variants |
Nucleotide to Other Databases
| From | To | Link Name | Description | |------|-----|-----------|-------------| | nucleotide | protein | `nuccore_protein` | Encoded proteins | | nucleotide | gene | `nuccore_gene` | Gene records | | nucleotide | pubmed | `nuccore_pubmed` | Publications | | nucleotide | taxonomy | `nuccore_taxonomy` | Organism taxonomy | | nucleotide | biosample | `nuccore_biosample` | Sample info | | nucleotide | sra | `nuccore_sra` | Related SRA data |
Protein to Other Databases
| From | To | Link Name | Description | |------|-----|-----------|-------------| | protein | nucleotide | `protein_nuccore` | Coding sequences | | protein | gene | `protein_gene` | Gene records | | protein | pubmed | `protein_pubmed` | Publications | | protein | structure | `protein_structure` | 3D structures | | protein | cdd | `protein_cdd` | Conserved domains |
PubMed Links
| From | To | Link Name | Description | |------|-----|-----------|-------------| | pubmed | pubmed | `pubmed_pubmed` | Related articles | | pubmed | gene | `pubmed_gene` | Mentioned genes | | pubmed | protein | `pubmed_protein` | Mentioned proteins | | pubmed | nucleotide | `pubmed_nuccore` | Mentioned sequences |
Code Patterns
Gene to Protein
from Bio import Entrez
Entrez.email = 'your.email@example.com'
def get_proteins_for_gene(gene_id):
handle = Entrez.elink(dbfrom='gene', db='protein', id=gene_id, linkname='gene_protein_refseq')
record = Entrez.read(handle)
handle.close()
if not record[0]['LinkSetDb']:
return []
return [link['Id'] for link in record[0]['LinkSetDb'][0]['Link']]
protein_ids = get_proteins_for_gene('672') # BRCA1
print(f"RefSeq proteins: {protein_ids[:5]}")Nucleotide to Gene
def get_gene_for_nucleotide(nuc_id):
handle = Entrez.elink(dbfrom='nucleotide', db='gene', id=nuc_id)
record = Entrez.read(handle)
handle.close()
if not record[0]['LinkSetDb']:
return None
return record[0]['LinkSetDb'][0]['Link'][0]['Id']
gene_id = get_gene_for_nucleotide('NM_007294')
print(f"Gene ID: {gene_id}")Find Related PubMed Articles
def get_related_articles(pmid, max_results=10):
handle = Entrez.elink(dbfrom='pubmed', db='pubmed', id=pmid, linkname='pubmed_pubmed')
record = Entrez.read(handle)
handle.close()
if not record[0]['LinkSetDb']:
return []
links = record[0]['LinkSetDb'][0]['Link']
return [link['Id'] for link in links[:max_results]]
related = get_related_articles('35412348')
print(f"Related articles: {related}")Get All Available Links
def discover_links(db, record_id):
handle = Entrez.elink(dbfrom=db, id=record_id, cmd='acheck')
record = Entrez.read(handle)
handle.close()
links = {}
for linkset in record[0].get('LinkSetDb', []):
links[linkset['LinkName']] = linkset['DbTo']
return links
available = discover_links('gene', '672')
for name, target in available.items():
print(f"The largest open-source medical AI skill library for OpenClaw.
Other skills on openclaw-medical-skills.
adaptyv
Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding…
adhd-daily-planner
Time-blind friendly planning, executive function support, and daily structure for ADHD brains. Specializes in realistic time estimation, dopamine-aware task…
aeon
This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection,…
agent-browser
Browse the web for any task — research topics, read articles, interact with web apps, fill forms, take screenshots, extract data, and test web pages. Use…

