Bioservices
Provides a Python interface to bioinformatics services including UniProt, KEGG, ChEMBL...
Install
npx skills add K-Dense-AI/scientific-agent-skills --skill bioservices -g -a claude-code -y- Repository
- K-Dense-AI/scientific-agent-skills55.7k
- Category
- Data and ML
- Updated
- 9d ago
- License
- GPLv3 license
- Context cost
- Mediumabout 2,784 tokens
- Runs scripts
- Yes, review before use
What it does
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.
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")
