DESeq2: up- and down-regulated genes
2
0
Entering edit mode
@alicia-r-perez-porro-5953
Last seen 9.6 years ago
Dear community, I am using DESeq2 to perform my differential expression analyses. My question is, I think, very simple. To interprete the results if I have: > mcols(res, use.names=TRUE) ##To know the level of conditions DataFrame with 6 rows and 2 columns type description <character> <character> baseMean intermediate the base mean over all rows log2FoldChange results log2 fold change (MAP): condition SP vs EB lfcSE results standard error: condition SP vs EB stat results Wald statistic: condition SP vs EB pvalue results Wald test p-value: condition SP vs EB padj results BH adjusted p-values By exporting my up-regulated genes doing: write.table(as.data.frame(resSig[ order( -resSig$log2FoldChange, -resSig$baseMean ),]), file="UpRegulated.txt") Are my genes up-regulated in the EB condition? or in the SP condition? Thanks for your time. Best, Alicia -- Alicia R. Pérez-Porro PhD candidate Giribet lab Department of Organismic and Evolutionary Biology MCZ labs Harvard University 26 Oxford St, Cambridge MA 02138 phone: +1 617-496-5308 fax: +1 617-495-5667 www.oeb.harvard.edu/faculty/giribet/ Department of Marine Ecology Center for Advanced Studies of Blanes (CEAB-CSIC) C/Accés Cala St. Francesc 14 17300 Blanes, Girona, SPAIN phone: +34 972 336 101 fax: +34 972 337 806 www.ceab.csic.es [[alternative HTML version deleted]]
DESeq2 DESeq2 • 11k views
ADD COMMENT
2
Entering edit mode
@mikelove
Last seen 4 hours ago
United States
Hi Alicia, Positive log fold change for SP vs EB means up-regulated in SP. Negative log fold change means down-regulated in SP. Mike On May 25, 2014 7:40 PM, "Alicia R. Pérez-Porro" < alicia.r.perezporro@gmail.com> wrote: > Dear community, > > I am using DESeq2 to perform my differential expression analyses. My > question is, I think, very simple. To interprete the results if I have: > > > mcols(res, use.names=TRUE) ##To know the level of conditions > DataFrame with 6 rows and 2 columns > type description > <character> <character> > baseMean intermediate the base mean over all rows > log2FoldChange results log2 fold change (MAP): condition SP vs EB > lfcSE results standard error: condition SP vs EB > stat results Wald statistic: condition SP vs EB > pvalue results Wald test p-value: condition SP vs EB > padj results BH adjusted p-values > > By exporting my up-regulated genes doing: > > write.table(as.data.frame(resSig[ order( -resSig$log2FoldChange, > -resSig$baseMean ),]), > file="UpRegulated.txt") > > Are my genes up-regulated in the EB condition? or in the SP condition? > > Thanks for your time. > Best, > Alicia > > > -- > Alicia R. Pérez-Porro > PhD candidate > > Giribet lab > Department of Organismic and Evolutionary Biology > MCZ labs > Harvard University > 26 Oxford St, Cambridge MA 02138 > phone: +1 617-496-5308 > fax: +1 617-495-5667 > www.oeb.harvard.edu/faculty/giribet/ > > Department of Marine Ecology > Center for Advanced Studies of Blanes (CEAB-CSIC) > C/Accés Cala St. Francesc 14 > 17300 Blanes, Girona, SPAIN > phone: +34 972 336 101 > fax: +34 972 337 806 > www.ceab.csic.es > > [[alternative HTML version deleted]] > > > _______________________________________________ > Bioconductor mailing list > 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]]
ADD COMMENT
0
Entering edit mode
What about this example: (generated with write.table(as.data.frame(resSig[ order( -resSig$log2FoldChange, -resSig$baseMean ),]), file="UpRegulated.txt") transcript_ID baseMean log2FoldChange c99091_g1_i2 433.9095957 4.454648409 c94900_g1_i2 81.89590041 -4.621788185 c95454_g1_i2 85.99069543 -4.714932567 c86874_g1_i2 89.26653144 -4.784367099 c106856_g1_i5 89.26653144 -4.784367099 c104937_g1_i2 89.26653144 -4.784367099 c98144_g1_i2 93.36132646 -4.865963134 c95410_g1_i3 94.99924447 -4.897496825 c103032_g2_i2 97.45612148 -4.943692641 c108287_g1_i4 102.3698755 -5.032327057 c107571_g3_i3 110.5594655 -5.169976643 c96989_g1_i1 140.0419897 -5.583327146 c96989_g1_i5 157.2401288 -5.779465439 c94096_g1_i2 203.920792 -6.201318372 c99876_g1_i3 229.3085211 -6.382470134 c104215_g2_i4 262.0668813 -6.580890544 c78891_g2_i1 273.5323074 -6.642674841 c96726_g1_i3 337.4111097 -6.932019693 c92607_g2_i3 386.5486499 -7.106787095 c91544_g1_i1 420.1259691 -7.208392858 Only the first one is up-regulated and the rest are down? Thanks, Alicia -- Alicia R. Pérez-Porro PhD candidate Giribet lab Department of Organismic and Evolutionary Biology MCZ labs Harvard University 26 Oxford St, Cambridge MA 02138 phone: +1 617-496-5308 fax: +1 617-495-5667 www.oeb.harvard.edu/faculty/giribet/ Department of Marine Ecology Center for Advanced Studies of Blanes (CEAB-CSIC) C/Accés Cala St. Francesc 14 17300 Blanes, Girona, SPAIN phone: +34 972 336 101 fax: +34 972 337 806 www.ceab.csic.es On Sun, May 25, 2014 at 9:22 PM, Michael Love <michaelisaiahlove@gmail.com>wrote: > Hi Alicia, > > Positive log fold change for SP vs EB means up-regulated in SP. > > Negative log fold change means down-regulated in SP. > > Mike > On May 25, 2014 7:40 PM, "Alicia R. Pérez-Porro" < > alicia.r.perezporro@gmail.com> wrote: > >> Dear community, >> >> I am using DESeq2 to perform my differential expression analyses. My >> question is, I think, very simple. To interprete the results if I have: >> >> > mcols(res, use.names=TRUE) ##To know the level of conditions >> DataFrame with 6 rows and 2 columns >> type description >> <character> <character> >> baseMean intermediate the base mean over all rows >> log2FoldChange results log2 fold change (MAP): condition SP vs EB >> lfcSE results standard error: condition SP vs EB >> stat results Wald statistic: condition SP vs EB >> pvalue results Wald test p-value: condition SP vs EB >> padj results BH adjusted p-values >> >> By exporting my up-regulated genes doing: >> >> write.table(as.data.frame(resSig[ order( -resSig$log2FoldChange, >> -resSig$baseMean ),]), >> file="UpRegulated.txt") >> >> Are my genes up-regulated in the EB condition? or in the SP condition? >> >> Thanks for your time. >> Best, >> Alicia >> >> >> -- >> Alicia R. Pérez-Porro >> PhD candidate >> >> Giribet lab >> Department of Organismic and Evolutionary Biology >> MCZ labs >> Harvard University >> 26 Oxford St, Cambridge MA 02138 >> phone: +1 617-496-5308 >> fax: +1 617-495-5667 >> www.oeb.harvard.edu/faculty/giribet/ >> >> Department of Marine Ecology >> Center for Advanced Studies of Blanes (CEAB-CSIC) >> C/Accés Cala St. Francesc 14 >> 17300 Blanes, Girona, SPAIN >> phone: +34 972 336 101 >> fax: +34 972 337 806 >> www.ceab.csic.es >> >> [[alternative HTML version deleted]] >> >> >> _______________________________________________ >> Bioconductor mailing list >> 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]]
ADD REPLY
0
Entering edit mode
Simon Anders ★ 3.7k
@simon-anders-3855
Last seen 3.7 years ago
Zentrum für Molekularbiologie, Universi…
Hi Alicia On 26/05/14 01:39, Alicia R. P?rez-Porro wrote: >> mcols(res, use.names=TRUE) ##To know the level of conditions > DataFrame with 6 rows and 2 columns > type description > <character> <character> > baseMean intermediate the base mean over all rows > log2FoldChange results log2 fold change (MAP): condition SP vs EB > lfcSE results standard error: condition SP vs EB > stat results Wald statistic: condition SP vs EB > pvalue results Wald test p-value: condition SP vs EB > padj results BH adjusted p-values > > By exporting my up-regulated genes doing: > > write.table(as.data.frame(resSig[ order( -resSig$log2FoldChange, > -resSig$baseMean ),]), > file="UpRegulated.txt") > > Are my genes up-regulated in the EB condition? or in the SP condition? Have a look at the column description: It says "log2 fold change (MAP): condition SP vs EB". With "SP vs EB", we mean that SP was compared against EB. Hence: positive sign means stronger in SP than in EB. > What about this example: (generated with > write.table(as.data.frame(resSig[ > order( -resSig$log2FoldChange, -resSig$baseMean ),]), > file="UpRegulated.txt") Please show us how you generated 'resSig' from 'res', and how tyou got 'res' from your DESeqDataset object. BTW, if you can your e-mail program to not wrap the lines, this would make it much more readable. Simon
ADD COMMENT
0
Entering edit mode
Hi Michael and Simon, Here is my complete script for DESeq2: #open DESeq library("DESeq2") setwd("~/Dropbox/TESIS/DGEA_2.0/Chapter_4_thesis/DE_analysis/DESeq2") #Count matrix input matrix = read.table (file.choose(), header=TRUE, row.names=1) CeleDesign <- data.frame( row.names = colnames(matrix), condition = factor(c("SP", "SP", "EB", "EB"))) dds <- DESeqDataSetFromMatrix(countData = matrix,colData = CeleDesign,design = ~ condition) dds #Est size factor = normalize for library size dds<- estimateSizeFactors(dds) dds <- estimateDispersions(dds) dds <- nbinomWaldTest(dds) #plot dispersion plotDispEsts(ddsLocal, ylim = c(1e-6, 1e1)) plotDispEsts(dds, ylim = c(1e-6, 1e1)) #Differential expression analysis resultsNames(dds) res <- results(dds) res <- res[order(res$padj),] head(res) plotMA(dds,ylim=c(-3,3),main="DESeq2") sum(res$padj < .1, na.rm=TRUE) mcols(res, use.names=TRUE) ##To know the level of conditions #filter for significant genes resSig <- res[ which(res$padj < .1), ] head(resSig) #filter for upregulated and downregulated genes ##up-regulated tail(resSig[order(resSig$log2FoldChange), ]) ##down-regulated head(resSig[order(resSig$log2FoldChange), ]) ##list most sig genes head( resSig[ order(resSig$padj), ] ) write.table(as.data.frame(resSig [ order(resSig$padj), ]), file="MostSigGenes.txt") write.table(as.data.frame(resSig[ order( resSig$log2FoldChange,-resSig$baseMean),]), file="DownRegulated.txt") write.table(as.data.frame(resSig[ order( -resSig$log2FoldChange, -resSig$baseMean ),]), file="UpRegulated.txt") 1. MostSigGenes.txt, DownRegulated.txt and UpRegulated.txt always have the same number of genes. This is confusing for me. 2. I understand then that maybe is better to only generate MostSigGenes.txt and then divide the result in 2 txt files: one with positive log2FC = upregulated and the other with negative log2FC = downregulated, right? 3. I don't understand with if I am entering the conditions like "condition = factor(c("SP", "SP", "EB", "EB")))" then is comparing EB vs. SP. I would have thought the opposite. Thanks, Alicia -- Alicia R. Pérez-Porro PhD candidate Giribet lab Department of Organismic and Evolutionary Biology MCZ labs Harvard University 26 Oxford St, Cambridge MA 02138 phone: +1 617-496-5308 fax: +1 617-495-5667 www.oeb.harvard.edu/faculty/giribet/ Department of Marine Ecology Center for Advanced Studies of Blanes (CEAB-CSIC) C/Accés Cala St. Francesc 14 17300 Blanes, Girona, SPAIN phone: +34 972 336 101 fax: +34 972 337 806 www.ceab.csic.es On Mon, May 26, 2014 at 5:01 AM, Simon Anders <anders@embl.de> wrote: > Hi Alicia > > > On 26/05/14 01:39, Alicia R. Pérez-Porro wrote: > >> mcols(res, use.names=TRUE) ##To know the level of conditions >>> >> DataFrame with 6 rows and 2 columns >> type description >> <character> <character> >> baseMean intermediate the base mean over all rows >> log2FoldChange results log2 fold change (MAP): condition SP vs EB >> lfcSE results standard error: condition SP vs EB >> stat results Wald statistic: condition SP vs EB >> pvalue results Wald test p-value: condition SP vs EB >> padj results BH adjusted p-values >> >> By exporting my up-regulated genes doing: >> >> write.table(as.data.frame(resSig[ order( -resSig$log2FoldChange, >> -resSig$baseMean ),]), >> file="UpRegulated.txt") >> >> Are my genes up-regulated in the EB condition? or in the SP condition? >> > > Have a look at the column description: It says "log2 fold change (MAP): > condition SP vs EB". > > With "SP vs EB", we mean that SP was compared against EB. Hence: positive > sign means stronger in SP than in EB. > > > > What about this example: (generated with > > write.table(as.data.frame(resSig[ > > order( -resSig$log2FoldChange, -resSig$baseMean ),]), > > file="UpRegulated.txt") > > Please show us how you generated 'resSig' from 'res', and how tyou got > 'res' from your DESeqDataset object. > > BTW, if you can your e-mail program to not wrap the lines, this would make > it much more readable. > > Simon > > > _______________________________________________ > Bioconductor mailing list > 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]]
ADD REPLY
0
Entering edit mode
Hi Alicia On 26/05/14 17:20, Alicia R. P?rez-Porro wrote: > 1. MostSigGenes.txt, DownRegulated.txt and UpRegulated.txt always have > the same number of genes. This is confusing for me. This is because in all three cases, it is the same table. You only change the ordering of rows. Here, you take the table with all genes ("res") and reduce it to only those rows with padj < 0.1: > resSig <- res[ which(res$padj < .1), ] and in your "write.table" commands, you always write out this table, but you re-order the rows. (The "order" function gives the order of rows to get them sorted according to what you specify) > 2. I understand then that maybe is better to only generate > MostSigGenes.txt and then divide the result in 2 txt files: one with > positive log2FC = upregulated and the other with negative log2FC = > downregulated, right? Probably, yes. Depends, though, on what you want to do with the text files afterwards. If you want to look at them in Excel and this is the tool you feel most comfortable with, you could also simply write out the "resSig" table as is, with write.table( resSig, file="allSig.txt" ) or even the whole result table ('res' isntead of 'resSig') and do all your filtering and sorting in Excel. > 3. I don't understand with if I am entering the conditions like > "condition = factor(c("SP", "SP", "EB", "EB")))" then is comparing > EB vs. SP. I would have thought the opposite. R has the habit of sorting the names of the factor level by alphabet if you don't explicitly tell it the order you want. And then, DESeq2 compares by default the alphabetically last versus the first. If you want something else, just tell it what you want: res <- results( dds, contrast = list( "condition", "EP", "SP" ) ) to compare SP versus EP. Simon
ADD REPLY
0
Entering edit mode
Hi, I am trying to do: > res <- results( dds, contrast = list( "condition", "NR", "DT" ) ) Error in results(dds, contrast = list("condition", "NR", "DT")) : 'contrast', as a list, should have length 2, see the manual page of ?results for more information And it's giving me an error :( -- Alicia R. Pérez-Porro PhD candidate Giribet lab Department of Organismic and Evolutionary Biology MCZ labs Harvard University 26 Oxford St, Cambridge MA 02138 phone: +1 617-496-5308 fax: +1 617-495-5667 www.oeb.harvard.edu/faculty/giribet/ Department of Marine Ecology Center for Advanced Studies of Blanes (CEAB-CSIC) C/Accés Cala St. Francesc 14 17300 Blanes, Girona, SPAIN phone: +34 972 336 101 fax: +34 972 337 806 www.ceab.csic.es On Mon, May 26, 2014 at 11:42 AM, Simon Anders <anders@embl.de> wrote: > Hi Alicia > > On 26/05/14 17:20, Alicia R. Pérez-Porro wrote: > >> 1. MostSigGenes.txt, DownRegulated.txt and UpRegulated.txt always have >> >> the same number of genes. This is confusing for me. >> > > This is because in all three cases, it is the same table. You only change > the ordering of rows. > > Here, you take the table with all genes ("res") and reduce it to only > those rows with padj < 0.1: > > > > resSig <- res[ which(res$padj < .1), ] > > and in your "write.table" commands, you always write out this table, but > you re-order the rows. (The "order" function gives the order of rows to get > them sorted according to what you specify) > > 2. I understand then that maybe is better to only generate >> >> MostSigGenes.txt and then divide the result in 2 txt files: one with >> positive log2FC = upregulated and the other with negative log2FC = >> downregulated, right? >> > > Probably, yes. > > Depends, though, on what you want to do with the text files afterwards. If > you want to look at them in Excel and this is the tool you feel most > comfortable with, you could also simply write out the "resSig" table as is, > with > write.table( resSig, file="allSig.txt" ) > or even the whole result table ('res' isntead of 'resSig') and do all your > filtering and sorting in Excel. > > > 3. I don't understand with if I am entering the conditions like >> >> "condition = factor(c("SP", "SP", "EB", "EB")))" then is comparing >> EB vs. SP. I would have thought the opposite. >> > > R has the habit of sorting the names of the factor level by alphabet if > you don't explicitly tell it the order you want. And then, DESeq2 compares > by default the alphabetically last versus the first. > > If you want something else, just tell it what you want: > > res <- results( dds, contrast = list( "condition", "EP", "SP" ) ) > > to compare SP versus EP. > > Simon > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
hi Alicia, On Mon, May 26, 2014 at 12:04 PM, Alicia R. P?rez-Porro <alicia.r.perezporro at="" gmail.com=""> wrote: > Hi, > > I am trying to do: > >> res <- results( dds, contrast = list( "condition", "NR", "DT" ) ) > Just change list() to c() in the above: results(dds, contrast = c("condition", "NR", "DT")) > Error in results(dds, contrast = list("condition", "NR", "DT")) : > 'contrast', as a list, should have length 2, > see the manual page of ?results for more information > > And it's giving me an error :( > > > > -- > Alicia R. P?rez-Porro > PhD candidate > > Giribet lab > Department of Organismic and Evolutionary Biology > MCZ labs > Harvard University > 26 Oxford St, Cambridge MA 02138 > phone: +1 617-496-5308 > fax: +1 617-495-5667 > www.oeb.harvard.edu/faculty/giribet/ > > Department of Marine Ecology > Center for Advanced Studies of Blanes (CEAB-CSIC) > C/Acc?s Cala St. Francesc 14 > 17300 Blanes, Girona, SPAIN > phone: +34 972 336 101 > fax: +34 972 337 806 > www.ceab.csic.es > > > On Mon, May 26, 2014 at 11:42 AM, Simon Anders <anders at="" embl.de=""> wrote: > >> Hi Alicia >> >> On 26/05/14 17:20, Alicia R. P?rez-Porro wrote: >> >>> 1. MostSigGenes.txt, DownRegulated.txt and UpRegulated.txt always have >>> >>> the same number of genes. This is confusing for me. >>> >> >> This is because in all three cases, it is the same table. You only change >> the ordering of rows. >> >> Here, you take the table with all genes ("res") and reduce it to only >> those rows with padj < 0.1: >> >> >> > resSig <- res[ which(res$padj < .1), ] >> >> and in your "write.table" commands, you always write out this table, but >> you re-order the rows. (The "order" function gives the order of rows to get >> them sorted according to what you specify) >> >> 2. I understand then that maybe is better to only generate >>> >>> MostSigGenes.txt and then divide the result in 2 txt files: one with >>> positive log2FC = upregulated and the other with negative log2FC = >>> downregulated, right? >>> >> >> Probably, yes. >> >> Depends, though, on what you want to do with the text files afterwards. If >> you want to look at them in Excel and this is the tool you feel most >> comfortable with, you could also simply write out the "resSig" table as is, >> with >> write.table( resSig, file="allSig.txt" ) >> or even the whole result table ('res' isntead of 'resSig') and do all your >> filtering and sorting in Excel. >> >> >> 3. I don't understand with if I am entering the conditions like >>> >>> "condition = factor(c("SP", "SP", "EB", "EB")))" then is comparing >>> EB vs. SP. I would have thought the opposite. >>> >> >> R has the habit of sorting the names of the factor level by alphabet if >> you don't explicitly tell it the order you want. And then, DESeq2 compares >> by default the alphabetically last versus the first. >> >> If you want something else, just tell it what you want: >> >> res <- results( dds, contrast = list( "condition", "EP", "SP" ) ) >> >> to compare SP versus EP. >> >> Simon >> > > [[alternative HTML version deleted]] > > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD REPLY
0
Entering edit mode
Thanks! Just one last thing. I just did results(dds, contrast = c("condition", "NR", "DT")) and the number of most significant genes is the same as before (e.g. NRvsDT = DTvsNR) so I am assuming that the only thing that I am doing by specifying contrast is changing the polarity (what was -log2FC now is positive, and the opposite). But my list of genes is exactly the same. Am I understanding this correctly? So let's say that I have NR vs DT, whatever is log2FC is up-regulated in NR or what is the same, down-regulated in DT; and whatever is -log2FC is down-regulated in NR but up-regulated in DT, right? Thanks again for your patience and time. Alicia -- Alicia R. Pérez-Porro PhD candidate Giribet lab Department of Organismic and Evolutionary Biology MCZ labs Harvard University 26 Oxford St, Cambridge MA 02138 phone: +1 617-496-5308 fax: +1 617-495-5667 www.oeb.harvard.edu/faculty/giribet/ Department of Marine Ecology Center for Advanced Studies of Blanes (CEAB-CSIC) C/Accés Cala St. Francesc 14 17300 Blanes, Girona, SPAIN phone: +34 972 336 101 fax: +34 972 337 806 www.ceab.csic.es On Mon, May 26, 2014 at 12:09 PM, Michael Love <michaelisaiahlove@gmail.com>wrote: > hi Alicia, > > On Mon, May 26, 2014 at 12:04 PM, Alicia R. Pérez-Porro > <alicia.r.perezporro@gmail.com> wrote: > > Hi, > > > > I am trying to do: > > > >> res <- results( dds, contrast = list( "condition", "NR", "DT" ) ) > > > > Just change list() to c() in the above: > > results(dds, contrast = c("condition", "NR", "DT")) > > > Error in results(dds, contrast = list("condition", "NR", "DT")) : > > 'contrast', as a list, should have length 2, > > see the manual page of ?results for more information > > > > And it's giving me an error :( > > > > > > > > -- > > Alicia R. Pérez-Porro > > PhD candidate > > > > Giribet lab > > Department of Organismic and Evolutionary Biology > > MCZ labs > > Harvard University > > 26 Oxford St, Cambridge MA 02138 > > phone: +1 617-496-5308 > > fax: +1 617-495-5667 > > www.oeb.harvard.edu/faculty/giribet/ > > > > Department of Marine Ecology > > Center for Advanced Studies of Blanes (CEAB-CSIC) > > C/Accés Cala St. Francesc 14 > > 17300 Blanes, Girona, SPAIN > > phone: +34 972 336 101 > > fax: +34 972 337 806 > > www.ceab.csic.es > > > > > > On Mon, May 26, 2014 at 11:42 AM, Simon Anders <anders@embl.de> wrote: > > > >> Hi Alicia > >> > >> On 26/05/14 17:20, Alicia R. Pérez-Porro wrote: > >> > >>> 1. MostSigGenes.txt, DownRegulated.txt and UpRegulated.txt always have > >>> > >>> the same number of genes. This is confusing for me. > >>> > >> > >> This is because in all three cases, it is the same table. You only > change > >> the ordering of rows. > >> > >> Here, you take the table with all genes ("res") and reduce it to only > >> those rows with padj < 0.1: > >> > >> > >> > resSig <- res[ which(res$padj < .1), ] > >> > >> and in your "write.table" commands, you always write out this table, but > >> you re-order the rows. (The "order" function gives the order of rows to > get > >> them sorted according to what you specify) > >> > >> 2. I understand then that maybe is better to only generate > >>> > >>> MostSigGenes.txt and then divide the result in 2 txt files: one > with > >>> positive log2FC = upregulated and the other with negative log2FC = > >>> downregulated, right? > >>> > >> > >> Probably, yes. > >> > >> Depends, though, on what you want to do with the text files afterwards. > If > >> you want to look at them in Excel and this is the tool you feel most > >> comfortable with, you could also simply write out the "resSig" table as > is, > >> with > >> write.table( resSig, file="allSig.txt" ) > >> or even the whole result table ('res' isntead of 'resSig') and do all > your > >> filtering and sorting in Excel. > >> > >> > >> 3. I don't understand with if I am entering the conditions like > >>> > >>> "condition = factor(c("SP", "SP", "EB", "EB")))" then is comparing > >>> EB vs. SP. I would have thought the opposite. > >>> > >> > >> R has the habit of sorting the names of the factor level by alphabet if > >> you don't explicitly tell it the order you want. And then, DESeq2 > compares > >> by default the alphabetically last versus the first. > >> > >> If you want something else, just tell it what you want: > >> > >> res <- results( dds, contrast = list( "condition", "EP", "SP" ) ) > >> > >> to compare SP versus EP. > >> > >> Simon > >> > > > > [[alternative HTML version deleted]] > > > > > > _______________________________________________ > > Bioconductor mailing list > > 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]]
ADD REPLY
0
Entering edit mode
On Mon, May 26, 2014 at 12:18 PM, Alicia R. P?rez-Porro <alicia.r.perezporro at="" gmail.com=""> wrote: > Thanks! > > Just one last thing. I just did results(dds, contrast = c("condition", "NR", > "DT")) and the number of most significant genes is the same as before (e.g. > NRvsDT = DTvsNR) so I am assuming that the only thing that I am doing by > specifying contrast is changing the polarity (what was -log2FC now is > positive, and the opposite). Yes, you've got it. > But my list of genes is exactly the same. Am I > understanding this correctly? So let's say that I have NR vs DT, whatever is > log2FC is up-regulated in NR or what is the same, down-regulated in DT; and > whatever is -log2FC is down-regulated in NR but up-regulated in DT, right? > > Thanks again for your patience and time. > Alicia > > > > -- > Alicia R. P?rez-Porro > PhD candidate > > Giribet lab > Department of Organismic and Evolutionary Biology > MCZ labs > Harvard University > 26 Oxford St, Cambridge MA 02138 > phone: +1 617-496-5308 > fax: +1 617-495-5667 > www.oeb.harvard.edu/faculty/giribet/ > > Department of Marine Ecology > Center for Advanced Studies of Blanes (CEAB-CSIC) > C/Acc?s Cala St. Francesc 14 > 17300 Blanes, Girona, SPAIN > phone: +34 972 336 101 > fax: +34 972 337 806 > www.ceab.csic.es > > > On Mon, May 26, 2014 at 12:09 PM, Michael Love <michaelisaiahlove at="" gmail.com=""> > wrote: >> >> hi Alicia, >> >> On Mon, May 26, 2014 at 12:04 PM, Alicia R. P?rez-Porro >> <alicia.r.perezporro at="" gmail.com=""> wrote: >> > Hi, >> > >> > I am trying to do: >> > >> >> res <- results( dds, contrast = list( "condition", "NR", "DT" ) ) >> > >> >> Just change list() to c() in the above: >> >> results(dds, contrast = c("condition", "NR", "DT")) >> >> > Error in results(dds, contrast = list("condition", "NR", "DT")) : >> > 'contrast', as a list, should have length 2, >> > see the manual page of ?results for more information >> > >> > And it's giving me an error :( >> > >> > >> > >> > -- >> > Alicia R. P?rez-Porro >> > PhD candidate >> > >> > Giribet lab >> > Department of Organismic and Evolutionary Biology >> > MCZ labs >> > Harvard University >> > 26 Oxford St, Cambridge MA 02138 >> > phone: +1 617-496-5308 >> > fax: +1 617-495-5667 >> > www.oeb.harvard.edu/faculty/giribet/ >> > >> > Department of Marine Ecology >> > Center for Advanced Studies of Blanes (CEAB-CSIC) >> > C/Acc?s Cala St. Francesc 14 >> > 17300 Blanes, Girona, SPAIN >> > phone: +34 972 336 101 >> > fax: +34 972 337 806 >> > www.ceab.csic.es >> > >> > >> > On Mon, May 26, 2014 at 11:42 AM, Simon Anders <anders at="" embl.de=""> wrote: >> > >> >> Hi Alicia >> >> >> >> On 26/05/14 17:20, Alicia R. P?rez-Porro wrote: >> >> >> >>> 1. MostSigGenes.txt, DownRegulated.txt and UpRegulated.txt always >> >>> have >> >>> >> >>> the same number of genes. This is confusing for me. >> >>> >> >> >> >> This is because in all three cases, it is the same table. You only >> >> change >> >> the ordering of rows. >> >> >> >> Here, you take the table with all genes ("res") and reduce it to only >> >> those rows with padj < 0.1: >> >> >> >> >> >> > resSig <- res[ which(res$padj < .1), ] >> >> >> >> and in your "write.table" commands, you always write out this table, >> >> but >> >> you re-order the rows. (The "order" function gives the order of rows to >> >> get >> >> them sorted according to what you specify) >> >> >> >> 2. I understand then that maybe is better to only generate >> >>> >> >>> MostSigGenes.txt and then divide the result in 2 txt files: one >> >>> with >> >>> positive log2FC = upregulated and the other with negative log2FC = >> >>> downregulated, right? >> >>> >> >> >> >> Probably, yes. >> >> >> >> Depends, though, on what you want to do with the text files afterwards. >> >> If >> >> you want to look at them in Excel and this is the tool you feel most >> >> comfortable with, you could also simply write out the "resSig" table as >> >> is, >> >> with >> >> write.table( resSig, file="allSig.txt" ) >> >> or even the whole result table ('res' isntead of 'resSig') and do all >> >> your >> >> filtering and sorting in Excel. >> >> >> >> >> >> 3. I don't understand with if I am entering the conditions like >> >>> >> >>> "condition = factor(c("SP", "SP", "EB", "EB")))" then is comparing >> >>> EB vs. SP. I would have thought the opposite. >> >>> >> >> >> >> R has the habit of sorting the names of the factor level by alphabet if >> >> you don't explicitly tell it the order you want. And then, DESeq2 >> >> compares >> >> by default the alphabetically last versus the first. >> >> >> >> If you want something else, just tell it what you want: >> >> >> >> res <- results( dds, contrast = list( "condition", "EP", "SP" ) ) >> >> >> >> to compare SP versus EP. >> >> >> >> Simon >> >> >> > >> > [[alternative HTML version deleted]] >> > >> > >> > _______________________________________________ >> > Bioconductor mailing list >> > Bioconductor at r-project.org >> > https://stat.ethz.ch/mailman/listinfo/bioconductor >> > Search the archives: >> > http://news.gmane.org/gmane.science.biology.informatics.conductor > >
ADD REPLY

Login before adding your answer.

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