Learn R Programming

kgraph (version 1.2.0)

Knowledge Graphs Constructions and Visualizations

Description

Knowledge graphs enable to efficiently visualize and gain insights into large-scale data analysis results, as p-values from multiple studies or embedding data matrices. The usual workflow is a user providing a data frame of association studies results and specifying target nodes, e.g. phenotypes, to visualize. The knowledge graph then shows all the features which are significantly associated with the phenotype, with the edges being proportional to the association scores. As the user adds several target nodes and grouping information about the nodes such as biological pathways, the construction of such graphs soon becomes complex. The 'kgraph' package aims to enable users to easily build such knowledge graphs, and provides two main features: first, to enable building a knowledge graph based on a data frame of concepts relationships, be it p-values or cosine similarities; second, to enable determining an appropriate cut-off on cosine similarities from a complete embedding matrix, to enable the building of a knowledge graph directly from an embedding matrix. The 'kgraph' package provides several display, layout and cut-off options, and has already proven useful to researchers to enable them to visualize large sets of p-value associations with various phenotypes, and to quickly be able to visualize embedding results. Two example datasets are provided to demonstrate these behaviors, and several live 'shiny' applications are hosted by the CELEHS laboratory and Parse Health, as the KESER Mental Health application based on Hong C. (2021) .

Copy Link

Version

Install

install.packages('kgraph')

Monthly Downloads

219

Version

1.2.0

License

GPL-3

Maintainer

Thomas Charlon

Last Published

March 10th, 2025

Functions in kgraph (1.2.0)

project_pairs

Predict known pairs
fit_embeds_kg

Fit embeddings to a kgraph object
fit_embeds_to_pairs

Fit embeds to pairs
get_sgraph

Wrapper to build a sgraph object fromk a kgraph object
m_embeds

A dataset containing medical word embeddings
sparse_encode

sparse_encode
reshape_multiple_traits

Reshape multiple traits in example data
reshape_multiple_traits_dict

Reshape multiple traits in example data dictionary
gen_df_notpairs

Generate null pairs
get_cutoff_threshold

Get cut-off threshold
%<>%

Assignment pipe
%$%

Exposition pipe
cov_simi

Covariance similarity
build_kgraph_from_fit

Build a knowledge graph from a fit object
df_embeds_dict

A dictionary for the m_embeds object
df_cuis_pairs

A dataset containing CUIs pairs
df_pval_dict

A dictionary for the df_pval object
build_kgraph

Build a knowledge graph
df_phecode_pairs

A dataset containing Phecode pairs
df_pval

A dataset containing GWAS p-values
%>%

Pipe