$npx -y skills add K-Dense-AI/scientific-agent-skills --skill bioservicesUnified Python interface to 40+ bioinformatics services. Use when querying multiple databases (UniProt, KEGG, ChEMBL, Reactome) in a single workflow with consistent API. Best for cross-database analysis, ID mapping across services. For quick single-database lookups use gget; for
| 1 | # BioServices |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | BioServices is a Python package providing programmatic access to approximately 40 bioinformatics web services and databases. Retrieve biological data, perform cross-database queries, map identifiers, analyze sequences, and integrate multiple biological resources in Python workflows. The package handles both REST and SOAP/WSDL protocols transparently. |
| 6 | |
| 7 | **Version note:** Examples target **bioservices 1.16.0** (PyPI, Mar 2026). Requires **Python 3.9–3.12**. UniProt REST changes in mid-2022 (bioservices ≥1.10) mainly affect tabular `columns` names — see upstream `_legacy_names` if parsing breaks. ChEMBL wrappers changed at 1.6.0 (2018 API); use `get_similarity`, `get_substructure`, `get_molecule` instead of pre-1.6 method names. |
| 8 | |
| 9 | ## When to Use This Skill |
| 10 | |
| 11 | This skill should be used when: |
| 12 | - Retrieving protein sequences, annotations, or structures from UniProt, PDB, Pfam |
| 13 | - Analyzing metabolic pathways and gene functions via KEGG or Reactome |
| 14 | - Searching compound databases (ChEBI, ChEMBL, PubChem) for chemical information |
| 15 | - Converting identifiers between different biological databases (KEGG↔UniProt, compound IDs) |
| 16 | - Running sequence similarity searches (BLAST, MUSCLE alignment) |
| 17 | - Querying gene ontology terms (QuickGO, GO annotations) |
| 18 | - Accessing protein-protein interaction data (PSICQUIC, IntactComplex) |
| 19 | - Mining genomic data (BioMart, ArrayExpress, ENA) |
| 20 | - Integrating data from multiple bioinformatics resources in a single workflow |
| 21 | |
| 22 | ## Core Capabilities |
| 23 | |
| 24 | ### 1. Protein Analysis |
| 25 | |
| 26 | Retrieve protein information, sequences, and functional annotations: |
| 27 | |
| 28 | ```python |
| 29 | from bioservices import UniProt |
| 30 | |
| 31 | u = UniProt(verbose=False) |
| 32 | |
| 33 | # Search for protein by name |
| 34 | results = u.search("ZAP70_HUMAN", frmt="tab", columns="id,genes,organism") |
| 35 | |
| 36 | # Retrieve FASTA sequence |
| 37 | sequence = u.retrieve("P43403", "fasta") |
| 38 | |
| 39 | # Map identifiers between databases |
| 40 | kegg_ids = u.mapping(fr="UniProtKB_AC-ID", to="KEGG", query="P43403") |
| 41 | ``` |
| 42 | |
| 43 | **Key methods:** |
| 44 | - `search()`: Query UniProt with flexible search terms |
| 45 | - `retrieve()`: Get protein entries in various formats (FASTA, XML, tab) |
| 46 | - `mapping()`: Convert identifiers between databases |
| 47 | |
| 48 | Reference: `references/services_reference.md` for complete UniProt API details. |
| 49 | |
| 50 | ### 2. Pathway Discovery and Analysis |
| 51 | |
| 52 | Access KEGG pathway information for genes and organisms: |
| 53 | |
| 54 | ```python |
| 55 | from bioservices import KEGG |
| 56 | |
| 57 | k = KEGG() |
| 58 | k.organism = "hsa" # Set to human |
| 59 | |
| 60 | # Search for organisms |
| 61 | k.lookfor_organism("droso") # Find Drosophila species |
| 62 | |
| 63 | # Find pathways by name |
| 64 | k.lookfor_pathway("B cell") # Returns matching pathway IDs |
| 65 | |
| 66 | # Get pathways containing specific genes |
| 67 | pathways = k.get_pathway_by_gene("7535", "hsa") # ZAP70 gene |
| 68 | |
| 69 | # Retrieve and parse pathway data |
| 70 | data = k.get("hsa04660") |
| 71 | parsed = k.parse(data) |
| 72 | |
| 73 | # Extract pathway interactions |
| 74 | interactions = k.parse_kgml_pathway("hsa04660") |
| 75 | relations = interactions['relations'] # Protein-protein interactions |
| 76 | |
| 77 | # Convert to Simple Interaction Format |
| 78 | sif_data = k.pathway2sif("hsa04660") |
| 79 | ``` |
| 80 | |
| 81 | **Key methods:** |
| 82 | - `lookfor_organism()`, `lookfor_pathway()`: Search by name |
| 83 | - `get_pathway_by_gene()`: Find pathways containing genes |
| 84 | - `parse_kgml_pathway()`: Extract structured pathway data |
| 85 | - `pathway2sif()`: Get protein interaction networks |
| 86 | |
| 87 | Reference: `references/workflow_patterns.md` for complete pathway analysis workflows. |
| 88 | |
| 89 | ### 3. Compound Database Searches |
| 90 | |
| 91 | Search and cross-reference compounds across multiple databases: |
| 92 | |
| 93 | ```python |
| 94 | from bioservices import KEGG, UniChem |
| 95 | |
| 96 | k = KEGG() |
| 97 | |
| 98 | # Search compounds by name |
| 99 | results = k.find("compound", "Geldanamycin") # Returns cpd:C11222 |
| 100 | |
| 101 | # Get compound information with database links |
| 102 | compound_info = k.get("cpd:C11222") # Includes ChEBI links |
| 103 | |
| 104 | # Cross-reference KEGG → ChEMBL using UniChem |
| 105 | u = UniChem() |
| 106 | chembl_id = u.get_compound_id_from_kegg("C11222") # Returns CHEMBL278315 |
| 107 | ``` |
| 108 | |
| 109 | **Common workflow:** |
| 110 | 1. Search compound by name in KEGG |
| 111 | 2. Extract KEGG compound ID |
| 112 | 3. Use UniChem for KEGG → ChEMBL mapping |
| 113 | 4. ChEBI IDs are often provided in KEGG entries |
| 114 | |
| 115 | Reference: `references/identifier_mapping.md` for complete cross-dat |