Skip to main content

Proteomics

Mass spectrometry analysis, protein interaction networks, and UniProt annotation using direct tool calls and file upload/download.

Upload MaxQuant output → filter DEPs → download annotated table

Upload a proteinGroups.txt file from MaxQuant, run differential protein abundance analysis, and download the filtered results.

from smartsbio import SmartsBio

client = SmartsBio(api_key="sk_live_...")
ws_id = client.workspaces.list()[0].id

# 1. Upload MaxQuant proteinGroups.txt
pg = client.files.upload("proteinGroups.txt", workspace_id=ws_id, path="ms/")
print(f"Uploaded: {pg['key']}")

# 2. Run differential protein abundance
dpa = client.tools.run(
    tool_id="maxquant_dep_analysis",
    input={
        "file_path": pg["key"],
        "workspace_id": ws_id,
        "min_peptides": 2,
        "qvalue_threshold": 0.01,
        "log2fc_threshold": 1.0,
        "output_path": "ms/results/",
    },
)
print(f"Significant proteins: {dpa['n_significant']}")
print(f"Up-regulated: {dpa['n_up']}  |  Down-regulated: {dpa['n_down']}")

# 3. Download annotated results
local = client.files.download(dpa["output_path"], workspace_id=ws_id, dest="./output/")
print(f"Annotated table saved to {local}")

STRING protein–protein interaction network

Call STRING directly for structured PPI data, then download the network as an edge list.

from smartsbio import SmartsBio

client = SmartsBio(api_key="sk_live_...")
ws_id = client.workspaces.list()[0].id

# Direct STRING tool call
ppi = client.tools.run(
    tool_id="string_db_search",
    input={
        "protein": "TP53",
        "species": 9606,          # Homo sapiens
        "limit": 20,
        "min_score": 700,         # high-confidence only
        "workspace_id": ws_id,
        "output_path": "ppi/",
    },
)

print(f"Found {len(ppi['interactions'])} interactions")
for edge in ppi["interactions"][:5]:
    print(f"  TP53 ↔ {edge['partner']}  score={edge['score']}  type={edge['type']}")

# Download network edge list (TSV)
net = client.files.download(ppi["output_path"], workspace_id=ws_id, dest="./ppi/")
print(f"Network saved to {net}")

UniProt protein annotation

Retrieve structured protein function, domains, PTMs, and disease associations from UniProt.

from smartsbio import SmartsBio

client = SmartsBio(api_key="sk_live_...")

result = client.tools.run(
    tool_id="uniprot_fetch",
    input={
        "accession": "P00533",   # Human EGFR
        "fields": ["function", "domains", "ptm", "disease", "drugs"],
    },
)

protein = result["protein"]
print(f"Name     : {protein['name']}")
print(f"Gene     : {protein['gene']}")
print(f"Domains  : {', '.join(d['name'] for d in protein['domains'])}")
print(f"Diseases : {', '.join(protein['diseases'])}")
print(f"\nDrugs targeting this protein:")
for drug in protein["drugs"][:3]:
    print(f"  {drug['name']} ({drug['approval_status']}) — {drug['mechanism']}")