Search
Question: Saving output from glmTreat to a csv file?
0
gravatar for mictadlo
8 weeks ago by
mictadlo0
mictadlo0 wrote:

Hi,

How is it possible save the output from glmTreat to a csv file?

> tr <- glmTreat(fit, contrast=B.LvsP, lfc=log2(1.5))
> topTags(tr)
Coefficient:  -1Leaves.2 1Leaves.3

          logFC unshrunk.logFC logCPM  PValue     FDR
sp0090975   2.6            2.6    2.8 5.7e-14 2.7e-09
sp0037632  -3.0           -3.0    3.4 1.7e-13 2.7e-09
sp0074153  -3.9           -3.9    3.8 1.8e-13 2.7e-09
sp0008306   3.2            3.2    2.9 1.8e-13 2.7e-09
sp0073530  -4.5           -4.5    3.4 2.3e-12 2.3e-08
sp0025713  -3.9           -3.9    4.4 2.6e-12 2.3e-08
sp0037721   7.8            8.0    2.4 2.7e-12 2.3e-08
sp0083660   2.0            2.0    4.4 3.2e-12 2.3e-08
sp0052245  -2.9           -2.9    4.9 3.9e-12 2.6e-08
sp0071520  -3.3           -3.3    2.7 5.8e-12 3.4e-08

Thank you in advance.

ADD COMMENTlink modified 8 weeks ago by Aaron Lun17k • written 8 weeks ago by mictadlo0
3
gravatar for Aaron Lun
8 weeks ago by
Aaron Lun17k
Cambridge, United Kingdom
Aaron Lun17k wrote:

Try using the write.csv function.

library(edgeR)
example(glmTreat)
res <- topTags(tr, n=Inf)
write.csv(file="output.csv", res$table)
ADD COMMENTlink modified 8 weeks ago by Gordon Smyth32k • written 8 weeks ago by Aaron Lun17k

By any chance, do you know how it would be possible to create an R named vector where the names are genes and the values are p-values from `tr` without save `tr` to a file?

ADD REPLYlink written 8 weeks ago by mictadlo0

Use names<- or setNames on res$table$PValue.

ADD REPLYlink written 8 weeks ago by Aaron Lun17k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 186 users visited in the last hour