Search
Question: adding a description column to glmTreat output
0
gravatar for mictadlo
17 days ago by
mictadlo0
mictadlo0 wrote:

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.

ADD COMMENTlink modified 17 days ago by Aaron Lun16k • written 17 days ago by mictadlo0
2
gravatar for Aaron Lun
17 days ago by
Aaron Lun16k
Cambridge, United Kingdom
Aaron Lun16k wrote:

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 COMMENTlink written 17 days ago by Aaron Lun16k

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 REPLYlink modified 17 days ago • written 17 days ago by mictadlo0

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 REPLYlink written 17 days ago by Aaron Lun16k
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: 191 users visited in the last hour