bioservices
Helps your agent fetch information from biological databases like UniProt and KEGG. It's useful for connecting data from different sources and better understanding proteins and biological pathways.
What it does
BioServices is a tool that helps connect different biology databases, like UniProt and KEGG. It allows researchers to search for information about proteins, genes, and compounds, and how they relate in biological networks.
When to use it
- ✓When you need to find information about a specific protein across multiple databases.
- ✓When you want to discover which biological pathways a given gene is involved in.
- ✓When you need to convert one chemical compound identifier to another (e.g., from ChEBI to ChEMBL).
Example of what to ask your AI
“Find information about the ZAP70 protein in humans and show me its accession code and gene name.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The tool sends your query to online biology services and gathers the answers. It knows how to talk to different databases and translates the results for you.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add K-Dense-AI/scientific-agent-skills --skill bioservicesOr download just the file:
curl -L https://raw.githubusercontent.com/K-Dense-AI/scientific-agent-skills/main/skills/bioservices/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
BioServices
When to use
Use BioServices when combining protein annotation, gene/pathway membership, compound cross-references, or genomic resources in Python. Its service clients share transport helpers, but their request parameters and return types differ. Use the service reference before composing clients; method names from PubChemPy, mygene, or older BioServices are not portable.
Targets bioservices 1.16.0, the current PyPI release at review. Package metadata allows Python >=3.9,<4; the bundled tests were run in an isolated Python 3.13 environment. The previous 3.12 upper bound was not a package requirement.
uv pip install "bioservices==1.16.0"
Workflow
- Resolve the requested organism and entity to stable accessions. Review search hits before selecting one; gene symbols and compound names may be ambiguous.
- Inspect the service's actual response type, including pagination and errors.
BioServices can return an integer-like HTTP error or
None, not only raise. - Preserve one-to-many mappings, failed identifiers, taxonomy, database release, query parameters, and retrieval date alongside derived tables.
- Distinguish annotations and inferred associations from experimental evidence. Pathway membership alone is not an enrichment analysis or causal finding.
- Run a small lookup before batching; honor provider limits and retain failures separately from confirmed empty results.
Protein search, sequence retrieval, and mapping
from bioservices import UniProt
u = UniProt(verbose=False)
u.services.TIMEOUT = 30
rows = u.search(
"gene_exact:ZAP70 AND organism_id:9606 AND reviewed:true",
frmt="tsv", columns="accession,gene_names,organism_name,length",
limit=5, size=5,
)
if not isinstance(rows, str):
raise RuntimeError("UniProt search failed")
print(rows)
fasta = u.retrieve("P43403", frmt="fasta")
record = u.retrieve("P43403", frmt="json")
mapping = u.mapping(fr="UniProtKB_AC-ID", to="KEGG", query="P43403")
if not isinstance(mapping, dict) or "results" not in mapping:
raise RuntimeError("Mapping incomplete or failed")
kegg_ids = [row["to"] for row in mapping["results"] if row["from"] == "P43403"]
print(kegg_ids, mapping.get("failedIds", []))
Use frmt="tsv", not "tab"; current field names include accession,
gene_names, organism_name, protein_name, go_id, and xref_pdb.
mapping() returns a results/failedIds envelope, not a source-to-list
dictionary. Mapping to UniProt uses to="UniProtKB" and returns full records
in row["to"]; extract primaryAccession. UniProtKB_AC-ID is a source code.
See identifier mapping for allowed pairs,
normalization, and limits. For bounded searches set size=limit (at most 500);
1.16.0 mixes the two values in its pagination loop.
KEGG pathways and networks
from bioservices import KEGG
k = KEGG(verbose=False)
k.services.url = "https://rest.kegg.jp"
pathway_names = k.get_pathway_by_gene("7535", "hsa") # dict: pathway ID -> name
print(pathway_names)
kgml = k.parse_kgml_pathway("hsa04660")
entries = {entry["id"]: entry for entry in kgml["entries"]}
for relation in kgml["relations"][:5]:
print(entries[relation["entry1"]]["name"], relation["name"],
entries[relation["entry2"]]["name"])
The reviewed /list/organism endpoint returned HTTP 400 despite remaining in
the manual. SDK methods that validate against that catalogue can fail. The
bundled compound and pathway-list scripts use the documented scoped endpoints
through k.services.http_get to avoid that unrelated catalogue dependency.
KEGG get permits at most ten entries; KGML permits one pathway per request.
Keep requests at or below three per second. list/find return TSV strings;
get returns a flat-file string unless an option changes the representation.
KGML entries include genes, compounds, groups, and maps. A relation can produce
several subtype records; those counts are neither unique genes nor independent
physical interactions. Entry IDs are local to each pathway. The bundled SIF
export namespaces them as pathway#entry so combining pathways cannot merge
unrelated nodes. pathway2sif(..., uniprot=False) is an optional lossy projection
of gene-to-gene activation/inhibition, not a complete pathway network.
Compound cross-references
from bioservices import UniChem
uc = UniChem(verbose=False)
…
FAQ
What are UniProt, KEGG, ChEMBL, Reactome, and QuickGO?
These are large databases that store information about proteins, genes, chemical compounds, and biological processes.
What does "protein annotation" mean?
It's the process of adding descriptive information to a protein, such as its function, location, and interactions.
What are biological "pathways"?
These are sequences of molecular interactions that occur within a cell, leading to a specific product or cellular change.
Details
Original description by the author
Provides a Python interface to bioinformatics services including UniProt, KEGG, ChEMBL, Reactome, QuickGO, and UniChem. Used for cross-database protein annotation, pathway retrieval, chemical identifier mapping, and integrated biological data workflows with BioServices.
Popularity
- GitHub stars
- 51k
- Ranking position
- #1841
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
13c-metabolic-flux
Estimates metabolic fluxes using carbon-13 isotope tracing data. It is useful for analyzing cellular metabolism and biochemical pathways.
K-Dense-AI/scientific-agent-skills
adaptyv
Designs protein characterization experiments using the Adaptyv API. It helps estimate costs, submit sequences, and monitor lab results.
K-Dense-AI/scientific-agent-skills
aeon
Performs machine learning tasks on time series data. It is useful for classifying, forecasting, detecting anomalies, and finding patterns in sequential data.
K-Dense-AI/scientific-agent-skills
alphagenome
Looks up precomputed genomic effects for genetic variants. It provides scores and explanations to understand the impact of variants on the genome.
K-Dense-AI/scientific-agent-skills
Similar skills
dashboard-builder
Helps your agent create useful monitoring dashboards. It turns data into charts that answer important system questions.
affaan-m/ECC
dev-team
Simulates a collaborative development team where different roles respond to a problem together. It's useful for getting multiple perspectives without manually switching agents.
affaan-m/ECC
ecc-council
Has your agent convene a four-voice council for difficult decisions. It's useful when there are multiple good options and debate is needed before choosing.
affaan-m/ECC