Store term membership for each gene.
create_model_df(df_genes, df_terms, pvalue_threshold = 0.05)
Dataframe storing gene names and DE p-values.
Dataframe storing pathway database.
P-value threshold to create binary columns `pvalue_sig` and `pvalue_notsig`.
Dataframe.
df_genes <- data.frame(
gene = c("g1", "g2"),
pvalue = c(0.1, 0.2)
)
df_terms <- data.frame(
term = c("A", "A", "B", "B", "C"),
gene = c("g1", "g2", "g1", "g2", "g2")
)
create_model_df(df_genes, df_terms)
#> # A tibble: 2 × 7
#> gene pvalue A.member B.member C.member pvalue_sig pvalue_notsig
#> <fct> <dbl> <lgl> <lgl> <lgl> <lgl> <lgl>
#> 1 g1 0.1 TRUE TRUE FALSE FALSE TRUE
#> 2 g2 0.2 TRUE TRUE TRUE FALSE TRUE