How do I find up and down regulated genes for each contrast in LIMMA?
0
0
Entering edit mode
@gordon-smyth
Last seen 2 hours ago
WEHI, Melbourne, Australia
Dear Cristina, When R gives you an error message like: 'Error: unexpected symbol in "topsbacteria <- topTable(fit2, adjust="BH", n=20 coef"' the idea is you should re-examine your code to find the syntax error. In this case, you've forgotten the comma after "n=20". There appear to be other problems as well with your code, but you don't give us enough information to find them. For example, the error may have occured during manipulations in Excel. I can see that you've responded to James MacDonald's request for you to give more code. However you need to give actual output as well, such as that from topTable, if you claim that there is a problem, rather than just describing what you observed. Have a read of the posting guide: http://www.bioconductor.org/help/mailing-list/posting-guide/ Best wishes Gordon > Date: Fri, 4 May 2012 11:22:31 +0000 > From: "Paul, Cristina" <cristina.paul at="" ars.usda.gov=""> > To: "bioconductor at r-project.org" <bioconductor at="" r-project.org=""> > Subject: [BioC] How do I find up and down regulated genes for each > contrast in LIMMA? > > Took a day off from coding??? > > Given my matrix.. these 2 blocks of code should have called different > sets of results.. but the result of every (up/down) file is identical > (now that I wrote them to excel and can look at them side by side??? the > topTable for each data set is different for each contrast so printing > that and can sort in Excel. > > topTable(fit2, adjust="BH", n=20, coef=1, sort.by=???logFC???) #Bacteria - healthy > tops <- topTable(fit2, n=Inf) # get all genes > tops [which(tops$logFC > 0), ] [1:25,] # up reg top 25 > write.table(tops, file="topsbacteria.txt") > tops [which(tops$logFC < 0), ] [1:25,] # down reg top 25 > write.table(tops, file="lowsbacteria.txt") > > > topTable(fit2, adjust="BH", n=20, coef=2, sort.by=???logFC???) #phytoplasma - healthy > tops <- topTable(fit2, n=Inf ) # get all genes > tops[which(tops$logFC > 0), ] [1:25,] # up reg top 25 > write.table(tops, file="topsphytoplasma.txt") > tops[which(tops$logFC < 0), ] [1:25,] # down reg top 25 > write.table(tops, file="lowsphytoplasma.txt") > > if I put a coef into the second line (for example) > >> topbacteria <- topTable(fit2, adjust="BH", n=20 coef=1) > Error: unexpected symbol in "topsbacteria <- topTable(fit2, adjust="BH", n=20 coef" > > But thus all my resultant up and down regulated tables are the same???. > > Whether you think you can or think you can't - Your're right... > Henry Ford > > Cristina Paul > > Citrus Quarantine Unit > USDA-ARS-BA-PSI-MPPL > Mailling address: > Bldg 004 Rm 118 > Beltsville MD 20705 > office: 301-504-7657 > FAX: 301-504-5449 > Cell: 240-286-6709 > > Physical Address: > Range 1 head house #6 > > From: seandavi at gmail.com<mailto:seandavi at="" gmail.com=""> [mailto:seandavi at gmail.com] On Behalf Of Sean Davis > Sent: Tuesday, May 01, 2012 1:30 PM > To: Paul, Cristina > Cc: bioconductor at r-project.org<mailto:bioconductor at="" r-project.org=""> > Subject: Re: [BioC] How do I find up and down regulated genes for each contrast in LIMMA? > > > > On Tue, May 1, 2012 at 1:22 PM, Paul, Cristina <cristina.paul at="" ars.usda.gov<mailto:cristina.paul="" at="" ars.usda.gov="">> wrote: > R.2.14 in RStudio all packages up to date. > > Using the contrast.matrix I have been using lmfit etc from Limma, and have obtained a very informative Venn Diagram of our results (all trts minus healthy)... I would like to find the top 25 (in one trt only 5 genes were unique to the pathogen) up and down regulated genes... for each pathogen vs Healthy contrast. The code below gives me total across all the contrasts, or appears to. Have googled and read most of day but have found no code etc for doing this, or do I need to make a matrix for each comparison separately? I tried topTableF in the tops code (given topTableF provided the contrast data) but result was NA's... > >> design #each trt 4 CEL file replicates no subtreatments > Virus Bacteria Healthy phytoplasma > 1 0 1 0 0 > 2 0 1 0 0 > 3 0 1 0 0 > 4 0 1 0 0 > 5 1 0 0 0 > 6 1 0 0 0 > 7 1 0 0 0 > 8 1 0 0 0 > 9 0 0 1 0 > 10 0 0 1 0 > 11 0 0 1 0 > 12 0 0 1 0 > 13 0 0 0 1 > 14 0 0 0 1 > 15 0 0 0 1 > 16 0 0 0 1 > > > fit <- lmFit(eset, design) > contrast.matrix<-makeContrasts(Bacteria-Healthy, Phytoplasma- Healthy, Virus-Healthy, levels=design) > fit2 <- contrasts.fit(fit, contrast.matrix) > fit2 <- eBayes(fit2) > topTable(fit2, adjust="BH", n=20) > results<-decideTests(fit2) > vennDiagram(results) > topTableF(fit2, n=20) > > tops <- topTable(fit2, n=Inf) # all on chip > > You'll want to include the coef argument in the topTable call to specify which contrast you are examining. > > Sean > > tops[which(tops$logFC > 0), ] [1:25,] # up reg top 25 > tops[which(tops$logFC < 0), ] [1:25,] # down reg top 25 > > thank you in advance for all help.... > > Whether you think you can or think you can't - Your're right... > Henry Ford > > Cristina Paul > ______________________________________________________________________ The information in this email is confidential and intend...{{dropped:5}}
limma limma • 2.9k views
ADD COMMENT

Login before adding your answer.

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