Returns a vector of genes that passes the minimum number of mutations.

filter_by_mutation_frequency(bgr, min_times_mut, sample_is = TRUE)

Arguments

bgr

a bipartite edge graph that has the node attributes type and name; these attributes are not checked for explicitly, but will throw an error if not present

min_times_mut

minimum number of mutations per gene

sample_is

either TRUE or FALSE dictating which boolean value corresponds to the samples in the "type" attribute of bgr

Value

a vector of (unique) gene names

Examples

library(wext) suppressPackageStartupMessages(library(tidygraph)) bgr <- make_sample_gene_bipartite( simple_dataset$sample_name, simple_dataset$mutated_gene ) filter_by_mutation_frequency(bgr, 2)
#> [1] "a" "c" "d" "e" "b" "g"
filter_by_mutation_frequency(bgr, 3)
#> [1] "a" "c" "d" "b"
filter_by_mutation_frequency(bgr, 4, sample_is = FALSE)
#> [1] "1" "2"