# Query Stringdb

> Query STRING for protein-protein interactions. Use when user asks about protein interactions, interaction networks, binding partners, or interactome. Triggers on "string", "protein interaction", "interaction network", "binding partners", "interactome", "PPI".

- **Type:** Skill
- **Install:** `agentstack add skill-cheatthegod-biohermes-query-stringdb`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [cheatthegod](https://agentstack.voostack.com/s/cheatthegod)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [cheatthegod](https://github.com/cheatthegod)
- **Source:** https://github.com/cheatthegod/BioHermes/tree/main/optional-skills/bioinformatics/query-stringdb

## Install

```sh
agentstack add skill-cheatthegod-biohermes-query-stringdb
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# STRING Protein Interaction Database

Query the STRING API for protein-protein interaction networks.

## When to Use

- User asks about a protein's interaction partners
- User wants to build an interaction network
- User asks about functional associations between genes
- User wants interaction confidence scores

## How to Execute

```python
import requests
import json

BASE_URL = "https://version-12-0.string-db.org/api"

# 1. Get interaction partners
def get_interactions(genes, species=9606, score_threshold=400):
    url = f"{BASE_URL}/json/network"
    params = {
        "identifiers": "%0d".join(genes),
        "species": species,
        "required_score": score_threshold,
        "caller_identity": "bioclaw"
    }
    r = requests.get(url, params=params)
    r.raise_for_status()
    return r.json()

# 2. Get functional enrichment
def get_enrichment(genes, species=9606):
    url = f"{BASE_URL}/json/enrichment"
    params = {
        "identifiers": "%0d".join(genes),
        "species": species,
        "caller_identity": "bioclaw"
    }
    r = requests.get(url, params=params)
    r.raise_for_status()
    return r.json()

# 3. Get interaction partners (expand network)
def get_partners(gene, species=9606, limit=10):
    url = f"{BASE_URL}/json/interaction_partners"
    params = {
        "identifiers": gene,
        "species": species,
        "limit": limit,
        "caller_identity": "bioclaw"
    }
    r = requests.get(url, params=params)
    r.raise_for_status()
    return r.json()

# 4. Download network image
def download_network_image(genes, species=9606, output_path="/workspace/group/network.png"):
    url = f"{BASE_URL}/highres_image/network"
    params = {
        "identifiers": "%0d".join(genes),
        "species": species,
        "caller_identity": "bioclaw"
    }
    r = requests.get(url, params=params)
    with open(output_path, 'wb') as f:
        f.write(r.content)
    return output_path

# Example
interactions = get_interactions(["BRCA1", "BRCA2", "TP53"])
for i in interactions[:10]:
    print(f"{i['preferredName_A']}  {i['preferredName_B']}  score: {i['score']}")
    print(f"  Sources: experimental={i.get('escore',0)}, database={i.get('dscore',0)}, textmining={i.get('tscore',0)}")
```

## Score Thresholds

- 900+ = Highest confidence
- 700+ = High confidence
- 400+ = Medium confidence (default)
- 150+ = Low confidence

## Species IDs

Human=9606, Mouse=10090, Rat=10116, Fly=7227, Yeast=4932, E.coli=511145

## Follow-up Suggestions

- "Want me to do enrichment analysis on this network?"
- "Should I expand the network to include more partners?"
- "Want me to download the network image?"

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [cheatthegod](https://github.com/cheatthegod)
- **Source:** [cheatthegod/BioHermes](https://github.com/cheatthegod/BioHermes)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** yes
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-cheatthegod-biohermes-query-stringdb
- Seller: https://agentstack.voostack.com/s/cheatthegod
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
