Skip to contents

An auxiliary function useful for filtering differential analyte sets by tissues or omes.

Usage

limit_sets_by_regex(sets, regs, append_semicol = TRUE)

Arguments

sets

A named list of character vectors.

regs

A character vector of regular expressions

append_semicol

A logical. If TRUE (the default): append ';' as the suffix of each regex.

Value

named list of filtered sets

Details

This function was added for helping with managing the output of the Bayesian clustering in real data. It takes a list of analyte (e.g., gene ids) sets and removes items that do not match the regular expressions in regs.

Examples

sets = list(
  "cluster1" = c("muscle;g1","heart;g1","muscle;g2"),
  "cluster2" = c("muscle;g11","heart;g11","muscle;g12")
)
# remove non muscle analytes from the clustering solution above:
limit_sets_by_regex(sets,"muscle")
#> $cluster1
#> [1] "muscle;g1" "muscle;g2"
#> 
#> $cluster2
#> [1] "muscle;g11" "muscle;g12"
#>