/bio-entrez-fetch
<!--
Claude Code
$ npx -y skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-entrez-fetch --agent claude-code
Codex
$ npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-entrez-fetch -a codex -y
Cursor
$ npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-entrez-fetch -a cursor -y
Gemini CLI
$ npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-entrez-fetch -a gemini-cli -y
GitHub Copilot
$ npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-entrez-fetch -a github-copilot -y
OpenCode
$ npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-entrez-fetch -a opencode -y
Windsurf
$ npx skills add FreedomIntelligence/OpenClaw-Medical-Skills --skill bio-entrez-fetch -a windsurf -y
SKILL.md
bio-entrez-fetch.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-fetch description: Retrieve records from NCBI databases using Biopython Bio.Entrez. Use when downloading sequences, fetching GenBank records, getting document summaries, or parsing NCBI data into Biopython objects. 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 Fetch
Retrieve records from NCBI databases using Biopython's Entrez module (EFetch, ESummary utilities).
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 3->10 req/sec
Core Functions
Entrez.efetch() - Retrieve Full Records
Fetch complete records in various formats from any NCBI database.
# Fetch GenBank record by ID
handle = Entrez.efetch(db='nucleotide', id='NM_007294', rettype='gb', retmode='text')
genbank_text = handle.read()
handle.close()
# Fetch FASTA sequence
handle = Entrez.efetch(db='nucleotide', id='NM_007294', rettype='fasta', retmode='text')
fasta_text = handle.read()
handle.close()
# Fetch multiple records
handle = Entrez.efetch(db='nucleotide', id='NM_007294,NM_000059', rettype='fasta', retmode='text')
**Key Parameters:** | Parameter | Description | Example | |-----------|-------------|---------| | `db` | Database name | `'nucleotide'`, `'protein'`, `'pubmed'` | | `id` | Record ID(s) | `'NM_007294'` or `'123,456,789'` | | `rettype` | Return type | `'fasta'`, `'gb'`, `'abstract'` | | `retmode` | Return mode | `'text'`, `'xml'` | | `retstart` | Start index | `0` | | `retmax` | Max records | `20` | | `WebEnv` | History server session | From esearch | | `query_key` | History server query | From esearch |
Common Return Types by Database
**Nucleotide/Protein:** | rettype | retmode | Description | |---------|---------|-------------| | `'fasta'` | `'text'` | FASTA sequence | | `'gb'` | `'text'` | GenBank flat file | | `'gp'` | `'text'` | GenPept flat file (protein) | | `'gbwithparts'` | `'text'` | GenBank with contig sequences | | `'seqid'` | `'text'` | Seq-id only | | `'acc'` | `'text'` | Accession only |
**PubMed:** | rettype | retmode | Description | |---------|---------|-------------| | `'abstract'` | `'text'` | Abstract text | | `'medline'` | `'text'` | MEDLINE format | | `'xml'` | `'xml'` | Full PubMed XML |
**Gene:** | rettype | retmode | Description | |---------|---------|-------------| | `'gene_table'` | `'text'` | Gene table format | | `'xml'` | `'xml'` | Full gene XML |
Entrez.esummary() - Document Summaries
Get brief summaries without downloading full records. Faster than efetch.
# Get summary for nucleotide record
handle = Entrez.esummary(db='nucleotide', id='NM_007294')
record = Entrez.read(handle)
handle.close()
summary = record[0] # First (only) record
print(f"Title: {summary['Title']}")
print(f"Length: {summary['Length']}")
print(f"Organism: {summary['Organism']}")**Common Summary Fields:**
# Nucleotide/Protein
summary['Title'] # Record title/description
summary['Caption'] # Short identifier
summary['Length'] # Sequence length
summary['Organism'] # Source organism
summary['TaxId'] # Taxonomy ID
summary['AccessionVersion'] # Full accession.version
# PubMed
summary['Title'] # Article title
summary['AuthorList'] # Authors
summary['Source'] # Journal
summary['PubDate'] # Publication date
summary['DOI'] # Digital Object Identifier
Parsing with Biopython
Parse into SeqRecord Objects
from Bio import Entrez, SeqIO
Entrez.email = 'your.email@example.com'
# Parse GenBank into SeqRecord
handle = Entrez.efetch(db='nucleotide', id='NM_007294', rettype='gb', retmode='text')
record = SeqIO.read(handle, 'genbank')
handle.close()
print(f"ID: {record.id}")
print(f"Length: {len(record.seq)}")
print(f"Features: {len(record.features)}")
# Parse FASTA into SeqRecord
handle = Entrez.efetch(db='nucleotide', id='NM_007294', rettype='fasta', retmode='text')
record = SeqIO.read(handle, 'fasta')
handle.close()Parse Multiple Records
# Fetch multiple as FASTA
handle = Entrez.efetch(db='nucleotide', id='NM_007294,NM_000059,NM_000546', rettype='fasta', retmode='text')
records = list(SeqIO.parse(handle, 'fasta'))
handle.close()
for record in records:
print(f"{record.id}: {len(record.seq)} bp")Parse XML with Entrez.read()
# For structured data, use XML mode
handle = Entrez.efetch(db='gene', id='672', retmode='xml')
records = Entrez.read(handle)
handle.close()
# Navigate nested structure
gene = records[0]
print(f"Gene: {gene['Entrezgene_gene']['Gene-ref']['Gene-ref_locus']}")Code Patterns
Fetch Sequence by Accession
from Bio import Entrez, SeqIO
Entrez.email = 'your.email@example.com'
def fetch_sequence(accession, db='nucleotide'):
handle = Entrez.efetch(db=db, id=accession, rettype='fasta', retmode='text')
record = SeqIO.read(handle, 'fasta')
handle.close()
return record
seq = fetch_sequence('NM_007294')
print(f"{seq.id}: {seq.seq[:50]}...")Fetch GenBank with Features
def fetch_genbank(accession):
handle = Entrez.efetch(db='nucleotide', id=accession, rettype='gb', retmode='text')
record = SeqIO.read(handle, 'genbank')
handle.close()
return record
gb = fetch_genbank('NM_007294')
for feature in gb.features:
if feature.type == 'CDS':
print(f"CDS: {feature.location}")
priRead 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-fetch description: Retrieve records from NCBI databases using Biopython Bio.Entrez. Use when downloading sequences, fetching GenBank records, getting document summaries, or parsing NCBI data into Biopython objects. 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 Fetch
Retrieve records from NCBI databases using Biopython's Entrez module (EFetch, ESummary utilities).
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 3->10 req/sec
Core Functions
Entrez.efetch() - Retrieve Full Records
Fetch complete records in various formats from any NCBI database.
# Fetch GenBank record by ID handle = Entrez.efetch(db='nucleotide', id='NM_007294', rettype='gb', retmode='text') genbank_text = handle.read() handle.close() # Fetch FASTA sequence handle = Entrez.efetch(db='nucleotide', id='NM_007294', rettype='fasta', retmode='text') fasta_text = handle.read() handle.close() # Fetch multiple records handle = Entrez.efetch(db='nucleotide', id='NM_007294,NM_000059', rettype='fasta', retmode='text')
**Key Parameters:** | Parameter | Description | Example | |-----------|-------------|---------| | `db` | Database name | `'nucleotide'`, `'protein'`, `'pubmed'` | | `id` | Record ID(s) | `'NM_007294'` or `'123,456,789'` | | `rettype` | Return type | `'fasta'`, `'gb'`, `'abstract'` | | `retmode` | Return mode | `'text'`, `'xml'` | | `retstart` | Start index | `0` | | `retmax` | Max records | `20` | | `WebEnv` | History server session | From esearch | | `query_key` | History server query | From esearch |
Common Return Types by Database
**Nucleotide/Protein:** | rettype | retmode | Description | |---------|---------|-------------| | `'fasta'` | `'text'` | FASTA sequence | | `'gb'` | `'text'` | GenBank flat file | | `'gp'` | `'text'` | GenPept flat file (protein) | | `'gbwithparts'` | `'text'` | GenBank with contig sequences | | `'seqid'` | `'text'` | Seq-id only | | `'acc'` | `'text'` | Accession only |
**PubMed:** | rettype | retmode | Description | |---------|---------|-------------| | `'abstract'` | `'text'` | Abstract text | | `'medline'` | `'text'` | MEDLINE format | | `'xml'` | `'xml'` | Full PubMed XML |
**Gene:** | rettype | retmode | Description | |---------|---------|-------------| | `'gene_table'` | `'text'` | Gene table format | | `'xml'` | `'xml'` | Full gene XML |
Entrez.esummary() - Document Summaries
Get brief summaries without downloading full records. Faster than efetch.
# Get summary for nucleotide record
handle = Entrez.esummary(db='nucleotide', id='NM_007294')
record = Entrez.read(handle)
handle.close()
summary = record[0] # First (only) record
print(f"Title: {summary['Title']}")
print(f"Length: {summary['Length']}")
print(f"Organism: {summary['Organism']}")**Common Summary Fields:**
# Nucleotide/Protein summary['Title'] # Record title/description summary['Caption'] # Short identifier summary['Length'] # Sequence length summary['Organism'] # Source organism summary['TaxId'] # Taxonomy ID summary['AccessionVersion'] # Full accession.version # PubMed summary['Title'] # Article title summary['AuthorList'] # Authors summary['Source'] # Journal summary['PubDate'] # Publication date summary['DOI'] # Digital Object Identifier
Parsing with Biopython
Parse into SeqRecord Objects
from Bio import Entrez, SeqIO
Entrez.email = 'your.email@example.com'
# Parse GenBank into SeqRecord
handle = Entrez.efetch(db='nucleotide', id='NM_007294', rettype='gb', retmode='text')
record = SeqIO.read(handle, 'genbank')
handle.close()
print(f"ID: {record.id}")
print(f"Length: {len(record.seq)}")
print(f"Features: {len(record.features)}")
# Parse FASTA into SeqRecord
handle = Entrez.efetch(db='nucleotide', id='NM_007294', rettype='fasta', retmode='text')
record = SeqIO.read(handle, 'fasta')
handle.close()Parse Multiple Records
# Fetch multiple as FASTA
handle = Entrez.efetch(db='nucleotide', id='NM_007294,NM_000059,NM_000546', rettype='fasta', retmode='text')
records = list(SeqIO.parse(handle, 'fasta'))
handle.close()
for record in records:
print(f"{record.id}: {len(record.seq)} bp")Parse XML with Entrez.read()
# For structured data, use XML mode
handle = Entrez.efetch(db='gene', id='672', retmode='xml')
records = Entrez.read(handle)
handle.close()
# Navigate nested structure
gene = records[0]
print(f"Gene: {gene['Entrezgene_gene']['Gene-ref']['Gene-ref_locus']}")Code Patterns
Fetch Sequence by Accession
from Bio import Entrez, SeqIO
Entrez.email = 'your.email@example.com'
def fetch_sequence(accession, db='nucleotide'):
handle = Entrez.efetch(db=db, id=accession, rettype='fasta', retmode='text')
record = SeqIO.read(handle, 'fasta')
handle.close()
return record
seq = fetch_sequence('NM_007294')
print(f"{seq.id}: {seq.seq[:50]}...")Fetch GenBank with Features
def fetch_genbank(accession):
handle = Entrez.efetch(db='nucleotide', id=accession, rettype='gb', retmode='text')
record = SeqIO.read(handle, 'genbank')
handle.close()
return record
gb = fetch_genbank('NM_007294')
for feature in gb.features:
if feature.type == 'CDS':
print(f"CDS: {feature.location}")
priOther skills on openclaw-medical-skills.
adaptyv
Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental…
adhd-daily-planner
Time-blind friendly planning, executive function support, and daily structure for ADHD brains. Specializes in realistic time…
aeon
This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting,…
agent-browser
Browse the web for any task — research topics, read articles, interact with web apps, fill forms, take screenshots, extract data,…
More skills from other plugins.
paddleocr-doc-parsing
Use this skill to extract structured Markdown/JSON from PDFs and document images—tables with cell-level precision, formulas as…
13c-metabolic-flux
Estimates intracellular metabolic fluxes from steady-state carbon-13 isotope-tracing measurements using validated atom maps,…
Questions about bio-entrez-fetch.
- Which coding agents can use bio-entrez-fetch?
- bio-entrez-fetch installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

