$npx -y skills add ai4protein/VenusFactory2 --skill uniprot_databaseUniProt — protein sequence, function, taxonomy, cross-references. Search proteins by query, retrieve a UniProt entry, map IDs between databases (PDB↔UniProt etc.), pull FASTA sequence, fetch metadata, run SPARQL against sparql.uniprot.org. Use whenever the user mentions a UniProt
| 1 | # UniProt Database |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | UniProt KnowledgeBase (UniProtKB) is the central protein-knowledge resource. This skill exposes 6 tools spanning text search, single-entry retrieval, ID mapping, sequence/metadata download, and SPARQL queries. |
| 6 | |
| 7 | ## Project Tools (VenusFactory2) |
| 8 | |
| 9 | | Tool | Args | Returns | Description | |
| 10 | |------|------|---------|--------------| |
| 11 | | **download_uniprot_search_by_query** | `query` (UniProt query syntax, e.g. `organism_id:9606 AND reviewed:true`), `out_path`, optional `format` | rich JSON envelope | Search UniProtKB; results saved to file. | |
| 12 | | **download_uniprot_retrieve_by_id** | `uniprot_id` (e.g. `P04637`), `out_path`, optional `frmt` (`fasta` default) | rich JSON envelope | Retrieve one entry in the chosen format. | |
| 13 | | **download_uniprot_mapping** | `fr` (from db, e.g. `PDB`), `to` (to db, e.g. `UniProtKB_AC-ID`), `query` (comma-separated IDs), `out_path` | rich JSON envelope | Cross-database ID mapping (PDB↔UniProt, gene name↔accession, etc.). | |
| 14 | | **download_uniprot_seq_by_id** | `uniprot_id`, `out_path` | rich JSON envelope; FASTA file | Sequence FASTA only. | |
| 15 | | **download_uniprot_meta_by_id** | `uniprot_id`, `out_path` | rich JSON envelope; JSON file | Full metadata (function, taxonomy, GO, xrefs, etc.). | |
| 16 | | **download_uniprot_sparql_by_query** | `query` (SPARQL string), `out_dir` (required), `timeout` (default `120`s) | rich JSON envelope; SPARQL JSON file at `file_info.file_path`; `biological_metadata.row_count` + `head_vars` | Run an arbitrary SPARQL query against https://sparql.uniprot.org/sparql. | |
| 17 | |
| 18 | ## When to Use Which Tool |
| 19 | |
| 20 | | Goal | Tool | |
| 21 | |---|---| |
| 22 | | You have a UniProt accession, want sequence | `download_uniprot_seq_by_id` | |
| 23 | | You have a UniProt accession, want everything else | `download_uniprot_meta_by_id` | |
| 24 | | You have a gene name / PDB ID, want UniProt | `download_uniprot_mapping` | |
| 25 | | You have a free-text query, want a list | `download_uniprot_search_by_query` | |
| 26 | | You need a complex cross-resource graph query (e.g. all enzymes in pathway X catalyzing reaction Y) | `download_uniprot_sparql_by_query` | |
| 27 | |
| 28 | ## SPARQL Quick Examples |
| 29 | |
| 30 | **Top 5 proteins by name:** |
| 31 | ```sparql |
| 32 | PREFIX up: <http://purl.uniprot.org/core/> |
| 33 | SELECT ?p ?name WHERE { |
| 34 | ?p a up:Protein . |
| 35 | ?p up:recommendedName / up:fullName ?name . |
| 36 | } LIMIT 5 |
| 37 | ``` |
| 38 | |
| 39 | **Proteins in human, with a specific GO term:** |
| 40 | ```sparql |
| 41 | PREFIX up: <http://purl.uniprot.org/core/> |
| 42 | PREFIX taxon: <http://purl.uniprot.org/taxonomy/> |
| 43 | SELECT ?protein ?name |
| 44 | WHERE { |
| 45 | ?protein a up:Protein . |
| 46 | ?protein up:organism taxon:9606 . |
| 47 | ?protein up:classifiedWith <http://purl.obolibrary.org/obo/GO_0003700> . |
| 48 | ?protein up:recommendedName / up:fullName ?name . |
| 49 | } LIMIT 20 |
| 50 | ``` |
| 51 | |
| 52 | ## Common Mistakes |
| 53 | |
| 54 | - **Passing an unreviewed entry's accession when you need curated info**: filter with `reviewed:true` in your search. |
| 55 | - **Mapping in the wrong direction**: `fr=PDB to=UniProtKB_AC-ID` for "PDB → UniProt"; flip for the reverse. |
| 56 | - **SPARQL timeout on broad queries**: add `LIMIT N`; default endpoint timeout is harsh. Bump `timeout` parameter if your query is legitimately heavy. |
| 57 | |
| 58 | ## References |
| 59 | |
| 60 | - [UniProt REST API](https://www.uniprot.org/help/api_queries) |
| 61 | - [UniProt query syntax](https://www.uniprot.org/help/query-fields) |
| 62 | - [UniProt SPARQL endpoint](https://sparql.uniprot.org/) — interactive query editor with examples |
| 63 | - [ID mapping db list](https://www.uniprot.org/help/id_mapping) |