BioContext Knowledge Queries
Use this skill when the user wants to look up gene/protein annotations, query pathway databases, find cell type markers, search biomedical literature, or explore drug-disease associations. BioContext provides programmatic access to 49 biomedical databases through a unified Python API.
This is a knowledge integration layer — use it to annotate analysis results (e.g., annotate DEG lists with protein function, find pathways for gene clusters, validate marker genes against PanglaoDB).
Available Functions by Category
Protein & Genomics
| Function |
Database |
Returns |
query_uniprot(gene_symbol, species) |
UniProt |
Protein function, domains, GO terms, references |
get_uniprot_id(protein_symbol, species) |
UniProt |
UniProt accession ID |
query_alphafold(protein_symbol, species) |
AlphaFold |
Predicted 3D structure, confidence scores |
get_ensembl_id(gene_symbol, species) |
Ensembl |
Ensembl gene ID (ENSG...) |
query_interpro(protein_id, source_db) |
InterPro |
Protein domains, families, structural info |
search_interpro(query, entry_type) |
InterPro |
Domain search by keyword |
query_string(protein_symbol, species, min_score) |
STRING |
Protein-protein interactions |
query_hpa(gene_symbol) |
Human Protein Atlas |
Tissue expression, subcellular localization |
Pathways & Functional
| Function |
Database |
Returns |
query_reactome(identifier, species) |
Reactome |
Pathway membership, reactions, disease links |
query_go(gene_name, size) |
Gene Ontology |
GO term associations (BP, MF, CC) |
Cell Biology
| Function |
Database |
Returns |
query_panglaodb(species, cell_type, organ) |
PanglaoDB |
Cell type marker genes with sensitivity/specificity |
Literature
| Function |
Database |
Returns |
search_literature(query, sort_by, page_size) |
Europe PMC |
Publications matching keywords |
search_preprints(server, days, category) |
bioRxiv/medRxiv |
Recent preprints |
get_fulltext(pmc_id) |
PubMed Central |
Full-text article content |
Drug & Clinical
| Function |
Database |
Returns |
query_opentargets(query_string, variables) |
OpenTargets |
Gene-disease-drug associations |
search_clinical_trials(condition, status) |
ClinicalTrials.gov |
Active/completed trials |
search_drugs(brand_name, generic_name) |
openFDA |
Drug information, approval status |
Ontology
| Function |
Database |
Returns |
query_efo(disease_name, size, exact_match) |
EFO |
Experimental Factor Ontology terms |
query_chebi(chemical_name, size) |
ChEBI |
Chemical entities, small molecules |
query_cell_ontology(cell_type, size) |
Cell Ontology |
Standardized cell type hierarchy |
Proteomics
| Function |
Database |
Returns |
search_pride(keyword, page_size) |
PRIDE |
Mass spectrometry proteomics datasets |
Generic Access
# List all 49 available tools with parameters
ov.biocontext.list_tools()
# Call any tool directly by name
result = ov.biocontext.call_tool("tool_name", param1=value1, ...)
Usage Patterns
Single gene lookup
import omicverse as ov
# Get protein function and domains
info = ov.biocontext.query_uniprot(gene_symbol='TP53', species='9606')
# Get pathway membership
pathways = ov.biocontext.query_reactome(identifier='TP53', species='Homo sapiens')
# Get GO terms
go_terms = ov.biocontext.query_go(gene_name='TP53', size=20)
Annotate a DEG list
# After differential expression: annotate top genes with biological context
deg_genes = ['TP53', 'BRCA1', 'MYC', 'EGFR', 'KRAS']
annotations = {}
for gene in deg_genes:
annotations[gene] = {
'uniprot': ov.biocontext.query_uniprot(gene_symbol=gene),
'pathways': ov.biocontext.query_reactome(identifier=gene),
'go': ov.biocontext.query_go(gene_name=gene, size=5),
}
Find cell type markers
# Get known markers for a cell type
markers = ov.biocontext.query_panglaodb(
species='Hs', # 'Hs' (human), 'Mm' (mouse), 'Dr' (zebrafish)
cell_type='T cells',
organ='Blood',
min_sensitivity=0.5,
)
# Returns: DataFrame with gene symbols, sensitivity, specificity scores
Drug target exploration
# Find drugs targeting a gene
targets = ov.biocontext.query_opentargets(
query_string='{ target(ensemblId: "ENSG00000141510") { associatedDiseases { rows { disease { name } score } } } }'
)
# Search clinical trials
trials = ov.biocontext.search_clinical_trials(condition='breast cancer', status='RECRUITING')
Literature search
# Search for papers
results = ov.biocontext.search_literature(
query='single-cell RNA-seq BRCA1',
sort_by='RELEVANCE',
page_size=5,
)
# Get full text of a specific paper
text = ov.biocontext.get_fulltext(pmc_id='PMC1234567')
Species Codes
Different databases use different species identifiers:
| Species |
NCBI Taxon ID |
Ensembl |
PanglaoDB |
| Human |
9606 |
homo_sapiens |
Hs |
| Mouse |
10090 |
mus_musculus |
Mm |
| Zebrafish |
7955 |
danio_rerio |
Dr |
| Rat |
10116 |
rattus_norvegicus |
Rn |
Most functions default to human (9606 or homo_sapiens).
Critical API Reference
query_uniprot accepts multiple identifier types
# By gene symbol (most common)
ov.biocontext.query_uniprot(gene_symbol='TP53')
# By UniProt accession
ov.biocontext.query_uniprot(protein_id='P04637')
# By protein name
ov.biocontext.query_uniprot(protein_name='Cellular tumor antigen p53')
query_opentargets uses GraphQL
# OpenTargets requires GraphQL query strings
# See OpenTargets Platform API docs for query syntax
result = ov.biocontext.query_opentargets(
query_string='{ search(queryString: "BRCA1") { total hits { id name } } }'
)
Troubleshooting
- Empty results for a known gene: Check species parameter. Default is human (9606) — pass
species='10090' for mouse genes.
- Timeout on large queries: External API calls have network latency. For batch annotation, add small delays between calls to avoid rate limiting.
ConnectionError: Requires internet access. BioContext queries external databases in real-time.
- Gene symbol not found: Some databases are case-sensitive. Human genes should be uppercase (TP53), mouse mixed-case (Tp53).
- OpenTargets query fails: GraphQL syntax must be exact. Use
ov.biocontext.list_tools() to see available OpenTargets tool variants with example queries.
Examples
- "Look up the protein function and pathways for my top 10 DEGs."
- "Find known T-cell markers from PanglaoDB for my annotation."
- "Search for recent papers about spatial transcriptomics and BRCA1."
- "What drugs target EGFR? Check clinical trials status."
References
- Quick copy/paste commands:
reference.md
1---2name: biocontext-knowledge-queries3description: BioContext knowledge: UniProt, AlphaFold, STRING, Reactome, GO, PanglaoDB, PubMed, OpenTargets queries via ov.biocontext for gene annotation.4---56# BioContext Knowledge Queries78Use this skill when the user wants to look up gene/protein annotations, query pathway databases, find cell type markers, search biomedical literature, or explore drug-disease associations. BioContext provides programmatic access to 49 biomedical databases through a unified Python API.910This is a knowledge integration layer — use it to annotate analysis results (e.g., annotate DEG lists with protein function, find pathways for gene clusters, validate marker genes against PanglaoDB).1112## Available Functions by Category1314### Protein & Genomics1516| Function | Database | Returns |17|----------|----------|---------|18| `query_uniprot(gene_symbol, species)` | UniProt | Protein function, domains, GO terms, references |19| `get_uniprot_id(protein_symbol, species)` | UniProt | UniProt accession ID |20| `query_alphafold(protein_symbol, species)` | AlphaFold | Predicted 3D structure, confidence scores |21| `get_ensembl_id(gene_symbol, species)` | Ensembl | Ensembl gene ID (ENSG...) |22| `query_interpro(protein_id, source_db)` | InterPro | Protein domains, families, structural info |23| `search_interpro(query, entry_type)` | InterPro | Domain search by keyword |24| `query_string(protein_symbol, species, min_score)` | STRING | Protein-protein interactions |25| `query_hpa(gene_symbol)` | Human Protein Atlas | Tissue expression, subcellular localization |2627### Pathways & Functional2829| Function | Database | Returns |30|----------|----------|---------|31| `query_reactome(identifier, species)` | Reactome | Pathway membership, reactions, disease links |32| `query_go(gene_name, size)` | Gene Ontology | GO term associations (BP, MF, CC) |3334### Cell Biology3536| Function | Database | Returns |37|----------|----------|---------|38| `query_panglaodb(species, cell_type, organ)` | PanglaoDB | Cell type marker genes with sensitivity/specificity |3940### Literature4142| Function | Database | Returns |43|----------|----------|---------|44| `search_literature(query, sort_by, page_size)` | Europe PMC | Publications matching keywords |45| `search_preprints(server, days, category)` | bioRxiv/medRxiv | Recent preprints |46| `get_fulltext(pmc_id)` | PubMed Central | Full-text article content |4748### Drug & Clinical4950| Function | Database | Returns |51|----------|----------|---------|52| `query_opentargets(query_string, variables)` | OpenTargets | Gene-disease-drug associations |53| `search_clinical_trials(condition, status)` | ClinicalTrials.gov | Active/completed trials |54| `search_drugs(brand_name, generic_name)` | openFDA | Drug information, approval status |5556### Ontology5758| Function | Database | Returns |59|----------|----------|---------|60| `query_efo(disease_name, size, exact_match)` | EFO | Experimental Factor Ontology terms |61| `query_chebi(chemical_name, size)` | ChEBI | Chemical entities, small molecules |62| `query_cell_ontology(cell_type, size)` | Cell Ontology | Standardized cell type hierarchy |6364### Proteomics6566| Function | Database | Returns |67|----------|----------|---------|68| `search_pride(keyword, page_size)` | PRIDE | Mass spectrometry proteomics datasets |6970### Generic Access7172```python73# List all 49 available tools with parameters74ov.biocontext.list_tools()7576# Call any tool directly by name77result = ov.biocontext.call_tool("tool_name", param1=value1, ...)78```7980## Usage Patterns8182### Single gene lookup8384```python85import omicverse as ov8687# Get protein function and domains88info = ov.biocontext.query_uniprot(gene_symbol='TP53', species='9606')8990# Get pathway membership91pathways = ov.biocontext.query_reactome(identifier='TP53', species='Homo sapiens')9293# Get GO terms94go_terms = ov.biocontext.query_go(gene_name='TP53', size=20)95```9697### Annotate a DEG list9899```python100# After differential expression: annotate top genes with biological context101deg_genes = ['TP53', 'BRCA1', 'MYC', 'EGFR', 'KRAS']102annotations = {}103for gene in deg_genes:104 annotations[gene] = {105 'uniprot': ov.biocontext.query_uniprot(gene_symbol=gene),106 'pathways': ov.biocontext.query_reactome(identifier=gene),107 'go': ov.biocontext.query_go(gene_name=gene, size=5),108 }109```110111### Find cell type markers112113```python114# Get known markers for a cell type115markers = ov.biocontext.query_panglaodb(116 species='Hs', # 'Hs' (human), 'Mm' (mouse), 'Dr' (zebrafish)117 cell_type='T cells',118 organ='Blood',119 min_sensitivity=0.5,120)121# Returns: DataFrame with gene symbols, sensitivity, specificity scores122```123124### Drug target exploration125126```python127# Find drugs targeting a gene128targets = ov.biocontext.query_opentargets(129 query_string='{ target(ensemblId: "ENSG00000141510") { associatedDiseases { rows { disease { name } score } } } }'130)131132# Search clinical trials133trials = ov.biocontext.search_clinical_trials(condition='breast cancer', status='RECRUITING')134```135136### Literature search137138```python139# Search for papers140results = ov.biocontext.search_literature(141 query='single-cell RNA-seq BRCA1',142 sort_by='RELEVANCE',143 page_size=5,144)145146# Get full text of a specific paper147text = ov.biocontext.get_fulltext(pmc_id='PMC1234567')148```149150## Species Codes151152Different databases use different species identifiers:153154| Species | NCBI Taxon ID | Ensembl | PanglaoDB |155|---------|--------------|---------|-----------|156| Human | 9606 | homo_sapiens | Hs |157| Mouse | 10090 | mus_musculus | Mm |158| Zebrafish | 7955 | danio_rerio | Dr |159| Rat | 10116 | rattus_norvegicus | Rn |160161Most functions default to human (9606 or homo_sapiens).162163## Critical API Reference164165### query_uniprot accepts multiple identifier types166167```python168# By gene symbol (most common)169ov.biocontext.query_uniprot(gene_symbol='TP53')170171# By UniProt accession172ov.biocontext.query_uniprot(protein_id='P04637')173174# By protein name175ov.biocontext.query_uniprot(protein_name='Cellular tumor antigen p53')176```177178### query_opentargets uses GraphQL179180```python181# OpenTargets requires GraphQL query strings182# See OpenTargets Platform API docs for query syntax183result = ov.biocontext.query_opentargets(184 query_string='{ search(queryString: "BRCA1") { total hits { id name } } }'185)186```187188## Troubleshooting189190- **Empty results for a known gene**: Check species parameter. Default is human (9606) — pass `species='10090'` for mouse genes.191- **Timeout on large queries**: External API calls have network latency. For batch annotation, add small delays between calls to avoid rate limiting.192- **`ConnectionError`**: Requires internet access. BioContext queries external databases in real-time.193- **Gene symbol not found**: Some databases are case-sensitive. Human genes should be uppercase (TP53), mouse mixed-case (Tp53).194- **OpenTargets query fails**: GraphQL syntax must be exact. Use `ov.biocontext.list_tools()` to see available OpenTargets tool variants with example queries.195196## Examples197- "Look up the protein function and pathways for my top 10 DEGs."198- "Find known T-cell markers from PanglaoDB for my annotation."199- "Search for recent papers about spatial transcriptomics and BRCA1."200- "What drugs target EGFR? Check clinical trials status."201202## References203- Quick copy/paste commands: [`reference.md`](reference.md)