Combines log fold change and p-value into a single significance score
(Xiao et al. 2014). By default returns the signed variant
log2FC * -log10(p) for directional ranking; set signed = FALSE
for the paper's original |log2FC| * -log10(p).
piScore(
de_results,
logfc_col = "avg_log2FC",
pval_col = "p_val_adj",
signed = TRUE,
pval_floor = .Machine$double.xmin,
add_column = TRUE,
rank = FALSE
)A data.frame-like object containing differential expression results.
Character. Column containing log2 fold change. If the default is absent, common alternatives are detected automatically.
Character. Column containing p-values. If the default is absent, common alternatives are detected automatically.
Logical. If TRUE, preserve the direction of the log fold
change. If FALSE, use the unsigned Xiao et al. definition.
Numeric. Minimum p-value used before applying
-log10(p), avoiding infinite scores when p-values are zero.
Logical. If TRUE, append pi_score to de_results.
If FALSE, return a numeric vector.
Logical. If TRUE and add_column = TRUE, append pi_rank
where rank 1 is the largest pi-score.
If add_column = TRUE, a data.frame with pi_score and optionally
pi_rank appended. Otherwise, a numeric vector aligned to the input rows.
Xiao Y, Hsiao T-H, Suresh U, et al. (2014) A novel significance score for gene selection and ranking. Bioinformatics 30(6):801-807. doi:10.1093/bioinformatics/btr671
de <- data.frame(gene = c("g1", "g2", "g3"), avg_log2FC = c(2, -1, 0.5),
p_val_adj = c(1e-10, 0.01, 0.5))
piScore(de, rank = TRUE)