selectPathways: Randomly Select Pathways with Limited Word Count

View source: R/EnrichCirclize.R

selectPathwaysR Documentation

Randomly Select Pathways with Limited Word Count

Description

This function randomly selects a specified number of pathways from a given list, ensuring that each selected pathway name does not exceed a specified number of words. It filters out pathways with names longer than the specified word limit before making the selection.

Usage

selectPathways(pathways, max_words = 10, num_select = 10)

Arguments

pathways

Character vector of pathways.

max_words

Integer, maximum number of words allowed in the pathway name.

num_select

Integer, number of pathways to randomly select.

Value

A character vector of selected pathways.

Examples

pathway_list <- c("pathway_one response to stimulus",
                  "pathway_two cell growth and death",
                  "pathway_three regulation of cellular process",
                  "pathway_four metabolic process")
selected_pathways <- selectPathways(pathway_list, max_words = 5, num_select = 2)


TransProR documentation built on April 4, 2025, 3:16 a.m.