edgeR - 3-dimensional Multidimensional scaling
1
0
Entering edit mode
@paraskevas-iatropoulos-6265
Last seen 9.6 years ago
Hi! it would be of great help, if someone could suggest a solution to the following problem. I used edgeR to analyze RNA Seq expression data (3 different cell lineages with 2 biological replicates for each lineage). I used the plotMDS () function to get a 2D plot of multidimensional scaling. I was asked to perform a 3D plot but I am not able to find a solution According to Cell 151:559–575, where they report to perform 3D- MDS , and a web guide (Quick-R) I used the cmdscale () function as follows: d <- dist( mydata ) # Calculate the euclidean distances between the rows fit <- cmdscale (d, eig =TRUE, k=3) # k is the number of dimensions x <- fit$points[,1] y <- fit$points[,2] z <- fit$points[,3] Then I use the scatterplot3D software to obtain the grafic in 2D or 3D. However, the 2D plot obtained with cmdscale using the counts per million ( cpm ) is much different compared to that obtained with plotMDS . Moreover, the results with the above cmdscale procedure are strange from a biological point of view, so I suppose that I did something wrong. Since the dimensions in the edgeR graphic are "leading logFC ", I calculated the log2 fold-chage (log2 [ cpm of the replicate / average expression in all 6 samples]) and I get a 2D graphic very similar but not identical to edgeR . In this way I can also have a 3D plot. I am not sure if it is right to use the log2-FC to get. Do you think it is ok ? Is there a way to perform a 3D-MDS with edgeR ? Can you suggest me a way to perform the 3D- MDS , please? Thank you in advance. Paraskevas -- Paraskevas Iatropoulos, MD Geneticist Clinical Research Centre for Rare Diseases “ALDO E CELE DACCO ” IRCCS - Mario Negri Institute for Pharmacological Research Via G.B. Camozzi , 3 Ranica ( BG ) - Italy e-mail: iatropoulos @ marionegri .it ---------- L'IRCCS - Istituto di Ricerche Farmacologiche Mario Negri desidera ringraziare i 13.768 donatori, di cui non conosce i nomi, che nel 2011 hanno devoluto il loro 5 per mille a sostegno della nostra attività e assicurare loro che tutto quanto ricevuto sarà esclusivamente impiegato per le nostre ricerche. Siamo naturalmente molto grati a tutti coloro che anche quest'anno hanno deciso di rinnovare ancora la fiducia nel nostro lavoro con la destinazione del loro 5 per mille. A coloro che stanno per farlo ricordiamo di firmare ed indicare il nostro codice fiscale 03254210150 nel riquadro "Finanziamento agli enti della ricerca scientifica e dell'università. Per maggiori informazioni: IRCCS - Istituto di Ricerche Farmacologiche Mario Negri, Via La Masa 19 - 20156 Milano Tel: +39 02 390141 - Fax: +39 02 3546277 +39 02 39001918 Internet: www.marionegri.it, mnegri@marionegri.it [[alternative HTML version deleted]]
edgeR edgeR • 3.8k views
ADD COMMENT
0
Entering edit mode
Mark Robinson ▴ 880
@mark-robinson-4908
Last seen 5.5 years ago
Dear Paraskevas, Maybe all you need is to set 'ndim=3' in your call to plotMDS() ? > However, the 2D plot obtained with cmdscale using the counts per million ( cpm ) is much different compared to that obtained with plotMDS . Have a careful read of: ?plotMDS.DGEList ?plotMDS In short, plotMDS() does something very different with a DGEList object than with a matrix of numbers. Then, maybe try something like: # Taken from the plotMDS.DGEList help page ngenes <- 1000 nlib <- 6 counts <- matrix(rnbinom(ngenes*nlib, size=1/10, mu=20),ngenes,nlib) rownames(counts) <- paste("Gene",1:ngenes) group <- gl(2,3,labels=c("Grp1","Grp2")) counts[1:200,group=="Grp2"] <- counts[1:200,group=="Grp2"] + 10 y <- DGEList(counts,group=group) y <- calcNormFactors(y) > mds <- plotMDS(y, top=200) > mds$cmdscale.out [,1] [,2] Sample1 0.6296663 2.11210712 Sample2 -3.2338291 -0.68439921 Sample3 2.1070395 0.06385855 Sample4 0.2781657 0.60249359 Sample5 0.9806977 -3.12230808 Sample6 -0.7617402 1.02824803 > mds <- plotMDS(y, top=200, ndim=3) > mds$cmdscale.out [,1] [,2] [,3] Sample1 0.6296663 2.11210712 -1.3976172 Sample2 -3.2338291 -0.68439921 1.2745170 Sample3 2.1070395 0.06385855 2.8492196 Sample4 0.2781657 0.60249359 -0.4326530 Sample5 0.9806977 -3.12230808 -1.5085139 Sample6 -0.7617402 1.02824803 -0.7849524 Note, you don't *need* to set the 'top' parameter. Then, just plot these in 3D. Hope that helps. Best, Mark ---------- Prof. Dr. Mark Robinson Bioinformatics, Institute of Molecular Life Sciences University of Zurich http://tiny.cc/mrobin On 27.11.2013, at 16:15, Paraskevas Iatropoulos <paraskevas.iatropoulos at="" marionegri.it=""> wrote: > > Hi! > > it would be of great help, if someone could suggest a solution to the following problem. I used edgeR to analyze RNA Seq expression data (3 different cell lineages with 2 biological replicates for each lineage). I used the plotMDS () function to get a 2D plot of multidimensional scaling. I was asked to perform a 3D plot but I am not able to find a solution > > According to Cell 151:559?575, where they report to perform 3D- MDS , and a web guide (Quick-R) I used the cmdscale () function as follows: > d <- dist( mydata ) # Calculate the euclidean distances between the rows > fit <- cmdscale (d, eig =TRUE, k=3) # k is the number of dimensions > x <- fit$points[,1] > y <- fit$points[,2] > z <- fit$points[,3] > Then I use the scatterplot3D software to obtain the grafic in 2D or 3D. > > However, the 2D plot obtained with cmdscale using the counts per million ( cpm ) is much different compared to that obtained with plotMDS . Moreover, the results with the above cmdscale procedure are strange from a biological point of view, so I suppose that I did something wrong. Since the dimensions in the edgeR graphic are "leading logFC ", I calculated the log2 fold-chage (log2 [ cpm of the replicate / average expression in all 6 samples]) and I get a 2D graphic very similar but not identical to edgeR . In this way I can also have a 3D plot. > > I am not sure if it is right to use the log2-FC to get. Do you think it is ok ? Is there a way to perform a 3D-MDS with edgeR ? Can you suggest me a way to perform the 3D- MDS , please? > > Thank you in advance. > > Paraskevas > > > > -- > Paraskevas Iatropoulos, MD > Geneticist > Clinical Research Centre for Rare Diseases ?ALDO E CELE DACCO ? > IRCCS - Mario Negri Institute for Pharmacological Research > Via G.B. Camozzi , 3 > Ranica ( BG ) - Italy > e-mail: iatropoulos @ marionegri .it > > ---------- > L'IRCCS - Istituto di Ricerche Farmacologiche Mario Negri desidera ringraziare i 13.768 donatori, di cui non conosce i nomi, che nel 2011 hanno devoluto il loro 5 per mille a sostegno della nostra attivit? e assicurare loro che tutto quanto ricevuto sar? esclusivamente impiegato per le nostre ricerche. Siamo naturalmente molto grati a tutti coloro che anche quest'anno hanno deciso di rinnovare ancora la fiducia nel nostro lavoro con la destinazione del loro 5 per mille. > > A coloro che stanno per farlo ricordiamo di firmare ed indicare il nostro codice fiscale > > 03254210150 > > nel riquadro "Finanziamento agli enti della ricerca scientifica e dell'universit?. > > Per maggiori informazioni: > > IRCCS - Istituto di Ricerche Farmacologiche Mario Negri, Via La Masa 19 - 20156 Milano > Tel: +39 02 390141 - Fax: +39 02 3546277 +39 02 39001918 > Internet: www.marionegri.it, mnegri at marionegri.it > > [[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 COMMENT
0
Entering edit mode
Dear Mark, thanks for your help. I followed your instructions and it worked great! Paraskevas -- Paraskevas Iatropoulos, MD Geneticist Clinical Research Centre for Rare Diseases ?ALDO E CELE DACCO? IRCCS - Mario Negri Institute for Pharmacological Research Via G.B. Camozzi, 3 Ranica (BG) - Italy e-mail: iatropoulos at marionegri.it ----- Messaggio originale ----- Da: "Mark Robinson" robinson at imls.uzh.ch> A: "Paraskevas Iatropoulos" <paraskevas.iatropoulos at="" marionegri.it=""> Cc: bioconductor at r-project.org Inviato: Mercoled?, 27 novembre 2013 20:59:35 Oggetto: Re: [BioC] edgeR - 3-dimensional Multidimensional scaling Dear Paraskevas, Maybe all you need is to set 'ndim=3' in your call to plotMDS() ? > However, the 2D plot obtained with cmdscale using the counts per million ( cpm ) is much different compared to that obtained with plotMDS . Have a careful read of: ?plotMDS.DGEList ?plotMDS In short, plotMDS() does something very different with a DGEList object than with a matrix of numbers. Then, maybe try something like: # Taken from the plotMDS.DGEList help page ngenes <- 1000 nlib <- 6 counts <- matrix(rnbinom(ngenes*nlib, size=1/10, mu=20),ngenes,nlib) rownames(counts) <- paste("Gene",1:ngenes) group <- gl(2,3,labels=c("Grp1","Grp2")) counts[1:200,group=="Grp2"] <- counts[1:200,group=="Grp2"] + 10 y <- DGEList(counts,group=group) y <- calcNormFactors(y) > mds <- plotMDS(y, top=200) > mds$cmdscale.out [,1] [,2] Sample1 0.6296663 2.11210712 Sample2 -3.2338291 -0.68439921 Sample3 2.1070395 0.06385855 Sample4 0.2781657 0.60249359 Sample5 0.9806977 -3.12230808 Sample6 -0.7617402 1.02824803 > mds <- plotMDS(y, top=200, ndim=3) > mds$cmdscale.out [,1] [,2] [,3] Sample1 0.6296663 2.11210712 -1.3976172 Sample2 -3.2338291 -0.68439921 1.2745170 Sample3 2.1070395 0.06385855 2.8492196 Sample4 0.2781657 0.60249359 -0.4326530 Sample5 0.9806977 -3.12230808 -1.5085139 Sample6 -0.7617402 1.02824803 -0.7849524 Note, you don't *need* to set the 'top' parameter. Then, just plot these in 3D. Hope that helps. Best, Mark ---------- Prof. Dr. Mark Robinson Bioinformatics, Institute of Molecular Life Sciences University of Zurich http://tiny.cc/mrobin On 27.11.2013, at 16:15, Paraskevas Iatropoulos <paraskevas.iatropoulos at="" marionegri.it=""> wrote: > > Hi! > > it would be of great help, if someone could suggest a solution to the following problem. I used edgeR to analyze RNA Seq expression data (3 different cell lineages with 2 biological replicates for each lineage). I used the plotMDS () function to get a 2D plot of multidimensional scaling. I was asked to perform a 3D plot but I am not able to find a solution > > According to Cell 151:559?575, where they report to perform 3D- MDS , and a web guide (Quick-R) I used the cmdscale () function as follows: > d <- dist( mydata ) # Calculate the euclidean distances between the rows > fit <- cmdscale (d, eig =TRUE, k=3) # k is the number of dimensions > x <- fit$points[,1] > y <- fit$points[,2] > z <- fit$points[,3] > Then I use the scatterplot3D software to obtain the grafic in 2D or 3D. > > However, the 2D plot obtained with cmdscale using the counts per million ( cpm ) is much different compared to that obtained with plotMDS . Moreover, the results with the above cmdscale procedure are strange from a biological point of view, so I suppose that I did something wrong. Since the dimensions in the edgeR graphic are "leading logFC ", I calculated the log2 fold-chage (log2 [ cpm of the replicate / average expression in all 6 samples]) and I get a 2D graphic very similar but not identical to edgeR . In this way I can also have a 3D plot. > > I am not sure if it is right to use the log2-FC to get. Do you think it is ok ? Is there a way to perform a 3D-MDS with edgeR ? Can you suggest me a way to perform the 3D- MDS , please? > > Thank you in advance. > > Paraskevas > > > > -- > Paraskevas Iatropoulos, MD > Geneticist > Clinical Research Centre for Rare Diseases ?ALDO E CELE DACCO ? > IRCCS - Mario Negri Institute for Pharmacological Research > Via G.B. Camozzi , 3 > Ranica ( BG ) - Italy > e-mail: iatropoulos @ marionegri .it > > ---------- > L'IRCCS - Istituto di Ricerche Farmacologiche Mario Negri desidera ringraziare i 13.768 donatori, di cui non conosce i nomi, che nel 2011 hanno devoluto il loro 5 per mille a sostegno della nostra attivit? e assicurare loro che tutto quanto ricevuto sar? esclusivamente impiegato per le nostre ricerche. Siamo naturalmente molto grati a tutti coloro che anche quest'anno hanno deciso di rinnovare ancora la fiducia nel nostro lavoro con la destinazione del loro 5 per mille. > > A coloro che stanno per farlo ricordiamo di firmare ed indicare il nostro codice fiscale > > 03254210150 > > nel riquadro "Finanziamento agli enti della ricerca scientifica e dell'universit?. > > Per maggiori informazioni: > > IRCCS - Istituto di Ricerche Farmacologiche Mario Negri, Via La Masa 19 - 20156 Milano > Tel: +39 02 390141 - Fax: +39 02 3546277 +39 02 39001918 > Internet: www.marionegri.it, mnegri at marionegri.it > > [[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 ---------- L'IRCCS - Istituto di Ricerche Farmacologiche Mario Negri desidera ringraziare i 13.768 donatori, di cui non conosce i nomi, che nel 2011 hanno devoluto il loro 5 per mille a sostegno della nostra attivit? e assicurare loro che tutto quanto ricevuto sar? esclusivamente impiegato per le nostre ricerche. Siamo naturalmente molto grati a tutti coloro che anche quest'anno hanno deciso di rinnovare ancora la fiducia nel nostro lavoro con la destinazione del loro 5 per mille. A coloro che stanno per farlo ricordiamo di firmare ed indicare il nostro codice fiscale 03254210150 nel riquadro "Finanziamento agli enti della ricerca scientifica e dell'universit?. Per maggiori informazioni: IRCCS - Istituto di Ricerche Farmacologiche Mario Negri, Via La Masa 19 - 20156 Milano Tel: +39 02 390141 - Fax: +39 02 3546277 +39 02 39001918 Internet: www.marionegri.it, mnegri at marionegri.it
ADD REPLY

Login before adding your answer.

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