Generate similarity matrix for input terms.
compute_term_similarities(
df_terms,
similarity_function = jaccard,
max_similarity = 1
)
Dataframe storing pathway database.
Function to compute similarity between two sets.
Value to fill diagonal with.
Symmetric matrix of similarity scores.
df_terms <- data.frame(
term = c("A", "A", "B", "B", "B", "C", "C", "C"),
gene = c("a", "b", "a", "b", "c", "a", "c", "d")
)
compute_term_similarities(df_terms)
#> A B C
#> A 1.0000000 0.6666667 0.25
#> B 0.6666667 1.0000000 0.50
#> C 0.2500000 0.5000000 1.00