Skip to contents

Filter sources of a net with less than minsize targets

Usage

filt_minsize(mat_f_names, network, minsize = 5)

Arguments

mat_f_names

Feature names of mat.

network

Tibble or dataframe with edges and it's associated metadata.

minsize

Integer indicating the minimum number of targets per source.

Value

Filtered network.

Examples

inputs_dir <- system.file("testdata", "inputs", package = "decoupleR")
mat <- readRDS(file.path(inputs_dir, "mat.rds"))
net <- readRDS(file.path(inputs_dir, "net.rds"))
net <- rename_net(net, source, target, mor)
filt_minsize(rownames(mat), net, minsize = 4)
#> # A tibble: 4 × 4
#>   source target   mor likelihood
#>   <chr>  <chr>  <dbl>      <dbl>
#> 1 T3     G06     -0.5          1
#> 2 T3     G07     -3            1
#> 3 T3     G08     -1            1
#> 4 T3     G11      1            1