| Title: | Disease Ontology Semantic and Enrichment analysis |
|---|---|
| Description: | Provides ontology-aware methods for disease and phenotype knowledge mining. DOSE supports semantic similarity analysis of disease and phenotype ontology terms, genes, and gene clusters using methods including Resnik, Schlicker, Jiang, Lin, and Wang. It also provides over-representation analysis and gene set enrichment analysis for interpreting gene vectors and ranked gene lists in disease, phenotype, and cancer contexts. |
| Authors: | Guangchuang Yu [aut, cre], Li-Gen Wang [ctb], Vladislav Petyuk [ctb], Giovanni Dall'Olio [ctb] |
| Maintainer: | Guangchuang Yu <[email protected]> |
| License: | Artistic-2.0 |
| Version: | 4.7.3 |
| Built: | 2026-09-24 19:33:42 UTC |
| Source: | https://github.com/bioc/DOSE |
Coerce a canonical interpretation result to a data.frame
## S4 method for signature 'doseInterpretResult' as.data.frame(x, row.names = NULL, optional = FALSE, ...)## S4 method for signature 'doseInterpretResult' as.data.frame(x, row.names = NULL, optional = FALSE, ...)
x |
A 'doseInterpretResult' object. |
row.names, optional, ...
|
Passed to [base::as.data.frame()]. |
A data.frame of ranked result rows.
semantic similarity between two gene clusters
clusterSim( cluster1, cluster2, ont = "HDO", organism = NULL, measure = "Wang", combine = "BMA" )clusterSim( cluster1, cluster2, ont = "HDO", organism = NULL, measure = "Wang", combine = "BMA" )
cluster1 |
a vector of gene IDs |
cluster2 |
another vector of gene IDs |
ont |
one of "HDO", "HPO" and "MPO" |
organism |
species of the Entrez gene IDs. If omitted, it is inferred from 'ont'. |
measure |
One of "Resnik", "Lin", "Rel", "Jiang" and "Wang" methods. |
combine |
One of "max", "avg", "rcmax", "BMA" methods, for combining |
given two gene clusters, this function calculates semantic similarity between them.
similarity
Yu Guangchuang
## Not run: cluster1 <- c("835", "5261","241", "994") cluster2 <- c("307", "308", "317", "321", "506", "540", "378", "388", "396") clusterSim(cluster1, cluster2) ## End(Not run)## Not run: cluster1 <- c("835", "5261","241", "994") cluster2 <- c("307", "308", "317", "321", "506", "540", "378", "388", "396") clusterSim(cluster1, cluster2) ## End(Not run)
compute information content
computeIC(ont = "HDO")computeIC(ont = "HDO")
ont |
one of "DO", "HPO" and "MPO" |
Guangchuang Yu https://yulab-smu.top
Shared parameters for DOSE functions
gene |
a vector of entrez gene id |
organism |
species of the input Entrez gene IDs. Use "hsa" for human or "mm" for mouse. Common aliases such as "human", "mouse", and "mmu" are accepted. If omitted, the species is inferred from 'ont'. |
ont |
one of "HDO", "HPO" or "MPO" |
pvalueCutoff |
pvalue cutoff |
pAdjustMethod |
one of "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none" |
universe |
background genes |
minGSSize |
minimal size of genes annotated by ontology term for testing |
maxGSSize |
maximal size of each geneSet for analyzing |
qvalueCutoff |
qvalue cutoff |
readable |
whether mapping gene ID to gene Name |
geneList |
order ranked geneList |
exponent |
weight of each step |
nPerm |
permutation numbers |
verbose |
print message or not |
adaptive |
logical, use adaptive permutation or not (default: FALSE) |
minPerm |
minimum number of permutations for adaptive mode (default: 1000) |
maxPerm |
maximum number of permutations for adaptive mode (default: 10000) |
method |
method of GSEA, one of "multilevel", "permute", "sample" |
seed |
random seed for reproducibility, set to a number (or TRUE to use a
fixed default seed) to make the result reproducible, or FALSE (default) to draw
a random seed on each run, so results may vary between runs. The underlying
permutation engine uses its own RNG seeded with this value; see
|
Construct a canonical interpretation result
doseInterpretResult( result = NULL, evidence = NULL, query = NULL, sources = NULL, parameters = list(), explanation = list() )doseInterpretResult( result = NULL, evidence = NULL, query = NULL, sources = NULL, parameters = list(), explanation = list() )
result |
Ranked target rows. |
evidence |
Long-form evidence rows. |
query |
Query metadata rows. |
sources |
Source metadata rows. |
parameters |
Named list of analysis parameters. |
explanation |
Named list of explanation output. |
A validated 'doseInterpretResult' object.
'doseInterpretResult' is the single public result contract for disease interpretation workflows in DOSE.
resultA data.frame of ranked interpretation targets.
evidenceA data.frame of long-form evidence rows linked to targets.
queryA data.frame describing the input query or queries.
sourcesA data.frame describing source versions and checksums.
parametersA named list of analysis parameters.
explanationA named list storing optional explanation output.
measuring similarities between two DO term vectors.
doseSim(DOID1, DOID2, measure = "Wang", ont = "HDO") doSim(DOID1, DOID2, measure = "Wang", ont = "HDO")doseSim(DOID1, DOID2, measure = "Wang", ont = "HDO") doSim(DOID1, DOID2, measure = "Wang", ont = "HDO")
DOID1 |
DO term, MPO term or HPO term vector |
DOID2 |
DO term, MPO term or HPO term vector |
measure |
one of "Wang", "Resnik", "Rel", "Jiang", "Lin", and "TCSS". |
ont |
one of "HDO", "HPO" and "MPO" |
provide two term vectors, this function will calculate their similarities.
score matrix
Guangchuang Yu https://yulab-smu.top
Given a vector of genes, this function will return the enrichment DO categories with FDR control.
enrichDO( gene, ont = "HDO", organism = NULL, pvalueCutoff = 0.05, pAdjustMethod = "BH", universe, minGSSize = 10, maxGSSize = 500, qvalueCutoff = 0.2, readable = FALSE )enrichDO( gene, ont = "HDO", organism = NULL, pvalueCutoff = 0.05, pAdjustMethod = "BH", universe, minGSSize = 10, maxGSSize = 500, qvalueCutoff = 0.2, readable = FALSE )
gene |
a vector of entrez gene id |
ont |
one of "HDO", "HPO" or "MPO" |
organism |
species of the input Entrez gene IDs. Use "hsa" for human or "mm" for mouse. Common aliases such as "human", "mouse", and "mmu" are accepted. If omitted, the species is inferred from 'ont'. |
pvalueCutoff |
pvalue cutoff |
pAdjustMethod |
one of "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none" |
universe |
background genes |
minGSSize |
minimal size of genes annotated by ontology term for testing |
maxGSSize |
maximal size of each geneSet for analyzing |
qvalueCutoff |
qvalue cutoff |
readable |
whether mapping gene ID to gene Name |
A enrichResult instance.
Guangchuang Yu https://yulab-smu.top
data(geneList) gene = names(geneList)[geneList > 1] yy = enrichDO(gene, pvalueCutoff=0.05) summary(yy)data(geneList) gene = names(geneList)[geneList > 1] yy = enrichDO(gene, pvalueCutoff=0.05) summary(yy)
Enrichment analysis based on the Network of Cancer Genes database (https://www.network-cancer-genes.org/)
enrichNCG( gene, pvalueCutoff = 0.05, pAdjustMethod = "BH", universe, minGSSize = 10, maxGSSize = 500, qvalueCutoff = 0.2, readable = FALSE )enrichNCG( gene, pvalueCutoff = 0.05, pAdjustMethod = "BH", universe, minGSSize = 10, maxGSSize = 500, qvalueCutoff = 0.2, readable = FALSE )
gene |
a vector of entrez gene id |
pvalueCutoff |
pvalue cutoff |
pAdjustMethod |
one of "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none" |
universe |
background genes |
minGSSize |
minimal size of genes annotated by ontology term for testing |
maxGSSize |
maximal size of each geneSet for analyzing |
qvalueCutoff |
qvalue cutoff |
readable |
whether mapping gene ID to gene Name |
given a vector of genes, this function will return the enrichment NCG categories with FDR control
A enrichResult instance
Guangchuang Yu
Filter evidence rows from a canonical interpretation result
evidence(x, target_id = NULL, type = NULL, source = NULL, direction = NULL) ## S4 method for signature 'doseInterpretResult' evidence(x, target_id = NULL, type = NULL, source = NULL, direction = NULL)evidence(x, target_id = NULL, type = NULL, source = NULL, direction = NULL) ## S4 method for signature 'doseInterpretResult' evidence(x, target_id = NULL, type = NULL, source = NULL, direction = NULL)
x |
A 'doseInterpretResult' object. |
target_id |
Optional target identifier to keep. |
type |
Optional evidence type to keep. |
source |
Optional evidence source to keep. |
direction |
Optional evidence direction to keep. |
A filtered evidence data.frame.
Add evidence-grounded explanation text to a canonical interpretation result
explainDisease( x, method = c("template", "llm"), max_features = 3L, provider = NULL, model = NULL, language = c("en", "zh"), style = c("brief", "research", "cautious"), generation_params = list(), llm_adapter = NULL )explainDisease( x, method = c("template", "llm"), max_features = 3L, provider = NULL, model = NULL, language = c("en", "zh"), style = c("brief", "research", "cautious"), generation_params = list(), llm_adapter = NULL )
x |
A 'doseInterpretResult' object. |
method |
Explanation method. '"template"' is available offline. |
max_features |
Maximum number of evidence features to mention per query. |
provider |
Optional provider name passed to the LLM adapter. |
model |
Optional model name passed to the LLM adapter. |
language |
Explanation language for the optional LLM adapter. |
style |
Explanation style for the optional LLM adapter. |
generation_params |
Optional generation parameters passed to the LLM adapter. |
llm_adapter |
Optional adapter function for deterministic testing or custom provider integration. |
A 'doseInterpretResult' with the 'explanation' slot populated.
provide gene ID, this function will convert to the corresponding DO Terms
gene2DO(gene, organism = NULL, ont = "HDO")gene2DO(gene, organism = NULL, ont = "HDO")
gene |
entrez gene ID |
organism |
species of the Entrez gene ID. If omitted, it is inferred from 'ont'. |
ont |
ont |
DO Terms
Guangchuang Yu https://yulab-smu.top
measuring similarities bewteen two gene vectors.
geneSim( geneID1, geneID2 = NULL, ont = "HDO", organism = NULL, measure = "Wang", combine = "BMA" )geneSim( geneID1, geneID2 = NULL, ont = "HDO", organism = NULL, measure = "Wang", combine = "BMA" )
geneID1 |
entrez gene vector |
geneID2 |
entrez gene vector |
ont |
one of "HDO" and "MPO" |
organism |
species of the Entrez gene IDs. If omitted, it is inferred from 'ont'. |
measure |
one of "Wang", "Resnik", "Rel", "Jiang", and "Lin". |
combine |
One of "max", "avg", "rcmax", "BMA" methods, for combining semantic similarity scores of multiple DO terms associated with gene/protein. |
provide two entrez gene vectors, this function will calculate their similarity.
score matrix
Guangchuang Yu https://yulab-smu.top
g <- c("835", "5261","241", "994") geneSim(g)g <- c("835", "5261","241", "994") geneSim(g)
perform gsea analysis
gseDO( geneList, ont = "HDO", organism = NULL, exponent = 1, nPerm = 1000, minGSSize = 10, maxGSSize = 500, pvalueCutoff = 0.05, pAdjustMethod = "BH", verbose = TRUE, method = "multilevel", adaptive = FALSE, minPerm = 1000, maxPerm = 10000, seed = FALSE, ... )gseDO( geneList, ont = "HDO", organism = NULL, exponent = 1, nPerm = 1000, minGSSize = 10, maxGSSize = 500, pvalueCutoff = 0.05, pAdjustMethod = "BH", verbose = TRUE, method = "multilevel", adaptive = FALSE, minPerm = 1000, maxPerm = 10000, seed = FALSE, ... )
geneList |
order ranked geneList |
ont |
one of "HDO", "HPO" or "MPO" |
organism |
species of the input Entrez gene IDs. Use "hsa" for human or "mm" for mouse. Common aliases such as "human", "mouse", and "mmu" are accepted. If omitted, the species is inferred from 'ont'. |
exponent |
weight of each step |
nPerm |
permutation numbers |
minGSSize |
minimal size of genes annotated by ontology term for testing |
maxGSSize |
maximal size of each geneSet for analyzing |
pvalueCutoff |
pvalue cutoff |
pAdjustMethod |
one of "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none" |
verbose |
print message or not |
method |
method of GSEA, one of "multilevel", "permute", "sample" |
adaptive |
logical, use adaptive permutation or not (default: FALSE) |
minPerm |
minimum number of permutations for adaptive mode (default: 1000) |
maxPerm |
maximum number of permutations for adaptive mode (default: 10000) |
seed |
random seed for reproducibility, set to a number (or TRUE to use a
fixed default seed) to make the result reproducible, or FALSE (default) to draw
a random seed on each run, so results may vary between runs. The underlying
permutation engine uses its own RNG seeded with this value; see
|
... |
other parameter |
gseaResult object
Guangchuang Yu
perform gsea analysis
gseNCG( geneList, exponent = 1, nPerm = 1000, minGSSize = 10, maxGSSize = 500, pvalueCutoff = 0.05, pAdjustMethod = "BH", verbose = TRUE, method = "multilevel", adaptive = FALSE, minPerm = 1000, maxPerm = 10000, seed = FALSE, ... )gseNCG( geneList, exponent = 1, nPerm = 1000, minGSSize = 10, maxGSSize = 500, pvalueCutoff = 0.05, pAdjustMethod = "BH", verbose = TRUE, method = "multilevel", adaptive = FALSE, minPerm = 1000, maxPerm = 10000, seed = FALSE, ... )
geneList |
order ranked geneList |
exponent |
weight of each step |
nPerm |
permutation numbers |
minGSSize |
minimal size of genes annotated by ontology term for testing |
maxGSSize |
maximal size of each geneSet for analyzing |
pvalueCutoff |
pvalue cutoff |
pAdjustMethod |
one of "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none" |
verbose |
print message or not |
method |
method of GSEA, one of "multilevel", "permute", "sample" |
adaptive |
logical, use adaptive permutation or not (default: FALSE) |
minPerm |
minimum number of permutations for adaptive mode (default: 1000) |
maxPerm |
maximum number of permutations for adaptive mode (default: 10000) |
seed |
random seed for reproducibility, set to a number (or TRUE to use a
fixed default seed) to make the result reproducible, or FALSE (default) to draw
a random seed on each run, so results may vary between runs. The underlying
permutation engine uses its own RNG seeded with this value; see
|
... |
other parameter |
gseaResult object
Guangchuang Yu
This function defines the public interpretation contract and performs validation before the first disease-ranking implementation is enabled.
interpretDisease( x, input = c("auto", "gene", "ranked_gene", "gene_set_list", "phenotype"), organism = c("human", "mouse"), target = c("disease", "mouse_model", "both"), ontology = "auto", id_type = "auto", orthology = c("one_to_one", "all"), explain = c("none", "template", "llm"), top = 50, ... )interpretDisease( x, input = c("auto", "gene", "ranked_gene", "gene_set_list", "phenotype"), organism = c("human", "mouse"), target = c("disease", "mouse_model", "both"), ontology = "auto", id_type = "auto", orthology = c("one_to_one", "all"), explain = c("none", "template", "llm"), top = 50, ... )
x |
Query input. |
input |
One of '"auto"', '"gene"', '"ranked_gene"', '"gene_set_list"', or '"phenotype"'. |
organism |
One of '"human"' or '"mouse"'. |
target |
One of '"disease"', '"mouse_model"', or '"both"'. |
ontology |
Ontology to use. '"auto"' currently resolves to '"HDO"' for the supported human disease path. |
id_type |
Identifier type. The current implementation accepts '"auto"' and '"ENTREZID"'. |
orthology |
One of '"one_to_one"' or '"all"'. |
explain |
One of '"none"', '"template"', or '"llm"'. |
top |
Maximum number of targets to return. |
... |
Additional arguments passed to the underlying enrichment functions. Cross-species 'target = "mouse_model"' and 'target = "both"' also require 'disease_model_file', 'homology_file', and 'gene_pheno_file'. |
A 'doseInterpretResult' once the ranking path is implemented.
Pairwise semantic similarity for a list of gene clusters
mclusterSim( clusters, ont = "HDO", organism = NULL, measure = "Wang", combine = "BMA" )mclusterSim( clusters, ont = "HDO", organism = NULL, measure = "Wang", combine = "BMA" )
clusters |
A list of gene clusters |
ont |
one of "HDO", "HPO" and "MPO" |
organism |
species of the Entrez gene IDs. If omitted, it is inferred from 'ont'. |
measure |
one of "Wang", "Resnik", "Rel", "Jiang", and "Lin". |
combine |
One of "max", "avg", "rcmax", "BMA" methods, for combining semantic similarity scores of multiple DO terms associated with gene/protein. |
similarity matrix
Guangchuang Yu
## Not run: cluster1 <- c("835", "5261","241") cluster2 <- c("578","582") cluster3 <- c("307", "308", "317") clusters <- list(a=cluster1, b=cluster2, c=cluster3) mclusterSim(clusters, measure="Wang") ## End(Not run)## Not run: cluster1 <- c("835", "5261","241") cluster2 <- c("578","582") cluster3 <- c("307", "308", "317") clusters <- list(a=cluster1, b=cluster2, c=cluster3) mclusterSim(clusters, measure="Wang") ## End(Not run)
Rank mouse disease models from human query genes
rankMouseModels( gene, disease_model_file, homology_file, gene_pheno_file, top = 50 )rankMouseModels( gene, disease_model_file, homology_file, gene_pheno_file, top = 50 )
gene |
A character vector of human Entrez gene IDs. |
disease_model_file |
Path to an 'MGI_DiseaseMouseModel.rpt'-format file. |
homology_file |
Path to a 'HOM_MouseHumanSequence.rpt'-format file. |
gene_pheno_file |
Path to an 'MGI_GenePheno.rpt'-format file. |
top |
Maximum number of mouse-model targets to return. |
A 'doseInterpretResult' with 'target_type = "mouse_model"'.
Show a canonical interpretation result
## S4 method for signature 'doseInterpretResult' show(object)## S4 method for signature 'doseInterpretResult' show(object)
object |
A 'doseInterpretResult' object. |
The object is shown to the console and returned invisibly.
plotting similarity matrix
simplot( sim, xlab = "", ylab = "", color.low = "white", color.high = "red", labs = TRUE, digits = 2, labs.size = 3, font.size = 14 )simplot( sim, xlab = "", ylab = "", color.low = "white", color.high = "red", labs = TRUE, digits = 2, labs.size = 3, font.size = 14 )
sim |
similarity matrix |
xlab |
xlab |
ylab |
ylab |
color.low |
color of low value |
color.high |
color of high value |
labs |
logical, add text label or not |
digits |
round digit numbers |
labs.size |
lable size |
font.size |
font size |
ggplot object
Yu Guangchuang
Summarize a canonical interpretation result
## S4 method for signature 'doseInterpretResult' summary(object, ...)## S4 method for signature 'doseInterpretResult' summary(object, ...)
object |
A 'doseInterpretResult' object. |
... |
Reserved for generic compatibility. |
A named list summarizing queries, targets, evidence, and sources.
ggplot theme of DOSE
theme_dose(font.size = 14)theme_dose(font.size = 14)
font.size |
font size |
ggplot theme
library(ggplot2) qplot(1:10) + theme_dose()library(ggplot2) qplot(1:10) + theme_dose()