{"data":{"slug":"github-aipoch-medical-research-skills-scientific-skills-data-analysis-bioservices-96785036b817","title":"Cross-Database Biological Data Retrieval and Analysis","summary":"Retrieve and combine biological data from multiple databases (e.g., UniProt, KEGG, GO) using a unified Python API for bioinformatics services. The deliverable includes structured data formats such as TSV, FASTA, and SIF for pathway analysis and network visualization.","url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-bioservices-96785036b817","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-bioservices-96785036b817","markdown_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-bioservices-96785036b817.md","download_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-data-analysis-bioservices-96785036b817\/download","category":{"slug":"data-research","name":"Data & Research"},"editor_note":"Install Python 3.9+ and the `bioservices` package via pip\/uv. Optional dependencies like `pandas`, `beautifulsoup4`, and `networkx` may be required for specific output formats and analysis tasks.","instructions":"---\nname: bioservices\ndescription: Unified Python access to 40+ bioinformatics web services; use when you need to query multiple databases (e.g., UniProt\/KEGG\/ChEMBL\/Reactome) with one consistent API in a single workflow, especially for cross-database analysis and identifier mapping.\nlicense: MIT\nauthor: AIPOCH\n---\n> **Source**: [https:\/\/github.com\/aipoch\/medical-research-skills](https:\/\/github.com\/aipoch\/medical-research-skills)\n\n## When to Use\n\n- You need to **retrieve and combine biological data from multiple databases** (e.g., UniProt + KEGG + GO) in one Python workflow.\n- You need **cross-database identifier mapping** (e.g., UniProt \u2194 KEGG, KEGG compound \u2194 ChEMBL) as part of downstream analysis.\n- You want to **programmatically explore pathways and networks** (e.g., KEGG pathway parsing, exporting interactions to SIF).\n- You need **service-agnostic access** across many providers (REST and SOAP\/WSDL) without writing custom clients per service.\n- You are building **integrated bioinformatics pipelines** (protein \u2192 sequence \u2192 BLAST \u2192 pathways \u2192 interactions) that span multiple resources.\n\n## Key Features\n\n- **Unified API** for ~40+ bioinformatics services (single Python package, consistent patterns).\n- **Transparent protocol handling** (REST and SOAP\/WSDL).\n- **Protein-centric workflows** via UniProt (search, retrieve, ID mapping).\n- **Pathway discovery and parsing** via KEGG (KGML parsing, relations extraction, SIF export).\n- **Compound lookup and cross-referencing** (e.g., KEGG compounds + UniChem mapping to ChEMBL).\n- **Sequence analysis integrations** (e.g., NCBI BLAST asynchronous jobs).\n- **Ontology and annotation queries** (e.g., QuickGO).\n- **Protein\u2013protein interaction queries** via PSICQUIC-compatible services.\n\n## Dependencies\n\n- `python >= 3.9`\n- `bioservices` (install via pip\/uv; version depends on your environment)\n\nOptional (commonly used alongside returned formats):\n- `pandas >= 1.5` (TSV\/tabular outputs)\n- `beautifulsoup4 >= 4.11` (XML parsing)\n- `lxml >= 4.9` (faster XML parsing)\n- `networkx >= 2.8` (network analysis of interactions)\n- `biopython >= 1.81` (sequence handling for FASTA outputs)\n\n## Example Usage\n\nA single runnable script that demonstrates a cross-service workflow:\n1) UniProt search + FASTA retrieval  \n2) UniProt \u2192 KEGG ID mapping  \n3) KEGG pathway lookup and KGML relation extraction  \n4) QuickGO annotation query  \n5) PSICQUIC interaction query  \n6) KEGG compound lookup + UniChem mapping to ChEMBL\n\n```python\n\"\"\"\nRun:\n  uv pip install bioservices pandas\n  python bioservices_example.py\n\nNotes:\n- Some services may rate-limit or be temporarily unavailable.\n- NCBI BLAST requires an email; this example does not run BLAST to stay lightweight.\n\"\"\"\n\nfrom bioservices import UniProt, KEGG, QuickGO, PSICQUIC, UniChem\n\n\ndef main():\n    # --- UniProt: search + retrieve ---\n    u = UniProt(verbose=False)\n\n    # Search by entry name (example: ZAP70 human)\n    tab = u.search(\"ZAP70_HUMAN\", frmt=\"tab\", columns=\"id,entry name,genes,organism\")\n    print(\"UniProt search (tab):\")\n    print(tab.splitlines()[0:3], \"\\n\")  # show header + first rows\n\n    uniprot_ac = \"P43403\"  # ZAP70_HUMAN accession\n    fasta = u.retrieve(uniprot_ac, \"fasta\")\n    print(\"UniProt FASTA header:\")\n    print(fasta.splitlines()[0], \"\\n\")\n\n    # --- UniProt: identifier mapping (UniProt -> KEGG) ---\n    mapping = u.mapping(fr=\"UniProtKB_AC-ID\", to=\"KEGG\", query=uniprot_ac)\n    print(\"UniProt -> KEGG mapping:\")\n    print(mapping, \"\\n\")\n\n    # --- KEGG: pathway discovery + parsing ---\n    k = KEGG(verbose=False)\n    k.organism = \"hsa\"\n\n    # Example gene: ZAP70 is KEGG gene hsa:7535\n    pathways = k.get_pathway_by_gene(\"7535\", \"hsa\")\n    print(\"KEGG pathways containing hsa:7535:\")\n    print(pathways, \"\\n\")\n\n    pathway_id = \"hsa04660\"  # T cell receptor signaling pathway (example)\n    kgml_relations = k.parse_kgml_pathway(pathway_id).get(\"relations\", [])\n    print(f\"KEGG KGML relations count for {pathway_id}: {len(kgml_relations)}\\n\")\n\n    # Export to SIF (useful for network tools)\n    sif = k.pathway2sif(pathway_id)\n    print(f\"KEGG SIF preview for {pathway_id}:\")\n    print(\"\\n\".join(sif.splitlines()[:5]), \"\\n\")\n\n    # --- QuickGO: GO annotations for a UniProt protein ---\n    g = QuickGO(verbose=False)\n    ann = g.Annotation(protein=uniprot_ac, format=\"tsv\")\n    print(\"QuickGO annotation TSV header:\")\n    print(ann.splitlines()[0], \"\\n\")\n\n    # --- PSICQUIC: interaction query (database name may vary by availability) ---\n    p = PSICQUIC(verbose=False)\n    # Example query: ZAP70 interactions in human\n    # Choose a database that is active in your environment; \"intact\" is commonly available.\n    interactions = p.query(\"intact\", \"ZAP70 AND species:9606\")\n    print(\"PSICQUIC query result preview:\")\n    print(\"\\n\".join(interactions.splitlines()[:3]), \"\\n\")\n\n    # --- Compound workflow: KEGG compound -> UniChem -> ChEMBL ---\n    # Example: Geldanamycin\n    cpd_hits = k.find(\"compound\", \"Geldanamycin\")\n    print(\"KEGG compound find('Geldanamycin'):\")\n    print(cpd_hits, \"\\n\")\n\n    # If you already know the KEGG compound ID:\n    kegg_compound_id = \"C11222\"\n    uc = UniChem(verbose=False)\n    chembl_id = uc.get_compound_id_from_kegg(kegg_compound_id)\n    print(f\"UniChem KEGG {kegg_compound_id} -> ChEMBL:\")\n    print(chembl_id, \"\\n\")\n\n\nif __name__ == \"__main__\":\n    main()\n```\n\n## Implementation Details\n\n- **Service objects**: Each remote resource is exposed as a Python class (e.g., `UniProt`, `KEGG`, `QuickGO`, `PSICQUIC`, `NCBIblast`). You instantiate a client and call methods that wrap the underlying endpoints.\n- **Protocols**: BioServices abstracts **REST** and **SOAP\/WSDL** services behind similar method calls; returned payloads may be text (TSV), XML, JSON-like dicts, or FASTA.\n- **Common parameters**\n  - `verbose`: toggles HTTP\/request logging (`verbose=False` is recommended for scripts).\n  - `TIMEOUT`: per-service timeout control (useful for slow networks or large responses).\n  - Service-specific parameters (examples):\n    - UniProt: `search(query, frmt=..., columns=...)`, `retrieve(accession, format)`, `mapping(fr=..., to=..., query=...)`\n    - KEGG: `find(db, query)`, `get(entry_id)`, `parse(raw)`, `parse_kgml_pathway(pathway_id)`, `pathway2sif(pathway_id)`\n    - NCBI BLAST: asynchronous job model (`run(...)` \u2192 `getStatus(jobid)` \u2192 `getResult(jobid, ...)`)\n- **Data handling guidance**\n  - TSV\/tabular outputs: load into `pandas.read_csv(io.StringIO(text), sep=\"\\t\")`\n  - XML outputs: parse with `BeautifulSoup` or `lxml`\n  - Network exports (SIF): import into NetworkX\/Cytoscape-compatible tooling\n- **Operational considerations**\n  - Many endpoints are **rate-limited**; implement retries\/backoff for production pipelines.\n  - Some services require **contact information** (e.g., NCBI BLAST email) and may enforce usage policies.\n  - Availability varies by provider; design workflows to degrade gracefully (try\/except, fallbacks).","use_cases":["Retrieving and combining data from UniProt, KEGG, and GO for pathway analysis","Mapping identifiers between UniProt and KEGG for cross-database analysis","Parsing KEGG pathways and exporting interactions to SIF format"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/aipoch\/medical-research-skills\/blob\/686e09dfdb45d9fa1a08664f06bb93769b3c9d91\/scientific-skills\/Data%20Analysis\/bioservices\/SKILL.md","source_commit":"686e09dfdb45d9fa1a08664f06bb93769b3c9d91","license":"MIT","version":null,"listing_approved_at":"2026-11-24","created_at":"2026-11-23T11:09:43.000000Z","updated_at":"2026-11-24T07:14:40.000000Z","seo_title":"Cross-Database Biological Data Retrieval","seo_description":"Efficiently retrieve and combine biological data from multiple databases using a unified Python API for bioinformatics services.","seo_keywords":["biological data retrieval","cross-database analysis","KEGG pathway parsing","UniProt identifier mapping","bioinformatics API"]}}