Skip to main content
Topic: How do I perform multiple testing correction in xcms? (Read 6782 times) previous topic - next topic

How do I perform multiple testing correction in xcms?

One of the great things about xcms is since it's in R this is very easy to do. Multiple testing correction gives you a corrected pvalue due to the fact that you have performed multiple univariate tests. However, you will see that while your false discovery rate decreases, you will also sacrifice a few real results. There are many papers about the problems associated with multiple testing correction and many new algorithms to make the situation better (see links below). But you asked the question, so here's the answer!
Code: [Select]
require(multtest)
library(xcms)
library(faahKO)
gxs<-group(faahko)
ret<-retcor(gxs, p="m", f="s")
gret<-group(ret)
fill<-fillPeaks(gret)
diff<-diffreport(fill, "KO", "WT")
First we need the diffreport, so I'll generate one using the default dataset. If you have already saved your datasets then you can read it back in using read.tsv
Now we'll see how the pvalue adjustment function works:
Code: [Select]
colnames(diff)
crpval<-mt.rawp2adjp(diff[,"pvalue"], proc="Bonf") ## I'll go with the default adjustment
idx<-sort(crpval$index, index.return=TRUE)
AdjPval<-crpval$adjp[idx$ix,2]
diff<-cbind(diff[,1:4], AdjustedPval=AdjPval, diff[,5:ncol(diff)])

write.csv(diff, file="NewDiffreport.csv")


Here are some links to explain why correction is needed, what it is and problems associated with it.
http://en.wikipedia.org/wiki/Bonferroni_correction
http://rss.acs.unt.edu/Rdoc/library/mul ... 2adjp.html - This is the R page for the function we are using.
http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1112991/
http://www.google.co.uk/search?client=s ... 76&bih=877
~~
H. Paul Benton
Scripps Research Institute
If you have an error with XCMS Online please send me the JOBID and submit an error via the XCMS Online contact page