View source: R/Seurat.Utils.Visualization.R
countEnrichedDepletedGenes | R Documentation |
This function counts the number of significantly enriched and depleted genes based on the provided criteria. It filters the genes based on adjusted p-value and logarithm of fold change.
countEnrichedDepletedGenes(
df,
min_padj = 0.01,
min_logFC = 0.5,
colname.p = "p_val_adj",
colname.lFC = "avg_log2FC"
)
df |
A dataframe containing the result of the differential gene expression analysis. |
min_padj |
A numeric value specifying the minimum adjusted p-value. Default: 0.01. |
min_logFC |
A numeric value specifying the minimum logarithm to fold change. Default: 0.5. This value should be positive and will be used as a negative value for depleted genes. |
colname.p |
A string specifying the column name for the adjusted p-value in the dataframe. Default: 'p_val_adj'. |
colname.lFC |
A string specifying the column name for the logarithm to fold change in the dataframe. Default: 'avg_log2FC'. |
A list of two elements:
GeneCounts |
A named numeric vector containing the numbers of enriched and depleted genes. |
Parameters |
A named numeric vector containing the parameter names and their values. |
df <- data.frame(
p_val = c(5.580902e-14, 4.607790e-12, 1.643436e-11),
avg_log2FC = c(0.4985875, 0.4983416, 0.4977825),
pct.1 = c(0.429, 0.575, 0.387),
pct.2 = c(0.251, 0.396, 0.232),
p_val_adj = c(1.091513e-09, 9.011916e-08, 3.214233e-07)
)
result <- countEnrichedDepletedGenes(df)
print(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.