## ----echo = FALSE, message = FALSE-------------------------------------------- library(knitr) knitr::opts_chunk$set( error = FALSE, tidy = FALSE, message = FALSE, warning = FALSE, fig.align = "center") ## ----echo = FALSE------------------------------------------------------------- knitr::knit_hooks$set(pngquant = knitr::hook_pngquant) knitr::opts_chunk$set( dev = "ragg_png", fig.align = "center", pngquant = "--speed=10 --quality=50" ) ## ----------------------------------------------------------------------------- library(simona) dag = create_ontology_DAG_from_GO_db(org_db = "org.Hs.eg.db") dag ## ----------------------------------------------------------------------------- set.seed(888) genes = random_items(dag, 500) head(genes) ## ----------------------------------------------------------------------------- tb = dag_enrich_on_genes(dag, genes) tb = tb[order(tb$p_adjust), ] head(tb) ## ----------------------------------------------------------------------------- top_go_ids = tb$term[1:200] mat = term_sim(dag, top_go_ids) ## ----fig.width = 6.5, fig.height = 6------------------------------------------ library(ComplexHeatmap) Heatmap(mat, name = "similarity", show_row_names = FALSE, show_column_names = FALSE, show_row_dend = FALSE, show_column_dend = FALSE) ## ----fig.width = 9, fig.height = 7-------------------------------------------- dag_circular_viz(dag, top_go_ids) ## ----fig.width = 8.5, fig.height = 4.34--------------------------------------- library(simplifyEnrichment) simplifyEnrichment(mat) ## ----eval = FALSE------------------------------------------------------------- # library(AnnotationHub) # ah = AnnotationHub() # org_db = ah[["AH112417"]] # dag = create_ontology_DAG_from_GO_db(org_db = org_db) ## ----------------------------------------------------------------------------- dag = ontology_kw("human") dag ## ----------------------------------------------------------------------------- genes = random_items(dag, 500) tb = dag_enrich_on_genes(dag, genes) tb = tb[order(tb$p_adjust), ] top_go_ids = tb$term[1:50] ## ----fig.width = 6.5, fig.height = 6------------------------------------------ mat = term_sim(dag, top_go_ids) Heatmap(mat, name = "similarity", show_row_names = FALSE, show_column_names = FALSE, show_row_dend = FALSE, show_column_dend = FALSE) ## ----fig.width = 9, fig.height = 7-------------------------------------------- dag_circular_viz(dag, top_go_ids) ## ----fig.width = 5.5, fig.height = 4.34--------------------------------------- cl = simplifyEnrichment(mat) head(cl) ## ----------------------------------------------------------------------------- dag = ontology_pw("human") dag ## ----eval = FALSE------------------------------------------------------------- # # `genes` must be in symbols # tb = dag_enrich_on_genes(dag, genes) ## ----eval = FALSE------------------------------------------------------------- # dag = ontology_chebi("human") ## ----eval = FALSE------------------------------------------------------------- # # `genes` must be in symbols # tb = dag_enrich_on_genes(dag, genes) ## ----eval = FALSE------------------------------------------------------------- # dag = ontology_rdo("human") ## ----eval = FALSE------------------------------------------------------------- # # `genes` must be in symbols # tb = dag_enrich_on_genes(dag, genes) ## ----eval = FALSE------------------------------------------------------------- # dag = ontology_vt("human") ## ----eval = FALSE------------------------------------------------------------- # # `genes` must be in symbols # tb = dag_enrich_on_genes(dag, genes) ## ----------------------------------------------------------------------------- sessionInfo()