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}")import { SmartsBio } from '@smartsbio/sdk';
const client = new SmartsBio({ apiKey: 'sk_live_...' });
const [workspace] = await client.workspaces.list();
// 1. Upload MaxQuant proteinGroups.txt
const pg = await client.files.upload('./proteinGroups.txt', {
workspaceId: workspace.id,
path: 'ms/',
});
console.log('Uploaded:', pg.key);
// 2. Differential protein abundance
const dpa = await client.tools.run('maxquant_dep_analysis', {
input: {
filePath: pg.key,
workspaceId: workspace.id,
minPeptides: 2,
qvalueThreshold: 0.01,
log2fcThreshold: 1.0,
outputPath: 'ms/results/',
},
});
console.log('Significant proteins:', dpa.nSignificant);
console.log(`Up: ${dpa.nUp} | Down: ${dpa.nDown}`);
// 3. Download results
const localPath = await client.files.download(dpa.outputPath, workspace.id, './output/');
console.log('Annotated table saved to', localPath);# 1. Upload proteinGroups.txt
FILE_PATH=$(curl -s -X POST https://api.smarts.bio/v1/files/upload \
-H "Authorization: Bearer sk_live_..." \
-F "file=@proteinGroups.txt" -F "workspace_id=ws_abc123" -F "path=ms/" \
| jq -r '.data.path')
# 2. Run differential protein abundance analysis
curl -s -X POST https://api.smarts.bio/v1/tools/maxquant_dep_analysis/run \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"input": {"file_path": "'"$FILE_PATH"'", "workspace_id": "ws_abc123", "min_peptides": 2, "qvalue_threshold": 0.01, "log2fc_threshold": 1.0, "output_path": "ms/results/"}}' \
| jq '{n_significant, n_up, n_down, output_path}'# 1. Upload MaxQuant proteinGroups.txt smarts file upload proteinGroups.txt --to ms/ # 2. Run differential protein abundance analysis smarts tool run maxquant_dep_analysis \ --param file_path=ms/proteinGroups.txt \ --param min_peptides=2 \ --param qvalue_threshold=0.01 \ --param log2fc_threshold=1.0 \ --param output_path=ms/results/ # 3. Download the annotated results smarts file download ms/results/ -o ./output/
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}")import { SmartsBio } from '@smartsbio/sdk';
const client = new SmartsBio({ apiKey: 'sk_live_...' });
const [workspace] = await client.workspaces.list();
// Direct STRING tool call
const ppi = await client.tools.run('string_db_search', {
input: {
protein: 'TP53',
species: 9606,
limit: 20,
minScore: 700,
workspaceId: workspace.id,
outputPath: 'ppi/',
},
});
console.log(`Found ${ppi.interactions.length} interactions`);
ppi.interactions.slice(0, 5).forEach((e: { partner: string; score: number; type: string }) => {
console.log(` TP53 ↔ ${e.partner} score=${e.score} type=${e.type}`);
});
// Download edge list
const net = await client.files.download(ppi.outputPath, workspace.id, './ppi/');
console.log('Network saved to', net);curl -X POST https://api.smarts.bio/v1/tools/string_db_search/run \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"input": {
"protein": "TP53",
"species": 9606,
"limit": 20,
"min_score": 700
}
}'# Direct STRING tool call (high-confidence interactions only) smarts tool run string_db_search \ --param protein=TP53 \ --param species=9606 \ --param limit=20 \ --param min_score=700 \ --param output_path=ppi/ # Download the network edge list (TSV) smarts file download ppi/ -o ./ppi/
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']}")import { SmartsBio } from '@smartsbio/sdk';
const client = new SmartsBio({ apiKey: 'sk_live_...' });
const result = await client.tools.run('uniprot_fetch', {
input: {
accession: 'P00533', // Human EGFR
fields: ['function', 'domains', 'ptm', 'disease', 'drugs'],
},
});
const { protein } = result;
console.log('Name :', protein.name);
console.log('Gene :', protein.gene);
console.log('Domains :', protein.domains.map((d: { name: string }) => d.name).join(', '));
console.log('Diseases:', protein.diseases.join(', '));
console.log('\nDrugs targeting this protein:');
protein.drugs.slice(0, 3).forEach((drug: { name: string; approval_status: string; mechanism: string }) => {
console.log(` ${drug.name} (${drug.approval_status}) — ${drug.mechanism}`);
});curl -X POST https://api.smarts.bio/v1/tools/uniprot_fetch/run \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"input": {
"accession": "P00533",
"fields": ["function", "domains", "ptm", "disease", "drugs"]
}
}' | jq '.protein | {name, gene, domains: [.domains[].name], diseases, drugs: .drugs[:3]}'# Structured UniProt annotation for Human EGFR smarts tool run uniprot_fetch \ --param accession=P00533 \ --param fields=function,domains,ptm,disease,drugs