powerCalc | R Documentation |
This function takes the required input information such as count data, sample data, etc. to calculate the power. It filters the input count data, performs DESeq2 analysis to calculate differentially expressed genes (DEGs), and then calculates the power of detecting these DEGs based on simulations.
powerCalc(
countDat,
smplDat,
alpha = 0.05,
thrsholdFC = 2,
inptNoOfReplicates = 3,
sims = 10
)
countDat |
A matrix or data frame of raw count data where rows represent genes and columns represent samples. |
smplDat |
A data frame of sample information, with at least a |
alpha |
The significance level (FDR threshold) used to identify differentially expressed genes. Default is 0.05. |
thrsholdFC |
The threshold for the absolute value of log2 fold change used to filter DEGs. Default is 2. |
inptNoOfReplicates |
The input number of replicates based on which the power will be calculated. Default is 3. |
sims |
The number of simulations to run for power calculation. Default is 10. |
Example files included with this package:
exmplCountDat.csv
: A toy dataset with count data.
exmplSampleDat.csv
: A sample dataset with metadata.
These files are stored in the inst/extdata
directory and can be accessed
using the system.file()
function in R.
A data frame containing the calculated power values and related parameters.
Bi et al. (2016) \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1186/s12859-016-0994-9")} Love et al. (2014) \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1186/s13059-014-0550-8")}
# Load example files
countDatPath <- system.file("extdata", "exmplCountDat.csv", package = "HEssRNA")
smplDatPath <- system.file("extdata", "exmplSampleDat.csv", package = "HEssRNA")
if (file.exists(countDatPath) && file.exists(smplDatPath)) {
countDat <- read.csv(countDatPath)
smplDat <- read.csv(smplDatPath)
result <- powerCalc(countDat, smplDat)
print(result$PowerResults)
} else {
warning("Example data files not found.")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.