Skip to contents

Collection of functions for filtering genes based on expression patterns in PhyloExpressionSet objects.

Generic function to select genes with the highest values for a given expression metric.

Usage

genes_top_expr(phyex_set, FUN = rowMeans, p = 0.99, ...)

Arguments

phyex_set

A PhyloExpressionSet object

FUN

Function to calculate gene-wise expression metric (default: rowMeans)

p

Quantile threshold for gene selection (default: 0.99)

...

Additional arguments passed to FUN

Value

Character vector of gene IDs with metric values >= p quantile

Details

This function applies the specified function to calculate a metric for each gene across samples, then selects genes above the specified quantile threshold. Common functions include rowMeans for mean expression, rowVars for variance, or custom functions for other metrics.

Examples

# Select top 1% most expressed genes by mean
# high_expr_genes <- genes_top_expr(phyex_set, rowMeans, p = 0.99)

# Select top 5% most variable genes
# high_var_genes <- genes_top_expr(phyex_set, rowVars, p = 0.95)

# Select top genes by median expression
# high_median_genes <- genes_top_expr(phyex_set, function(x) apply(x, 1, median), p = 0.9)