# Bioservices

Provides a Python interface to bioinformatics services including UniProt, KEGG, ChEMBL...

- Repository: https://github.com/K-Dense-AI/scientific-agent-skills (55651 stars)
- Category: Data and ML
- License: GPLv3 license
- Last updated: 2026-10-26
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add K-Dense-AI/scientific-agent-skills --skill bioservices -g -a claude-code -y`
Codex: `npx skills add K-Dense-AI/scientific-agent-skills --skill bioservices -g -a codex -y`
Cursor: `npx skills add K-Dense-AI/scientific-agent-skills --skill bioservices -g -a cursor -y`
Gemini CLI: `npx skills add K-Dense-AI/scientific-agent-skills --skill bioservices -g -a gemini-cli -y`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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](references/services_reference.md) 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.

```bash
uv pip install "bioservices==1.16.0"
```

## Workflow

1. Resolve the requested organism and entity to stable accessions. Review search
   hits before selecting one; gene symbols and compound names may be ambiguous.
2. Inspect the service's actual response type, including pagination and errors.
   BioServices can return an integer-like HTTP error or `None`, not only raise.
3. Preserve one-to-many mappings, failed identifiers, taxonomy, database release,
   query parameters, and retrieval date alongside derived tables.
4. Distinguish annotations and inferred associations from experimental evidence.
   Pathway membership alone is not an enrichment analysis or causal finding.
5. Run a small lookup before batching; honor provider limits and retain failures
   separately from confirmed empty results.

## Protein search, sequence retrieval, and mapping

```python
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")

The rest: https://github.com/K-Dense-AI/scientific-agent-skills/blob/HEAD/skills/bioservices/SKILL.md
