Description Usage Arguments Value Examples
The purpose of this function is to evaluate the power and estimated sample size across all CpG probes present in a beta-value or M-value matrix. The calculation of power and sample size estimation are based on the t-test functions of the pwr package and can only be performed between features that have two levels, e.g., primary PanNET versus metastasis. PowerCalc works for normal two-group designs or paired designs. The core functions used in powerCalc are from the pwr package created by Stephane Champely (aut), Claus Ekstrom (ctb), Peter Dalgaard (ctb), Jeffrey Gill (ctb), Stephan Weibelzahl (ctb), Aditya Anandkumar (ctb), Clay Ford (ctb), Robert Volcic (ctb), and Helios De Rosario cre. pwr is licensed under GPL (>= 3).
1 2 3 4 5 6 7 8 9 10 11 12 |
betaMatrix |
A matrix of beta-values where the rows are the CpG probes and the columns are the samples. |
pdGroups |
A minfi- or ChAMP-type sample sheet with group information, e.g. pd\$Sample\_Group. |
nameGroups |
Name of the groups, e.g. c("Met", "Primary"). |
alpha |
Desired alpha-significance level. |
power |
Desired power. |
cutOff |
The power and sample size estimation is omitted if the effect size (Cohen's D) of a probe is less than the desired cutoff. Use this with caution as information about many CpG probes will be lost. |
type |
Can be "paired" or "limma". Any other string will lead to the standard two.sample t-test procedure of pwr. |
limmaFit |
A LIMMA LMfit object with one contrast can be added to calculate the effect size based on the posterior values for the residual variances obtained from the empirical Bayes procedure. |
pairs |
Pair information of sample sheet, e.g. pd\$Pairs. |
M |
Convert beta-values to M-values. |
A data.frame containing CpG probe-wise power, estimated sample size, and Cohen's D. Depending on the type other information are included (e.g. mean and SD of the difference between 2 groups when type = "paired).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | A <- data.frame(runif(1000,0.5,1),runif(1000,0.4,0.8),runif(1000,0.6,0.99),
runif(1000,0.1,0.5),runif(1000,0.2,0.6),runif(1000,0,0.4))
colnames(A) <- rep(paste("Sample_",1:6,sep=""))
pd <- data.frame(c(rep("Group_1",3),rep("Group_2",3)))
colnames(pd) <- "Groups"
A <- as.matrix(A)
powerCalc(betaMatrix = A,
type = "unpaired",
pdGroups = pd$Groups,
nameGroups = c("Group_1","Group_2"),
M = TRUE,
cutOff = 0.1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.