adding a description column to glmTreat output
1
0
Entering edit mode
mictadlo ▴ 10
@mictadlo-10885
Last seen 4.2 years ago

Hi, Below is my current code:

y <- DGEList(counts=rawCountTable, group=group, genes = rownames(rawCountTable))

> head(y$samples)
                        group lib.size norm.factors
X1916.MJO.0001_1 Root_tip.1.5 33986982    0.9543329
X1916.MJO.0002_1 Root_tip.1.5 31781171    0.8787148
X1916.MJO.0003_1 Root_tip.1.5 33947433    0.9948679
X1916.MJO.0004_1 Root_tip.1.5 32704401    1.0003440
X1916.MJO.0005_1   Leaves.1.5 34431708    1.0161298
X1916.MJO.0006_1   Leaves.1.5 33036095    1.0005296

> head(y$genes)
       genes
3  sp0025247
4  sp0025250
5  sp0025268
6  sp0025270
8  sp0025282
12 sp0056834
head(gene.description)
sp0090975    MutS family domain IV2.624413
sp0037632    Magnesium transporter NIPA

How would it be possible to add gene.description column to the below table:

> res <- glmQLFTest(fit, contrast=B.LvsP)
> topTags(res)
Coefficient:  -1*Leaves.2 1*Leaves.3 
          genes     logFC   logCPM        F       PValue          FDR
56010 sp0090975  2.624413 2.847831 374.1120 3.836919e-15 2.262670e-10
73438 sp0037632 -2.984799 3.394748 317.2377 2.065153e-14 5.172707e-10

in order to recieve the following table:

tr <- glmTreat(fit, contrast=B.LvsP, coef = 2, lfc=log2(1.5))
topTags(tr)
Coefficient:  -1*Leaves.2 1*Leaves.3 
          genes    description     logFC   logCPM        F       PValue          FDR
56010 sp0090975    MutS family domain IV2.624413    2.847831 374.1120 3.836919e-15 2.262670e-10
73438 sp0037632    Magnesium transporter NIPA    -2.984799 3.394748 317.2377 2.065153e-14 5.172707e-10

Thank you in advance.

edger • 873 views
ADD COMMENT
2
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 2 hours ago
The city by the bay

Just assign gene.description to y$genes at the start of the edgeR analysis (assuming the order of genes/rows is the same between gene.description and rawCountTable, otherwise you will have to reorder the former to match).

ADD COMMENT
0
Entering edit mode

Will I lose the gene name column by assign gene.description to y$genes if yes then is there a way to keep both?

ADD REPLY
0
Entering edit mode

Whatever is in y$genes will get cbind'ed to the front of the topTags output. So if you want an extra column of gene names, just add it to y$genes at the beginning our your analysis.

ADD REPLY

Login before adding your answer.

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