科研 Skill
BioServices 生信数据库助手
bioservices
统一访问生物信息数据库
官方收录发布者 aipoch-medical-research-skills安全审核通过v0.1.0更新于 2026-08-28
Skill 说明
统一不同生信网站和数据库的访问格式,隐藏 URL、输入参数和返回格式差异,并支持跨数据库 ID 互转与信息补全。 | 适用:检索阶段;适合 UniProt、KEGG、ChEMBL、Reactome 等多库查询和跨库映射。
SKILL.md
When to Use
- You need to retrieve and combine biological data from multiple databases (e.g., UniProt + KEGG + GO) in one Python workflow.
- You need cross-database identifier mapping (e.g., UniProt ↔ KEGG, KEGG compound ↔ ChEMBL) as part of downstream analysis.
- You want to programmatically explore pathways and networks (e.g., KEGG pathway parsing, exporting interactions to SIF).
- You need service-agnostic access across many providers (REST and SOAP/WSDL) without writing custom clients per service.
- You are building integrated bioinformatics pipelines (protein → sequence → BLAST → pathways → interactions) that span multiple resources.
Key Features
- Unified API for ~40+ bioinformatics services (single Python package, consistent patterns).
- Transparent protocol handling (REST and SOAP/WSDL).
- Protein-centric workflows via UniProt (search, retrieve, ID mapping).
- Pathway discovery and parsing via KEGG (KGML parsing, relations extraction, SIF export).
- Compound lookup and cross-referencing (e.g., KEGG compounds + UniChem mapping to ChEMBL).
- Sequence analysis integrations (e.g., NCBI BLAST asynchronous jobs).
- Ontology and annotation queries (e.g., QuickGO).
- Protein–protein interaction queries via PSICQUIC-compatible services.
Dependencies
python >= 3.9bioservices(install via pip/uv; version depends on your environment)
Optional (commonly used alongside returned formats):
pandas >= 1.5(TSV/tabular outputs)beautifulsoup4 >= 4.11(XML parsing)lxml >= 4.9(faster XML parsing)networkx >= 2.8(network analysis of interactions)biopython >= 1.81(sequence handling for FASTA outputs)
Example Usage
A single runnable script that demonstrates a cross-service workflow:
- UniProt search + FASTA retrieval
- UniProt → KEGG ID mapping
- KEGG pathway lookup and KGML relation extraction
- QuickGO annotation query
- PSICQUIC interaction query
- KEGG compound lookup + UniChem mapping to ChEMBL
"""
Run:
uv pip install bioservices pandas
python bioservices_example.py
Notes:
- Some services may rate-limit or be temporarily unavailable.
- NCBI BLAST requires an email; this example does not run BLAST to stay lightweight.
"""
from bioservices import UniProt, KEGG, QuickGO, PSICQUIC, UniChem
def main():
# --- UniProt: search + retrieve ---
u = UniProt(verbose=False)
# Search by entry name (example: ZAP70 human)
tab = u.search("ZAP70_HUMAN", frmt="tab", columns="id,entry name,genes,organism")
print("UniProt search (tab):")
print(tab.splitlines()[0:3], "\n") # show header + first rows
uniprot_ac = "P43403" # ZAP70_HUMAN accession
fasta = u.retrieve(uniprot_ac, "fasta")
print("UniProt FASTA header:")
print(fasta.splitlines()[0], "\n")
# --- UniProt: identifier mapping (UniProt -> KEGG) ---
mapping = u.mapping(fr="UniProtKB_AC-ID", to="KEGG", query=uniprot_ac)
print("UniProt -> KEGG mapping:")
print(mapping, "\n")
# --- KEGG: pathway discovery + parsing ---
k = KEGG(verbose=False)
k.organism = "hsa"
# Example gene: ZAP70 is KEGG gene hsa:7535
pathways = k.get_pathway_by_gene("7535", "hsa")
print("KEGG pathways containing hsa:7535:")
print(pathways, "\n")
pathway_id = "hsa04660" # T cell receptor signaling pathway (example)
kgml_relations = k.parse_kgml_pathway(pathway_id).get("relations", [])
print(f"KEGG KGML relations count for {pathway_id}: {len(kgml_relations)}\n")
# Export to SIF (useful for network tools)
sif = k.pathway2sif(pathway_id)
print(f"KEGG SIF preview for {pathway_id}:")
print("\n".join(sif.splitlines()[:5]), "\n")
# --- QuickGO: GO annotations for a UniProt protein ---
g = QuickGO(verbose=False)
ann = g.Annotation(protein=uniprot_ac, format="tsv")
print("QuickGO annotation TSV header:")
print(ann.splitlines()[0], "\n")
# --- PSICQUIC: interaction query (database name may vary by availability) ---
p = PSICQUIC(verbose=False)
# Example query: ZAP70 interactions in human
# Choose a database that is active in your environment; "intact" is commonly available.
interactions = p.query("intact", "ZAP70 AND species:9606")
print("PSICQUIC query result preview:")
print("\n".join(interactions.splitlines()[:3]), "\n")
# --- Compound workflow: KEGG compound -> UniChem -> ChEMBL ---
# Example: Geldanamycin
cpd_hits = k.find("compound", "Geldanamycin")
print("KEGG compound find('Geldanamycin'):")
print(cpd_hits, "\n")
# If you already know the KEGG compound ID:
kegg_compound_id = "C11222"
uc = UniChem(verbose=False)
chembl_id = uc.get_compound_id_from_kegg(kegg_compound_id)
print(f"UniChem KEGG {kegg_compound_id} -> ChEMBL:")
print(chembl_id, "\n")
if __name__ == "__main__":
main()
Implementation Details
- 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. - Protocols: BioServices abstracts REST and SOAP/WSDL services behind similar method calls; returned payloads may be text (TSV), XML, JSON-like dicts, or FASTA.
- Common parameters
verbose: toggles HTTP/request logging (verbose=Falseis recommended for scripts).TIMEOUT: per-service timeout control (useful for slow networks or large responses).- Service-specific parameters (examples):
- UniProt:
search(query, frmt=..., columns=...),retrieve(accession, format),mapping(fr=..., to=..., query=...) - KEGG:
find(db, query),get(entry_id),parse(raw),parse_kgml_pathway(pathway_id),pathway2sif(pathway_id) - NCBI BLAST: asynchronous job model (
run(...)→getStatus(jobid)→getResult(jobid, ...))
- UniProt:
- Data handling guidance
- TSV/tabular outputs: load into
pandas.read_csv(io.StringIO(text), sep="\t") - XML outputs: parse with
BeautifulSouporlxml - Network exports (SIF): import into NetworkX/Cytoscape-compatible tooling
- TSV/tabular outputs: load into
- Operational considerations
- Many endpoints are rate-limited; implement retries/backoff for production pipelines.
- Some services require contact information (e.g., NCBI BLAST email) and may enforce usage policies.
- Availability varies by provider; design workflows to degrade gracefully (try/except, fallbacks).
相关科研 Skill
中药材分子鉴定用ITS2等DNA条形码鉴定药材基原物种,处理多基原与降解样品局限。适用于药材真伪鉴别研究,不替代法定检验。
中药网络药理学用TCMSP等数据库构建成分-靶点-通路网络并做富集分析,批判性讨论方法学局限。适用于中药机制假设生成与论文方法复核。
中医术语标准与知识图谱建立中医药术语与WHO/ICD-11标准的映射,设计本体并用Neo4j构建知识图谱。适用于数据整合与科研检索,不作临床决策系统。
方剂配伍规律挖掘对方剂做药名规范化、关联规则与网络聚类分析,发现候选核心药组。适用于用药规律挖掘,结果仅为待验证假设,不作处方依据。
证候与症状数据分析对症状量表数据做术语规范、潜在类别与因子分析,探索统计学证候模式。适用于证候分型研究,结果不用于个体辨证诊断。
泵用混合物热力学计算Calculates thermodynamic properties and mixture phase behavior for pump applications using the thermo Python library’s DIPPR/NIST correlations. Use for VLE or mixture property calculations.
常见问题
BioServices 生信数据库助手能做什么?
统一不同生信网站和数据库的访问格式,隐藏 URL、输入参数和返回格式差异,并支持跨数据库 ID 互转与信息补全。 | 适用:检索阶段;适合 UniProt、KEGG、ChEMBL、Reactome 等多库查询和跨库映射。
如何安装BioServices 生信数据库助手?
在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「BioServices 生信数据库助手」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。
BioServices 生信数据库助手需要哪些权限?
该科研 Skill声明需要:本地文件。安装前会再次列出,由你确认后才会生效。
BioServices 生信数据库助手经过官方审核吗?
是。SpeedSkills 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。