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
Pathways & Functional
Cell Biology
Literature
Drug & Clinical
Ontology
Proteomics
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:
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