powerAnalyst: Power Analysis

View source: R/powerAnalysis.R

powerAnalystR Documentation

Power Analysis

Description

Power Analysis

Usage

powerAnalyst(para, group, valueID = "value", log = TRUE,
  maxInd = 1000, fdr = 0.1, showPlot = FALSE)

Arguments

para

An metaXpara object

group

A vector of sample names

valueID

The column name used

log

A logical indicating whether transform the data with log2

maxInd

max sample number

fdr

The FDR threshold

showPlot

Whether or not to print the figure to screen

Value

An value

Author(s)

Bo Wen wenbostar@gmail.com

Examples

## Not run:  
library(reshape2)
library(dplyr)
a <- read.csv("http://www.metaboanalyst.ca/MetaboAnalyst/resources/data/power_example.csv")
peaksData <- melt(a,id.vars = c("Diet","Sample"),
    value.name = "value",variable.name = "ID")
peaksData <- dplyr::rename(peaksData,class=Diet,sample=Sample)
para <- new("metaXpara")
peaksData(para) <- peaksData
para <- missingValueImpute(para)
para <- metaX::normalize(para)
para <- transformation(para,valueID = "value")
para <- preProcess(para,scale = "pareto",valueID="value")
powerAnalyst(para,group=c("case","control"),log=FALSE,maxInd=200)

## End(Not run)

wenbostar/metaX documentation built on July 4, 2023, 7:50 p.m.