how to generate a data frame containing all the coefficients of the different contrasts, the p-value and the adjusted p-value ?
2
0
Entering edit mode
Benoit ▴ 70
@benoit-3594
Last seen 9.6 years ago
Hi to all, I have a microarray experiment with 10 different contrasts and I would like to generate a dataframe containing all the informations exported with the function toptable for all the the genes (no restrictions on p-value and logFC but with BH adjustment). For 1 specific contrast I proceed like that : res=toptable(coef=1,number=15120,fit=fit2,genelist=Ebgnorm$genes[isGen e,],adjust.method="BH",A=fit2$Amean,eb=fit2) res.summary=data.frame(res$ProbeUID,res$ProbeName,res$GeneName,res$Des cription,res$P.Value,res$adj.P.Val,res$logFC,exp(res$logFC*log(2))) and after I add to this dataframe the normalized log intensities and weights: lg=data.frame(Ebgnorm$genes$ProbeUID[isGene],Ebgnorm$genes$ProbeName[i sGene],Ebgnorm$E[isGene,],Ebgnorm$weights[isGene,]) res2=res.summary[order(res.summary$ProbeUID),] lg2=lg[order(lg$ProbeUID),] res2=cbind(res2,lg2[,3:18]) write.table(res2,file="result_Weights_and_Intensities.txt",sep="\t",qu ote=FALSE,col.names=TRUE,row.names=FALSE) It works very well for one contrast but now, I would like to do that for all the contrasts at the same time. I tried the functions write.fit and topTableF but, with the first one I cannot have the adjusted p-values and for the second one, there is only one column of adjusted p-value (with method="separate" and "global") and not one for each contrast. So, is there any other function to solve my problem or will I have to perform the exportation of all contrasts one by one and then concatenate them ? Thank in advance for your help. Benoit -- Benoit Loup, PhD UMR Biologie du D?veloppement et Reproduction Diff?renciation des Gonades et Perturbations INRA ? Domaine de Vilvert B?timent Jacques Poly 78350 Jouy en Josas France Tel: 33 1 34 65 25 38 Fax: 33 1 34 65 22 41 E-mail: benoit.loup at jouy.inra.fr
Microarray Microarray • 1.7k views
ADD COMMENT
0
Entering edit mode
@jdelasherasedacuk-1189
Last seen 8.7 years ago
United Kingdom
Quoting Benoit Loup <benoit.loup at="" jouy.inra.fr="">: > Hi to all, > > I have a microarray experiment with 10 different contrasts and I would > like to generate a dataframe containing all the informations exported > with the function toptable for all the the genes (no restrictions on > p-value and logFC but with BH adjustment). > > For 1 specific contrast I proceed like that : > res=toptable(coef=1,number=15120,fit=fit2,genelist=Ebgnorm$genes[isG ene,],adjust.method="BH",A=fit2$Amean,eb=fit2) > res.summary=data.frame(res$ProbeUID,res$ProbeName,res$GeneName,res$D escription,res$P.Value,res$adj.P.Val,res$logFC,exp(res$logFC*log(2))) > > and after I add to this dataframe the normalized log intensities and weights: > lg=data.frame(Ebgnorm$genes$ProbeUID[isGene],Ebgnorm$genes$ProbeName [isGene],Ebgnorm$E[isGene,],Ebgnorm$weights[isGene,]) > res2=res.summary[order(res.summary$ProbeUID),] > lg2=lg[order(lg$ProbeUID),] > res2=cbind(res2,lg2[,3:18]) > write.table(res2,file="result_Weights_and_Intensities.txt",sep="\t", quote=FALSE,col.names=TRUE,row.names=FALSE) > > It works very well for one contrast but now, I would like to do that > for all the contrasts at the same time. > I tried the functions write.fit and topTableF but, with the first one I > cannot have the adjusted p-values and for the second one, there is only > one column of adjusted p-value (with method="separate" and "global") > and not one for each contrast. > > So, is there any other function to solve my problem or will I have to > perform the exportation of all contrasts one by one and then > concatenate them ? > > Thank in advance for your help. > > Benoit Hi Benoit, I normally create a list with each individual contrast information (the result of 'topTable', not-ordered, so all probesets in teh same order) as a separate component. I like 'topTable' because it gives me all the info I want. Then I merely compile a large table by combining the columns containing first the annotation info, and then the different contrasts data (I normally just export the log2 ratios and adjusted p values at this stage). By putting them in a list you can automate the big table generation no matter how many contrasts you have. It may not be the most elegant form, but that's what I do. Jose -- Dr. Jose I. de las Heras Email: J.delasHeras at ed.ac.uk The Wellcome Trust Centre for Cell Biology Phone: +44 (0)131 6507095 Institute for Cell & Molecular Biology Fax: +44 (0)131 6507360 Swann Building, Mayfield Road University of Edinburgh Edinburgh EH9 3JR UK ********************************************* Alternative email: nach.mcnach at gmail.com ********************************************* -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
ADD COMMENT
0
Entering edit mode
J.delasHeras at ed.ac.uk a ?crit : > Quoting Benoit Loup <benoit.loup at="" jouy.inra.fr="">: > >> Hi to all, >> >> I have a microarray experiment with 10 different contrasts and I would >> like to generate a dataframe containing all the informations exported >> with the function toptable for all the the genes (no restrictions on >> p-value and logFC but with BH adjustment). >> >> For 1 specific contrast I proceed like that : >> res=toptable(coef=1,number=15120,fit=fit2,genelist=Ebgnorm$genes[is Gene,],adjust.method="BH",A=fit2$Amean,eb=fit2) >> >> res.summary=data.frame(res$ProbeUID,res$ProbeName,res$GeneName,res$ Description,res$P.Value,res$adj.P.Val,res$logFC,exp(res$logFC*log(2))) >> >> >> and after I add to this dataframe the normalized log intensities and >> weights: >> lg=data.frame(Ebgnorm$genes$ProbeUID[isGene],Ebgnorm$genes$ProbeNam e[isGene],Ebgnorm$E[isGene,],Ebgnorm$weights[isGene,]) >> >> res2=res.summary[order(res.summary$ProbeUID),] >> lg2=lg[order(lg$ProbeUID),] >> res2=cbind(res2,lg2[,3:18]) >> write.table(res2,file="result_Weights_and_Intensities.txt",sep="\t" ,quote=FALSE,col.names=TRUE,row.names=FALSE) >> >> >> It works very well for one contrast but now, I would like to do that >> for all the contrasts at the same time. >> I tried the functions write.fit and topTableF but, with the first one I >> cannot have the adjusted p-values and for the second one, there is only >> one column of adjusted p-value (with method="separate" and "global") >> and not one for each contrast. >> >> So, is there any other function to solve my problem or will I have to >> perform the exportation of all contrasts one by one and then >> concatenate them ? >> >> Thank in advance for your help. >> >> Benoit > > Hi Benoit, > > I normally create a list with each individual contrast information > (the result of 'topTable', not-ordered, so all probesets in teh same > order) as a separate component. I like 'topTable' because it gives me > all the info I want. Then I merely compile a large table by combining > the columns containing first the annotation info, and then the > different contrasts data (I normally just export the log2 ratios and > adjusted p values at this stage). > By putting them in a list you can automate the big table generation no > matter how many contrasts you have. > It may not be the most elegant form, but that's what I do. > > Jose > > Thanks a lot Jose, I finally proceeded as you described it, exporting all the contrasts one by one and compiling them after in one file. Benoit -- Benoit Loup, PhD UMR Biologie du D?veloppement et Reproduction Diff?renciation des Gonades et Perturbations INRA ? Domaine de Vilvert B?timent Jacques Poly 78350 Jouy en Josas France Tel: 33 1 34 65 25 38 Fax: 33 1 34 65 22 41 E-mail: benoit.loup at jouy.inra.fr
ADD REPLY
0
Entering edit mode
@saroj-k-mohapatra-3419
Last seen 9.6 years ago
Hi Benoit: > I tried the functions write.fit and topTableF but, with the first one > I cannot have the adjusted p-values ?write.fit ... Usage: write.fit(fit, results=NULL, file, digits=3, adjust="none", method="separate", F.adjust="none", sep="\t", ...) ... adjust: character string specifying multiple-testing adjustment method for the t-statistic P-values, e.g., ?"BH"?. See ?p.adjust? for the available options. If ?NULL? or ?"none"? then the P-values are not adjusted. It seems if you change the adjust parameter from "none", you should be able to get what you want. Best, Saroj > and for the second one, there is only one column of adjusted p-value > (with method="separate" and "global") and not one for each contrast. > > So, is there any other function to solve my problem or will I have to > perform the exportation of all contrasts one by one and then > concatenate them ? > > Thank in advance for your help. > > Benoit >
ADD COMMENT
0
Entering edit mode
Saroj K Mohapatra a ?crit : > Hi Benoit: > >> I tried the functions write.fit and topTableF but, with the first one >> I cannot have the adjusted p-values > > ?write.fit > ... > Usage: > write.fit(fit, results=NULL, file, digits=3, adjust="none", > method="separate", > F.adjust="none", sep="\t", ...) > ... > adjust: character string specifying multiple-testing adjustment > method for the t-statistic P-values, e.g., ?"BH"?. See > ?p.adjust? for the available options. If ?NULL? or ?"none"? > then the P-values are not adjusted. > > It seems if you change the adjust parameter from "none", you should be > able to get what you want. > > Best, > > Saroj > > >> and for the second one, there is only one column of adjusted p-value >> (with method="separate" and "global") and not one for each contrast. >> >> So, is there any other function to solve my problem or will I have to >> perform the exportation of all contrasts one by one and then >> concatenate them ? >> >> Thank in advance for your help. >> >> Benoit >> > Hi Saroj, When I tried the function "write.fit", I specified adjust="BH" and method="separate" but when I opened my file I did not see any "adjust p.value" column header but "t.statsitic". In fact, I did not well see and I was wrong... I apologise for this mistake. Thanks a lot. Best regards. Benoit -- Benoit Loup, PhD UMR Biologie du D?veloppement et Reproduction Diff?renciation des Gonades et Perturbations INRA ? Domaine de Vilvert B?timent Jacques Poly 78350 Jouy en Josas France Tel: 33 1 34 65 25 38 Fax: 33 1 34 65 22 41 E-mail: benoit.loup at jouy.inra.fr
ADD REPLY

Login before adding your answer.

Traffic: 839 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