$npx -y skills add ai4protein/VenusFactory2 --skill string_databaseQuery STRING API for protein-protein interactions (59M proteins, 20B interactions). Network analysis, GO/KEGG enrichment, interaction discovery, 5000+ species, for systems biology.
| 1 | # STRING Database |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | STRING is a comprehensive database of known and predicted protein-protein interactions covering 59M proteins and 20B+ interactions across 5000+ organisms. Query interaction networks, perform functional enrichment, discover partners via REST API for systems biology and pathway analysis. |
| 6 | |
| 7 | ## When to Use This Skill |
| 8 | |
| 9 | This skill should be used when: |
| 10 | - Retrieving protein-protein interaction networks for single or multiple proteins |
| 11 | - Performing functional enrichment analysis (GO, KEGG, Pfam) on protein lists |
| 12 | - Discovering interaction partners and expanding protein networks |
| 13 | - Testing if proteins form significantly enriched functional modules |
| 14 | - Generating network visualizations with evidence-based coloring |
| 15 | - Analyzing homology and protein family relationships |
| 16 | - Conducting cross-species protein interaction comparisons |
| 17 | - Identifying hub proteins and network connectivity patterns |
| 18 | |
| 19 | ## Quick Start |
| 20 | |
| 21 | The skill provides: |
| 22 | 1. **Project tools**: All operations (query and download) are consolidated in `src/tools/database/string/string_operations.py`. They return rich JSON containing `status`, `content` (or `file_info` for downloads), and `execution_context`. |
| 23 | 2. **Reference**: `references/string_reference.md` for API specs, parameters, and output formats. |
| 24 | |
| 25 | When users request STRING data, choose the operation and call the corresponding function from `src.tools.database.string`. |
| 26 | |
| 27 | ## Project Tools (VenusFactory2) |
| 28 | |
| 29 | | Operation | Query Function (Returns content JSON) | Download Function (Returns file_info JSON) | Purpose | |
| 30 | |-----------|----------------------------------------|---------------------------------------------|---------| |
| 31 | | Identifier mapping | `query_string_map_ids` | `download_string_map_ids` | Map names/IDs to STRING IDs (TSV) | |
| 32 | | Network data | `query_string_network` | `download_string_network` | PPI network table (TSV) | |
| 33 | | Network image | `query_string_network_image` | `download_string_network_image` | Network as PNG (bytes/base64) | |
| 34 | | Interaction partners | `query_string_interaction_partners`| `download_string_interaction_partners` | Partners for protein(s) (TSV) | |
| 35 | | Functional enrichment | `query_string_enrichment` | `download_string_enrichment` | GO/KEGG/Pfam enrichment (TSV) | |
| 36 | | PPI enrichment | `query_string_ppi_enrichment` | `download_string_ppi_enrichment` | Test network enrichment (JSON) | |
| 37 | | Homology | `query_string_homology` | `download_string_homology` | Homology scores (TSV) | |
| 38 | | Version | `query_string_version` | `download_string_version` | Database version (TSV) | |
| 39 | |
| 40 | **Import (preferred)**: |
| 41 | ```python |
| 42 | from src.tools.database.string import ( |
| 43 | query_string_map_ids, download_string_map_ids, |
| 44 | query_string_network, download_string_network, |
| 45 | query_string_network_image, download_string_network_image, |
| 46 | query_string_interaction_partners, download_string_interaction_partners, |
| 47 | query_string_enrichment, download_string_enrichment, |
| 48 | query_string_ppi_enrichment, download_string_ppi_enrichment, |
| 49 | query_string_homology, download_string_homology, |
| 50 | query_string_version, download_string_version |
| 51 | ) |
| 52 | ``` |
| 53 | |
| 54 | ## Core Operations |
| 55 | |
| 56 | ### 1. Identifier Mapping (`query_string_map_ids`, `download_string_map_ids`) |
| 57 | |
| 58 | Convert gene names, protein names, and external IDs to STRING identifiers. |
| 59 | |
| 60 | **When to use**: Starting any STRING analysis, validating protein names, finding canonical identifiers. |
| 61 | |
| 62 | **Usage**: |
| 63 | ```python |
| 64 | from src.tools.database.string import query_string_map_ids |
| 65 | |
| 66 | # Map single protein |
| 67 | result_json = query_string_map_ids('TP53', species=9606) |
| 68 | |
| 69 | # Map multiple proteins |
| 70 | result_json = query_string_map_ids(['TP53', 'BRCA1', 'EGFR', 'MDM2'], species=9606) |
| 71 | |
| 72 | # Map with multiple matches per query |
| 73 | result_json = query_string_map_ids('p53', species=9606, limit=5) |
| 74 | ``` |
| 75 | |
| 76 | **Parameters**: |
| 77 | - `species`: NCBI taxon ID (9606 = human, 10090 = mouse, 7227 = fly) |
| 78 | - `limit`: Number of matches per identifier (default: 1) |
| 79 | - `echo_query`: Include query term in output (default: 1) |
| 80 | |
| 81 | **Best practice**: Always map identifiers first for faster subsequent queries. |
| 82 | |
| 83 | ### 2. Network Retrieval (`query_string_network`, `download_string_network`) |
| 84 | |
| 85 | Get protein-protein interaction network data in tabular format. |
| 86 | |
| 87 | **When to use**: Building interaction networks, analyzing connectivity, retrieving interaction evidence. |
| 88 | |
| 89 | **Usage**: |
| 90 | ```python |
| 91 | from src.tools.database.string import query_string_network |
| 92 | |
| 93 | # Get network for single protein |
| 94 | network_json = query_string_network('9606.ENSP00000269305', species=9606) |
| 95 | |
| 96 | # Get network with multiple proteins |
| 97 | proteins = ['9606.ENSP00000269305', '9606.ENSP00000275493'] |
| 98 | network_json = query_string_network(proteins, required_score=700) |
| 99 | |
| 100 | # Expand network with additional interactors |
| 101 | network_json = query_string_network('TP5 |