code for up-down-regulated Degs using R
2
0
Entering edit mode
nia ▴ 30
@nia-12707
Last seen 5.0 years ago

Firstly i do data normalization then i used limma for differential expression ,   list of top 10 up and top 10 down regulated degs were retrieved by using R on linux suse but the desired coloumn names of top 10 up and down regulated degs are : GeneID, Gene symbol, pvalue, FDR) how can i retrieve this by using R code kindly help me out.

library(limma)
plotPCA(eset.rma, groups =as.numeric(pData(d1)[,1]),groupnames =levels(pData(d1)[,1]))
pData(d1)[,1 ]
group<- factor r(pData(d1)[,1 ]a(d1)[,1])), levels =levels(pData(d1)[,1]))
 fit1 <-lmFit(eset.rma, design)
fit1 <-eBayes(fit1)
tab50 <- topTable(fit1, coef = 2, adjust = "fdr",n = 50)
head(tab50, n=2)
               logFC  AveExpr        t      P.Value    adj.P.Val        B
211597_s_at 5.237952 3.289023 24.49186 2.866308e-08 0.0006386993 7.199561
211964_at   3.519962 2.686838 21.69393 6.866511e-08 0.0007650324 6.862590

probeList <- rownames(exprs(eset.rma));
if (require(hgu133a.db) & require(annotate))
{
geneSymbol <- getSYMBOL(probeList, 'hgu133a.db')
geneName <- sapply(lookUp(probeList, 'hgu133a.db',
'GENENAME'), function(x) x[1])
EntrezID <- sapply(lookUp(probeList, 'hgu133a.db',
'ENTREZID'), function(x) x[1])
} 

> head(UP_annotated_table,n=10) logFC AveExpr t P.Value adj.P.Val B 211597_s_at 5.237952 3.289023 24.49186 2.866308e-08 0.0006386993 7.199561 211964_at 3.519962 2.686838 21.69393 6.866511e-08 0.0007650324 6.862590 213243_at 3.841436 2.474788 18.58363 2.083929e-07 0.0015478733 6.354825 203038_at 4.317340 2.869763 16.56840 4.729030e-07 0.0026344242 5.920133 206385_s_at 2.208070 2.065396 14.51531 1.209436e-06 0.0053899727 5.358531 203675_at 3.300579 3.157668 13.04972 2.560907e-06 0.0073778832 4.861905 206806_at 1.692654 2.687724 12.65547 3.175768e-06 0.0073778832 4.711820 219737_s_at 3.908562 4.850929 12.45853 3.544425e-06 0.0073778832 4.633940 204891_s_at 4.645051 4.962788 12.24253 4.005545e-06 0.0073778832 4.546204 203865_s_at 2.774819 2.887660 12.15133 4.220348e-06 0.0073778832 4.508410 FoldChange DownS/Norm 211597_s_at 37.738164 211964_at 11.471339 213243_at 14.334659 203038_at 19.936496 206385_s_at 4.620569 203675_at 9.853111 206806_at 3.232508 219737_s_at 15.017388 204891_s_at 25.020713 203865_s_at 6.843903

> head(DOWN_annotated_table,n=10) logFC AveExpr t P.Value adj.P.Val B 204684_at -3.539326 3.620389 -13.315721 2.222307e-06 0.007377883 4.958978 216033_s_at -2.403346 4.327960 -12.273627 3.935154e-06 0.007377883 4.558988 202552_s_at -2.020307 2.209275 -11.877579 4.947546e-06 0.007377883 4.392222 210978_s_at -2.301755 7.564961 -11.614257 5.783444e-06 0.007580735 4.276433 212063_at -4.553384 6.169763 -10.282190 1.342784e-05 0.012712866 3.623785 203085_s_at -4.992403 6.162288 -10.143841 1.473638e-05 0.013134834 3.548972 202912_at -4.312281 5.258749 -9.675439 2.036186e-05 0.015181843 3.284779 209200_at -1.469112 3.378761 -9.607122 2.136946e-05 0.015181843 3.244786 201160_s_at -2.883515 8.534621 -9.254994 2.754286e-05 0.017535360 3.032466 200931_s_at -2.003982 4.598302 -9.117905 3.047180e-05 0.018861198 2.946915 FoldChange DownS/Norm 204684_at -11.626345 216033_s_at -5.290285 202552_s_at -4.056700 210978_s_at -4.930573 212063_at -23.480377 203085_s_at -31.831941 202912_at -19.866713 209200_at -2.768515 201160_s_at -7.379456 200931_s_at -4.011057

 

 

limma deg • 1.6k views
ADD COMMENT
1
Entering edit mode
@james-w-macdonald-5106
Last seen 1 day ago
United States

If you are already using affycoretools, then

eset.rma <- annotateEset(eset.rma, hgu133a.db)

And then proceed with limma. The annotation will automatically be added to your topTable output.

ADD COMMENT
0
Entering edit mode
nia ▴ 30
@nia-12707
Last seen 5.0 years ago

Thankyou for your response, i get the desired output but while using the code it generated some error.

library(affy)
library(affycoretools)
d1<-ReadAffy()
pData(d1)<-read.table("PhenoData.txt",row.names=1,header = T,sep="\t");
pData(d1)
d1
> eset.rma <- rma(d1)
Background correcting
Normalizing
Calculating Expression

> eset.rma <- annotateEset(eset.rma, hgu133a.db)
'select()' returned 1:many mapping between keys and columns
'select()' returned 1:many mapping between keys and columns
'select()' returned 1:many mapping between keys and columns

 

ADD COMMENT
1
Entering edit mode

There is no error message.

ADD REPLY

Login before adding your answer.

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