R/gene_selection.R
SelectSignificantGenes.RdFor each column (eigenvector) of a gene-by-eigenvector matrix, z-transforms
the loadings (using median/MAD for robustness) and applies locfdr to
identify significantly loaded genes. Returns a binary indicator matrix.
SelectSignificantGenes(V, lfdr_thresh = 0.2, min_genes = 3, max_genes = 50)A numeric matrix with genes as rows and eigenvectors as columns. Row names should be gene names.
Numeric. Local FDR threshold for significance. Default
is 0.2. Automatically capped at the empirical FDR of the first bin.
Integer. Minimum number of significant genes required in
a direction (positive or negative) to retain them. Default is 3.
Integer. Maximum number of significant genes to keep per
direction per eigenvector. Default is 50.
A binary matrix of the same dimensions as V (genes × eigenvectors),
where 1 indicates the gene is significantly loaded on that eigenvector.
if (FALSE) {
gene_indicator <- SelectSignificantGenes(V, lfdr_thresh = 0.2)
}