
Transcriptomic Knowledge Graph Integration with tKOI
Wanjun Gu
2025-08-05
getting-started-with-tkoi.Rmd
Overview
tKOI
(Transcriptomic Knowledge-graph Omics Integration)
is an R package for integrating transcriptomic data with a biological
knowledge graph to identify enriched biological concepts and pathways.
It combines PageRank propagation with permutation testing and
ontology-based annotations for high-resolution network
interpretation.
Step-by-Step Example
This vignette demonstrates a complete workflow using the
tkoi
package.
Load Example Expression Data
file_path = system.file("extdata", "example_data.csv", package = "tkoi")
expression_data = data.table::fread(file_path)
head(expression_data)
Perform Gene Ontology Enrichment
tkoi_result = run_gene_enrichment(tkoi_result)
Visualize GO vs Graph Enrichment
tkoi_result@gene_enrichment_comparison$comparison_scatter1
tkoi_result@gene_enrichment_comparison$comparison_scatter2
Gene-Level Network Visualization
plt1 = make_gene_exploration_plot(
tkoi_list = tkoi_result,
sig_color = "#F39B7FB2",
non_sig_color = "gray"
)
plt1
Export Enrichment Summary Table
gene_data = export_gene_exploration_data(tkoi_result)
head(gene_data)
Visualize Top Enriched Genes
plt2 = visualize_topn(
tkoi_list = tkoi_result,
category = "Gene",
top_n = 25,
high_color = "#FF5733",
low_color = "#154360"
)
plt2
Save Analysis Result (Optional)
save(tkoi_result, file = "tkoi_result.rda")
Session Info
sessionInfo()
#> R version 4.5.0 (2025-04-11)
#> Platform: aarch64-apple-darwin20
#> Running under: macOS Sequoia 15.5
#>
#> Matrix products: default
#> BLAS: /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.1
#>
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#>
#> time zone: America/Los_Angeles
#> tzcode source: internal
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> loaded via a namespace (and not attached):
#> [1] digest_0.6.37 desc_1.4.3 R6_2.6.1 fastmap_1.2.0
#> [5] xfun_0.52 cachem_1.1.0 knitr_1.50 htmltools_0.5.8.1
#> [9] rmarkdown_2.29 lifecycle_1.0.4 cli_3.6.5 sass_0.4.10
#> [13] pkgdown_2.1.3 textshaping_1.0.1 jquerylib_0.1.4 systemfonts_1.2.3
#> [17] compiler_4.5.0 rstudioapi_0.17.1 tools_4.5.0 ragg_1.4.0
#> [21] bslib_0.9.0 evaluate_1.0.4 yaml_2.3.10 jsonlite_2.0.0
#> [25] rlang_1.1.6 fs_1.6.6 htmlwidgets_1.6.4