[BioC} Multiple testing correction
2
0
Entering edit mode
Lucia Peixoto ▴ 330
@lucia-peixoto-4203
Last seen 9.7 years ago
Hi I was having some issues with the p-values of differential expression of my samples using SAM, so I to compare with more traditional multiple testing approaches I thought I will just do a ttest and then use p.adjust to get BH corrected pvalues My input is just a two column textfile where the first column is the Affy probe IDs and the second is the ttest pvalue All I get out is the same p-values I put in, since I am a pretty naive R programmer I am sure there is something simple I am doing wrong help will be greatly appreciated, thanks!! here is my script: Data<-read.table("input", header=TRUE, row.names=1) p.adj <- p.adjust(Data, method = "BH", n= length (Data)) write.table(p.adj, file="output", sep="\t") My output is identical to my input [[alternative HTML version deleted]]
• 1.2k views
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 11 days ago
United States
On 01/07/2011 11:52 AM, Lucia Peixoto wrote: > Hi > > I was having some issues with the p-values of differential expression of my > samples using SAM, so I to compare with more traditional multiple testing > approaches > I thought I will just do a ttest and then use p.adjust to get BH corrected > pvalues > My input is just a two column textfile where the first column is the Affy > probe IDs and the second is the ttest pvalue > All I get out is the same p-values I put in, since I am a pretty naive R > programmer I am sure there is something simple I am doing wrong > > help will be greatly appreciated, thanks!! > > here is my script: > > Data<-read.table("input", header=TRUE, row.names=1) > p.adj <- p.adjust(Data, method = "BH", n= length (Data)) Hi Lucia -- > df = data.frame(x=1:5) > dim(df) [1] 5 1 > length(df) [1] 1 A data frame is treated as a list of columns, so length(df) is the number of columns; you probably want nrow(Data) (or nothing, and p.adjust will do the right thing). Martin > write.table(p.adj, file="output", sep="\t") > > My output is identical to my input > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- Computational Biology Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: M1-B861 Telephone: 206 667-2793
ADD COMMENT
0
Entering edit mode
Thanks for the help I fixed it the problem was that I was not selecting the right column at all! how silly of me so this fixes it: p<-Data[,c('pval')] p.adj <- p.adjust(p, method = "fdr", n= length(p)) write.table(p.adj, file="filename", sep="\t") I am using multtest now in any case thanks again Lucia On Fri, Jan 7, 2011 at 3:55 PM, Martin Morgan <mtmorgan@fhcrc.org> wrote: > On 01/07/2011 11:52 AM, Lucia Peixoto wrote: > > Hi > > > > I was having some issues with the p-values of differential expression of > my > > samples using SAM, so I to compare with more traditional multiple testing > > approaches > > I thought I will just do a ttest and then use p.adjust to get BH > corrected > > pvalues > > My input is just a two column textfile where the first column is the Affy > > probe IDs and the second is the ttest pvalue > > All I get out is the same p-values I put in, since I am a pretty naive R > > programmer I am sure there is something simple I am doing wrong > > > > help will be greatly appreciated, thanks!! > > > > here is my script: > > > > Data<-read.table("input", header=TRUE, row.names=1) > > p.adj <- p.adjust(Data, method = "BH", n= length (Data)) > > Hi Lucia -- > > > df = data.frame(x=1:5) > > dim(df) > [1] 5 1 > > length(df) > [1] 1 > > A data frame is treated as a list of columns, so length(df) is the > number of columns; you probably want nrow(Data) (or nothing, and > p.adjust will do the right thing). > > Martin > > > > write.table(p.adj, file="output", sep="\t") > > > > My output is identical to my input > > > > [[alternative HTML version deleted]] > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor@r-project.org > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > > > -- > Computational Biology > Fred Hutchinson Cancer Research Center > 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 > > Location: M1-B861 > Telephone: 206 667-2793 > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
@james-w-macdonald-5106
Last seen 1 hour ago
United States
Hi Lucia, On 1/7/2011 2:52 PM, Lucia Peixoto wrote: > Hi > > I was having some issues with the p-values of differential expression of my > samples using SAM, so I to compare with more traditional multiple testing > approaches > I thought I will just do a ttest and then use p.adjust to get BH corrected > pvalues > My input is just a two column textfile where the first column is the Affy > probe IDs and the second is the ttest pvalue > All I get out is the same p-values I put in, since I am a pretty naive R > programmer I am sure there is something simple I am doing wrong > > help will be greatly appreciated, thanks!! > > here is my script: > > Data<-read.table("input", header=TRUE, row.names=1) > p.adj<- p.adjust(Data, method = "BH", n= length (Data)) > write.table(p.adj, file="output", sep="\t") From ?p.adjust Usage: p.adjust(p, method = p.adjust.methods, n = length(p)) p.adjust.methods # c("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", # "fdr", "none") Arguments: p: vector of p-values (possibly with 'NA's). You are passing in a data.frame where the second column contains the p-values, and expecting R to figure that out. Which it won't be able to do. Try Data[,2] <- p.adjust(Data[,2]) write.table(Data, "output", sep = "\t") Best, Jim > > My output is identical to my input > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- James W. MacDonald, M.S. Biostatistician Douglas Lab University of Michigan Department of Human Genetics 5912 Buhl 1241 E. Catherine St. Ann Arbor MI 48109-5618 734-615-7826 ********************************************************** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues
ADD COMMENT

Login before adding your answer.

Traffic: 681 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6