Skip to main contentuniprot-protein-retrieval
Retrieve protein sequences and functional information from UniProt database by protein name, enabling protein analysis and bioinformatics workflows.
跳到安装 用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/SpectrAI-Initiative/InnoClaw --skill uniprot-protein-retrieval命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
| name | uniprot-protein-retrieval |
| description | Retrieve protein sequences and functional information from UniProt database by protein name, enabling protein analysis and bioinformatics workflows. |
| license | MIT license |
| metadata | {"skill-author":"PJLab"} |
UniProt Protein Sequence Retrieval
Usage
1. MCP Server Definition
Use the standard MCP client pattern for Origene-UniProt server.
2. Protein Sequence Retrieval Workflow
This workflow retrieves protein sequences and associated information from the UniProt database using protein names or identifiers.
Workflow Steps:
- Query by Protein Name - Search UniProt using common protein names
- Retrieve Sequence Data - Get amino acid sequence and metadata
Implementation:
from mcp.client.streamable_http import streamablehttp_client
from mcp import ClientSession
import json
from contextlib import AsyncExitStack
class OrigeneClient:
def ():
.server_url = server_url
.session =
():
:
.transport = streamablehttp_client(
url=.server_url,
headers={: }
)
._stack = AsyncExitStack()
._stack.__aenter__()
.read, .write, .get_session_id = ._stack.enter_async_context(.transport)
.session_ctx = ClientSession(.read, .write)
.session = ._stack.enter_async_context(.session_ctx)
.session.initialize()
()
Exception e:
()
():
:
(, ):
._stack.aclose()
()
Exception e:
()
():
:
(result, ) result.content:
content = result.content[]
(content, ):
json.loads(content.text)
(result)
Exception e:
{: , : (result)}
client = OrigeneClient()
client.connect():
()
protein_name =
result = client.session.call_tool(
,
arguments={
: protein_name
}
)
result_data = client.parse_result(result)
()
( * )
result_data:
sequence = result_data[]
()
(sequence)
()
i (, (sequence), ):
position = i +
block = sequence[i:i+]
()
result_data:
()
result_data:
()
result_data:
()
result_data:
()
client.disconnect()
__init__
self, server_url: str
self
self
None
async
def
connect
self
try
self
self
"SCP-HUB-API-KEY"
"<your-api-key>"
self
await
self
self
self
self
await
self
self
self
self
self
self
await
self
self
await
self
print
"✓ Connected to Origene-UniProt"
return
True
except
as
print
f"✗ Connection failed: {e}"
return
False
async
def
disconnect
self
"""Disconnect from server"""
try
if
hasattr
self
'_stack'
await
self
print
"✓ already disconnect"
except
as
print
f"✗ disconnect error: {e}"
def
parse_result
self, result
try
if
hasattr
'content'
and
0
if
hasattr
'text'
return
return
str
except
as
return
"error"
f"Parse error: {e}"
"raw"
str
"https://scp.intern-ai.org.cn/api/v1/mcp/10/Origene-UniProt"
if
not
await
print
"Connection failed"
return
"insulin"
await
"get_protein_sequence_by_name"
"protein_name"
print
f"\nProtein: {protein_name}"
print
"="
80
if
"sequence"
in
"sequence"
print
f"Amino Acid Sequence ({len(sequence)} residues):"
print
print
"\nFormatted Sequence:"
for
in
range
0
len
60
1
60
print
f"{position:6d} {block}"
if
"uniprot_id"
in
print
f"\nUniProt ID: {result_data['uniprot_id']}"
if
"protein_names"
in
print
f"Protein Names: {result_data['protein_names']}"
if
"organism"
in
print
f"Organism: {result_data['organism']}"
if
"function"
in
print
f"Function: {result_data['function'][:200]}..."
await
Extended Example: Multiple Protein Retrieval
protein_list = ["p53", "BRCA1", "insulin", "hemoglobin"]
sequences = {}
for protein in protein_list:
result = await client.session.call_tool(
"get_protein_sequence_by_name",
arguments={"protein_name": protein}
)
data = client.parse_result(result)
if "sequence" in data:
sequences[protein] = {
"sequence": data["sequence"],
"length": len(data["sequence"]),
"uniprot_id": data.get("uniprot_id", "N/A")
}
print("\nProtein Sequence Summary:")
print(f"{'Protein':<15} {'UniProt ID':<12} {'Length':<10}")
print("-" * 40)
for name, info in sequences.items():
print(f"{name:<15} {info['uniprot_id']:<12} {info['length']:<10}")
Tool Description
get_protein_sequence_by_name: Retrieve protein sequence from UniProt database
- Args:
protein_name (str): Protein common name, gene symbol, or UniProt ID
- Returns:
sequence (str): Amino acid sequence (one-letter code)
uniprot_id (str): UniProt accession number
protein_names (str): Official and alternative protein names
organism (str): Source organism
function (str): Protein function description
length (int): Sequence length in residues
mass (float): Molecular mass (Da)
Input/Output
protein_name: Protein identifier (flexible format)
- Examples: "insulin", "P53", "BRCA1", "P01308"
- Supports: common names, gene symbols, UniProt IDs
- Protein sequence and comprehensive metadata
- Ready for downstream analysis (alignment, structure prediction, etc.)
Supported Query Types
- Common Names: "insulin", "hemoglobin", "actin"
- Gene Symbols: "TP53", "BRCA1", "EGFR"
- UniProt IDs: "P01308", "P04637"
- Protein Families: "kinase", "protease" (returns multiple entries)
Applications
Use retrieved sequences for:
- Protein alignment and homology analysis
- Structure prediction (AlphaFold, ESM Fold)
- Primer design for cloning
- Antibody epitope mapping
- Conservation analysis
- Mutation impact assessment
- Phylogenetic studies
Integration with Other Workflows
- Protein BLAST → Find homologs
- InterProScan → Identify domains
- AlphaFold → Predict 3D structure
- STRING → Find protein interactions
- OpenTargets → Link to diseases
Example: Complete Protein Analysis Pipeline
result = await uniprot_client.session.call_tool(
"get_protein_sequence_by_name",
arguments={"protein_name": "BRCA1"}
)
sequence = uniprot_client.parse_result(result)["sequence"]
result = await biotools_client.session.call_tool(
"blast_search",
arguments={
"sequence": sequence,
"evalue": 1e-10,
"max_hits": 20
}
)
homologs = biotools_client.parse_result(result)
result = await biotools_client.session.call_tool(
"interproscan_analyze",
arguments={
"sequence": sequence,
"databases": ["Pfam", "SMART"]
}
)
domains = biotools_client.parse_result(result)
result = await opentargets_client.session.call_tool(
"get_target_associated_diseases",
arguments={"gene_symbol": "BRCA1"}
)
diseases = opentargets_client.parse_result(result)
print(f"Complete analysis for BRCA1:")
print(f"- Sequence length: {len(sequence)} amino acids")
print(f"- Homologs found: {len(homologs)}")
print(f"- Functional domains: {len(domains)}")
print(f"- Associated diseases: {len(diseases)}")
Error Handling
- Protein not found: Check spelling, try alternative names or UniProt ID
- Multiple matches: Use more specific identifier (UniProt ID preferred)
- No sequence available: Some entries may lack sequence data
- Network timeout: Retry with exponential backoff
Data Quality Notes
- UniProt is manually curated (Swiss-Prot) and computationally annotated (TrEMBL)
- Sequence quality: Swiss-Prot entries are highly reliable
- Updates: UniProt is updated regularly; sequences may change
- Isoforms: Multiple isoforms may exist; canonical sequence is returned by default