[BioC] How to save result from limma
Wang, Jixin
jixinwang at neo.tamu.edu
Tue Aug 12 23:42:42 CEST 2008
Hi Jenny and Jim,
Thanks for the help.
I have another question. In the output result of topTable, column labeled logFC is the log base 2 of fold change value instead of e. I want to make sure that.
Many thanks,
Jixin
----- Original Message -----
From: "Jenny Drnevich" <drnevich at illinois.edu>
To: "James W. MacDonald" <jmacdon at med.umich.edu>, "Gordon K Smyth" <smyth at wehi.EDU.AU>
Cc: "Jixin Wang" <jixinwang at neo.tamu.edu>, bioconductor at stat.math.ethz.ch
Sent: Tuesday, August 12, 2008 3:16:14 PM GMT -06:00 US/Canada Central
Subject: Re: [BioC] How to save result from limma
Yeah, now I remember that being in the help page
for topTable(). However, I'm not sure why it's
not the "right" function. Assuming all the
arguments are equivalent, the values are the same
as those output from write.fit(). I like
topTable() better because it gives you both the
raw p-values and the adjusted P-values. Maybe
it's wrong function because it will give you the
genes in different orders for each coefficient? I
prefer it to write.fit so I can work with the
values in R without having to read the output
file back in! However, I do have to re-sort it if
I want to use with other objects I've created.
I've always wanted a resort.by option of "gene"
that would do my resorting automatically:
> allgenes <- topTable(fit,number=nrow(fit))
> allgenes <- allgenes[order(as.numeric(rownames(allgenes))),]
Any chance of you adding that in the future,
Gordon? If not, maybe you can expand upon why
topTable is not the "right" function.
Thanks!
Jenny
At 02:47 PM 8/12/2008, James W. MacDonald wrote:
>Actually, write.fit() is what you are looking for. From ?topTable:
>
>Note:
>
> This is not the right function to use to create summary statistics
> for all the probes on an array. Please consider using 'write.fit'
> or 'write' for this purpose, rather than using 'topTable' with
> 'number=nrow(fit)'.
>
>;-P
>
>Jenny Drnevich wrote:
>>Hi Jixin,
>>You're mixing up the functions topTable() and
>>write.table() and their arguments. Try this:
>> > allgenes <- topTable(fit, number= nrow(fit), adjust="BH")
>> > write.table( allgenes, file= "la.txt")
>>HTH,
>>Jenny
>>At 01:58 PM 8/12/2008, Wang, Jixin wrote:
>>>Dear all, I am using limma to analyze my
>>>microarray data. I have a simple question to
>>>ask. I want to save the summary table of ALL
>>>genes into local drive. I had tried to use
>>>write, write.table or save command but I
>>>always got error message.
>>>write.table(topTable, "la.txt") Error in
>>>as.data.frame.default(x[[i]], optional = TRUE) :
>>>Cannot coerce class "function" into a
>>>data.frame
>>>write.table(fit,number=100,adjust="BH",file="la.txt")
>>>Error in write.table(fit, number = 100, adjust = "BH", file = "la.txt") :
>>>unused argument(s) (number = 100, adjust =
>>>"BH") When I use write.table (fit,
>>>file="la.txt"), I got something like this:
>>>"coefficients" "stdev.unscaled" "sigma"
>>>"df.residual" "genes.Block" "genes.Row"
>>>"genes.Column" "genes.ID" "genes.Name" "Amean"
>>>"s2.post" "t" "p.value" "lods" "F" "F.p.value"
>>>"1" 0.191491534183039 0.5 0.58043881130755 3 1
>>>1 1 5103 NA 6.32074826791933 0.303968848417341
>>>0.694648392759644 0.509374409393106
>>>-4.86326047572600 0.482536389563556
>>>0.509374409393106 "2" -0.293787384283484 0.5
>>>1.20366297838960 3 1 1 2 5124 NA
>>>8.24502874291735 0.774060196679415
>>>-0.667845140479293 0.525351390376272
>>>-4.87400797979679 0.446017131661806
>>>0.525351390376272 "3" -0.513890138933438 0.5
>>>0.298947585330255 3 1 1 3 5145 NA
>>>6.24632903576038 0.199313133368442
>>>-2.30214313044810 0.0543270719852833
>>>-3.89174526089124 5.29986299306939
>>>0.0543270719852833 "4" -0.192900665446982 0.5
>>>0.202699077289498 3 1 1 4 5166 NA
>>>5.4719589146908 0.178899971606802
>>>-0.912133876540687 0.391633127283331
>>>-4.76408991981505 0.831988208733142
>>>0.391633127283331 "5" -0.519787414790754 0.5
>>>0.971899999883875 3 1 1 5 5187 NA
>>>4.79242047112468 0.560886278852435
>>>-1.38809230856769 0.207129224092528
>>>-4.49088947369315 1.92680025710479
>>>0.207129224092528………………….…………. What I
>>>want is same as below (contain logFC, P Value and adj.P.Val) of ALL genes,
>>>options(digits=3)
>>>topTable(fit,number=100,adjust="BH") Block
>>>Row Column ID Name logFC
>>>AveExpr t P.Value adj.P.Val B
>>>20830 46 2 18 5921 NA 3.22 8.42 15.76 8.78e-07
>>>0.0195 -1.78 5073 11 21 13
>>>15499 NA 3.09 11.56 12.58
>>>4.15e-06 0.0460 -1.86 6457 14 21 11 9451 NA 2.93
>>>10.48 10.88 1.11e-05 0.0617 -1.93 4193 10 2 13 9974
>>>NA 2.69 10.25 10.87 1.11e-05 0.0617 -1.93 292 1 14
>>>6 5195 NA 2.22 9.67 10.35 1.55e-05 0.0689 -1.95 12237 27
>>>11 5 13493 NA 3.80 8.45 9.17
>>>3.46e-05 0.1145 -2.03
>>>15180 33 18 22 1831 NA 4.62 9.16 9.11 3.61e-05
>>>0.1145 -2.03 ………………… ¦â€¦â€¦â€¦ Many thanks,
>>>Jixin
>>>_______________________________________________
>>> Bioconductor mailing list
>>>Bioconductor at stat.math.ethz.ch
>>>https://stat.ethz.ch/mailman/listinfo/bioconductor
>>>Search the archives:
>>>http://news.gmane.org/gmane.science.biology.informatics.conductor
>>_______________________________________________
>>Bioconductor mailing list
>>Bioconductor at stat.math.ethz.ch
>>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
>Hildebrandt Lab
>8220D MSRB III
>1150 W. Medical Center Drive
>Ann Arbor MI 48109-0646
>734-936-8662
Jenny Drnevich, Ph.D.
Functional Genomics Bioinformatics Specialist
W.M. Keck Center for Comparative and Functional Genomics
Roy J. Carver Biotechnology Center
University of Illinois, Urbana-Champaign
330 ERML
1201 W. Gregory Dr.
Urbana, IL 61801
USA
ph: 217-244-7355
fax: 217-265-5066
e-mail: drnevich at illinois.edu
More information about the Bioconductor
mailing list