scientific-skills/Evidence Insights/pdb-database/SKILL.md
Access the RCSB Protein Data Bank (PDB) to search, download, and programmatically retrieve 3D macromolecular structures and metadata; use when you need structure discovery (text/sequence/3D similarity) or automated structural data ingestion for structural biology and drug discovery workflows.
npx skillsauth add aipoch/medical-research-skills pdb-databaseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when you need to:
rcsb-api (latest recommended; provides rcsbapi.search and rcsbapi.data)requests>=2.0 (HTTP downloads)biopython>=1.80 (optional; parsing/analyzing PDB coordinates)Install (example):
uv pip install rcsb-api requests biopython
The following script is end-to-end runnable: it searches for a target, fetches metadata, downloads coordinates, and parses the structure.
#!/usr/bin/env python3
import pathlib
import requests
from rcsbapi.search import TextQuery, AttributeQuery
from rcsbapi.search.attrs import rcsb_entry_info
from rcsbapi.data import fetch, Schema
from Bio.PDB import PDBParser
def download_text(url: str, out_path: pathlib.Path) -> None:
r = requests.get(url, timeout=60)
r.raise_for_status()
out_path.write_text(r.text, encoding="utf-8")
def main():
out_dir = pathlib.Path("pdb_out")
out_dir.mkdir(exist_ok=True)
# 1) Search: hemoglobin entries with resolution < 2.0 Å
q_text = TextQuery("hemoglobin")
q_res = AttributeQuery(
attribute=rcsb_entry_info.resolution_combined,
operator="less",
value=2.0,
)
query = q_text & q_res
pdb_ids = list(query())[:5]
if not pdb_ids:
raise SystemExit("No results found.")
pdb_id = pdb_ids[0]
print(f"Selected PDB ID: {pdb_id}")
# 2) Fetch entry metadata
entry = fetch(pdb_id, schema=Schema.ENTRY)
title = entry.get("struct", {}).get("title")
method = (entry.get("exptl") or [{}])[0].get("method")
resolution = (entry.get("rcsb_entry_info") or {}).get("resolution_combined")
deposit_date = (entry.get("rcsb_accession_info") or {}).get("deposit_date")
print("Metadata:")
print(f" Title: {title}")
print(f" Method: {method}")
print(f" Resolution: {resolution}")
print(f" Deposit date: {deposit_date}")
# 3) Download coordinates (PDB and mmCIF)
pdb_path = out_dir / f"{pdb_id}.pdb"
cif_path = out_dir / f"{pdb_id}.cif"
download_text(f"https://files.rcsb.org/download/{pdb_id}.pdb", pdb_path)
download_text(f"https://files.rcsb.org/download/{pdb_id}.cif", cif_path)
print(f"Downloaded: {pdb_path} and {cif_path}")
# 4) Parse PDB coordinates (example: count atoms)
parser = PDBParser(QUIET=True)
structure = parser.get_structure(pdb_id, str(pdb_path))
atom_count = sum(1 for _ in structure.get_atoms())
chain_ids = sorted({chain.id for chain in structure.get_chains()})
print("Parsed structure:")
print(f" Chains: {chain_ids}")
print(f" Atom count: {atom_count}")
if __name__ == "__main__":
main()
evalue_cutoff: lower is more stringent (fewer, more confident hits).identity_cutoff: fraction identity threshold (e.g., 0.9 for near-identical).entry_id) as the geometric reference.query1 & query2 (AND)query1 | query2 (OR)~query (NOT), where supported by the clientSchema.ENTRY, Schema.POLYMER_ENTITY) is convenient for common objects and stable access patterns.Example GraphQL pattern:
from rcsbapi.data import fetch
query = """
{
entry(entry_id: "4HHB") {
struct { title }
exptl { method }
rcsb_entry_info { resolution_combined deposited_atom_count }
}
}
"""
data = fetch(query_type="graphql", query=query)
Direct download endpoints:
https://files.rcsb.org/download/{PDB_ID}.pdbhttps://files.rcsb.org/download/{PDB_ID}.cifFor batch metadata retrieval, iterate over IDs and call fetch(pdb_id, schema=Schema.ENTRY); handle exceptions per-ID to keep pipelines robust. For large batches, consider rate limiting and caching to avoid repeated downloads.
If present in this repository, consult:
references/api_reference.md for advanced endpoint usage, query patterns, schema notes, rate limits, and troubleshooting.tools
Generates complete conventional oncology bulk-transcriptome biomarker and hub-gene research designs from a user-provided cancer type and study direction. Always use this skill whenever a user wants to design, plan, or build a tumor bioinformatics study centered on differential expression, prognostic filtering or risk modeling, PPI-based hub-gene prioritization, diagnostic/prognostic evaluation, clinical association, immune infiltration context, methylation context, and optional tissue or cell validation. Covers five study patterns (signature-first prognostic workflow, hub-gene-first biomarker workflow, hybrid signature-to-hub workflow, immune-context biomarker workflow, translational validation workflow) and always outputs four workload configs (Lite / Standard / Advanced / Publication+) with recommended primary plan, step-by-step workflow, figure plan, validation strategy, minimal executable version, publication upgrade path...
development
Generates complete conventional non-oncology bioinformatics research designs from a user-provided disease context, process-related gene family or biological theme, and validation direction. Use when a study centers on multi-dataset bulk transcriptome integration, DEG analysis, process-gene intersection, enrichment analysis, GSEA, PPI hub-gene prioritization, TF/miRNA regulatory networks, ROC-based biomarker evaluation, and immune infiltration analysis. Covers five study patterns (process-DEG discovery, enrichment/GSEA interpretation, hub-gene prioritization, regulatory-network and immune interpretation, multi-layer public validation) and always outputs Lite / Standard / Advanced / Publication+ with a recommended primary plan, stepwise workflow, figure plan, validation hierarchy, minimal executable version, publication upgrade path, and strictly verified literature retrieval.
tools
Plans confounder control, variable adjustment logic, and bias mitigation strategies at the protocol stage for clinical, epidemiologic, translational, observational, and biomarker studies. Always use this skill when a user needs to identify major confounders, decide which variables should or should not be adjusted for, compare matching/stratification/weighting approaches, anticipate selection or measurement bias, or pressure-test a study design before execution. Focus on bias sensing, causal structure awareness, variable-role classification, and critical design review rather than generic statistical advice.
testing
Generates complete comparative network-toxicology research designs from a user-provided exposure pair, shared toxic phenotype, and validation direction. Use when a study centers on two related exposures under one outcome and needs target collection, shared-vs-specific target decomposition, enrichment, PPI hub prioritization, docking, optional transcriptomic cross-checks, and conservative mechanistic synthesis. Covers five study patterns and always outputs Lite / Standard / Advanced / Publication+ with a recommended primary plan, stepwise workflow, figure plan, validation hierarchy, minimal executable version, publication upgrade path, and strictly verified literature retrieval.