Skip to contents

Keep only edges which its target features belong to the input matrix.

Usage

intersect_regulons(mat, network, .source, .target, minsize)

Arguments

mat

Matrix to evaluate (e.g. expression matrix). Target nodes in rows and conditions in columns. rownames(mat) must have at least one intersection with the elements in network .target column.

network

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

.source

Column with source nodes.

.target

Column with target nodes.

minsize

Minimum number of targets per source allowed.

Value

Filtered tibble.

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"))
intersect_regulons(mat, net, source, target, minsize=4)
#> # A tibble: 4 × 3
#> # Groups:   source [1]
#>   source target   mor
#>   <chr>  <chr>  <dbl>
#> 1 T3     G06     -0.5
#> 2 T3     G07     -3  
#> 3 T3     G08     -1  
#> 4 T3     G11      1