Entering edit mode
Paul, Cristina
▴
50
@paul-cristina-5211
Last seen 9.6 years ago
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@gmail.com<mailto:seandavi@gmail.com>
[mailto:seandavi@gmail.com] On Behalf Of Sean Davis
Sent: Tuesday, May 01, 2012 1:30 PM
To: Paul, Cristina
Cc: bioconductor@r-project.org<mailto:bioconductor@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@ars.usda.gov<mailto:cristina.paul@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
This electronic message contains information generated by the USDA
solely for the intended recipients. Any unauthorized interception of
this message or the use or disclosure of the information it contains
may violate the law and subject the violator to civil or criminal
penalties. If you believe you have received this message in error,
please notify the sender and delete the email immediately.
[[alternative HTML version deleted]]
_______________________________________________
Bioconductor mailing list
Bioconductor@r-project.org<mailto:bioconductor@r-project.org>
https://stat.ethz.ch/mailman/listinfo/bioconductor
Search the archives:
http://news.gmane.org/gmane.science.biology.informatics.conductor
[[alternative HTML version deleted]]