p_adj_f: Correct p-value with independent filtering

View source: R/rnaseqdea.R

p_adj_fR Documentation

Correct p-value with independent filtering

Description

Correct p-value with independent filtering

Usage

p_adj_f(pval, filter.stat, alpha = 0.1, method = "BH")

Arguments

pval

an vector of p-values

filter.stat

A vector of stage-one filter statistics, or a function which is able to compute this vector from data, if data is supplied. See genefilter::filtered_p().

alpha

p-values threshold for selection

method

p-value correction method

Details

This function is modified from some code segments from

Value

a list.

Examples

## data set from R package 'pasilla' 
dn <- system.file("extdata/pasilla_gene_counts.tsv", package = "rnaseqdea")
data <- read.table(dn, header = TRUE, row.names = 1, quote = "", comment.char = "")
keep <- rowSums(data) > 6000
data <- data[keep, ]
cls <- c("untreated", "untreated", "untreated", "untreated", 
         "treated", "treated", "treated")
cls <- as.factor(cls)

## use limma's voom
res <- stats_voom(data, cls, com = levels(cls), norm.method = "TMM")
names(res)     # "stats", "rej.num", "data", "cls", "padjf"
res$rej.num 
head(res$stats)

## independent filtering for adjusted p-values
stats <- res$stats
pval <- stats$pval
names(pval) <- rownames(stats)
padj <- p_adj_f(pval, stats$mean, alpha = 0.1, method = "BH")
names(padj)
padj$rej


wanchanglin/rnaseqdea documentation built on June 2, 2025, 1:05 a.m.