R/calculate_events.R
calculate_events.Rd
Calculate the number of mutually exclusive or co-mutation events in a bipartite graph
calc_mutex_events(gs, bgr, sample_is = TRUE) calc_comut_events(gs, bgr, sample_is = TRUE)
gs | the "gene set" is a vector of genes to consider |
---|---|
bgr | a bipartite graph (as a tidygraph graph object); it must have a boolean node attribute "type" that describes which group each node is in |
sample_is | either |
set.seed(0) suppressPackageStartupMessages(library(tidygraph)) bgr <- make_sample_gene_bipartite( simple_dataset$sample_name, simple_dataset$mutated_gene ) plot(bgr)#> [1] 12#> [1] 9