Access the STRING database to map identifiers, retrieve protein–protein interaction networks, and run functional/PPI enrichment when you need interaction context for a gene/protein set.
Start a fresh conversation. Replace the highlighted placeholders.
Use string-database to map [gene/protein list] for species [taxonomy ID], retrieve an interaction network, and report functional and PPI enrichment with confidence-aware interpretation.
Required inputs
[gene/protein list]
[taxonomy ID]
User-approved starter prompt based on a pinned source version; check current skill requirements before running. Task evidence ↗
SKILL.md
name: string-databasedescription: Access the STRING database to map identifiers, retrieve protein–protein interaction networks, and run functional/PPI enrichment when you need interaction context for a gene/protein set.license: MITauthor: AIPOCH
from scripts.string_api import StringClient
def main():
# STRING does not require a secret API key, but providing a caller identity is recommended.
client = StringClient(caller_identity="my_analysis_tool")
# 1) Map an identifier (e.g., TP53 in Homo sapiens; NCBI taxonomy ID 9606)
protein_id = client.map_id(identifier="TP53", species=9606)
print("Mapped ID:", protein_id)
# 2) Download a network image and expand by adding interaction partners
client.get_network_image(
identifiers=[protein_id],
output_file="tp53_network.png",
add_color_nodes=10, # add 10 partners
)
print("Saved network image to tp53_network.png")
# 3) Run PPI enrichment for the set
ppi_stats = client.get_ppi_enrichment(identifiers=[protein_id])
print("PPI enrichment:", ppi_stats)
if __name__ == "__main__":
main()
Implementation Details
Client entry point: scripts/string_api.py provides the main wrapper (e.g., StringClient) around the STRING REST API.
Caller identity:
STRING endpoints do not require an API key.
A caller_identity string is strongly recommended (project name/email/URL) to support rate/load management.
Pass it at initialization (e.g., StringClient(caller_identity="my_email@example.com")) or inject via environment variables in your own wrapper.
Organism selection:
Most operations require a species identifier (commonly NCBI taxonomy ID, e.g., 9606 for human).
Network retrieval and scoring:
Network endpoints return interactions with confidence scores; downstream filtering is typically done by applying a score threshold in your analysis code (if exposed by the wrapper).
Visualization:
Static images are retrieved directly from STRING image endpoints and written to disk (PNG/SVG depending on the method/parameters).
Reference documentation:
See references/string_reference.md for original API notes and endpoint details included with this skill.