Problems in MAplot for affybatch objects
1
0
Entering edit mode
@javier-perez-florido-3121
Last seen 6.8 years ago
Dear list, I am trying to use MAplot (affyPLM packages) using 2 arrays for the argument 'which' and the same arrays for the argument 'ref'. So /library(affyPLM) library(affydata) data(Dilution) # Dilution data set par(mfrow=c(2,1),1) MAplot(Dilution,which=c(1,3),ref=c(1,3),plot.method="smoothScatter") / I got the following warnings /Warning messages 1: In if (i != ref) { : the condition has length > 1 and only the first element will be used 2: In if (i != ref) { : the condition has length > 1 and only the first element will be used/ The reference mean array is not built and, thus, the MAplot is not correct However, the same piece of code on an expression set object works: / eset<-threestep(Dilution) par(mfrow=c(2,1),1) MAplot(eset,which=c(1,3),ref=c(1,3),plot.method="smoothScatter")/ What's the problem on affybatch objects? Thanks in advance, Javier [[alternative HTML version deleted]]
• 1.9k views
ADD COMMENT
0
Entering edit mode
Ben Bolstad ★ 1.2k
@ben-bolstad-1494
Last seen 7.3 years ago
Hi Javier, You have indeed found discrepant behavior that should be fixed. MAplot for ExpressionSet object is implemented in affyPLM, MAplot for AffyBatch objects is implemented in affy. So it is not really the same set of code being executed in each case. But the basic behavior was intended to be harmonious between the two. I will fix. Ben On Sat, 2010-04-10 at 16:47 +0200, Javier P?rez Florido wrote: > Dear list, > I am trying to use MAplot (affyPLM packages) using 2 arrays for the > argument 'which' and the same arrays for the argument 'ref'. > So > > /library(affyPLM) > library(affydata) > data(Dilution) # Dilution data set > par(mfrow=c(2,1),1) > MAplot(Dilution,which=c(1,3),ref=c(1,3),plot.method="smoothScatter") / > > I got the following warnings > > /Warning messages > 1: In if (i != ref) { : > the condition has length > 1 and only the first element will be used > 2: In if (i != ref) { : > the condition has length > 1 and only the first element will be used/ > > The reference mean array is not built and, thus, the MAplot is not correct > However, the same piece of code on an expression set object works: > / > eset<-threestep(Dilution) > par(mfrow=c(2,1),1) > MAplot(eset,which=c(1,3),ref=c(1,3),plot.method="smoothScatter")/ > > What's the problem on affybatch objects? > Thanks in advance, > Javier > > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > 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
Hi all, ? I'm looking at images of Affy arrays for QC using images(Affybatch) or images(affyPLMObject). However, when I include this images in PDF files these tend to get incredibly large. Therefore, my question would be, is there a method to generate a png or jpg image and include this in the pdf file? ? Any hints are highly appreciated, ? Kind regards, ? Mike
ADD REPLY
0
Entering edit mode
Hi Mike, Mike Walter wrote: > Hi all, > > > > I'm looking at images of Affy arrays for QC using images(Affybatch) > or images(affyPLMObject). However, when I include this images in PDF > files these tend to get incredibly large. Therefore, my question > would be, is there a method to generate a png or jpg image and > include this in the pdf file? The simple answer is yes. See ?png. But somehow I think the question is more involved than that. Rather than speculating as to what you want, do you have a more directed question with perhaps an example? Best, Jim > > > > Any hints are highly appreciated, > > > > Kind regards, > > > > Mike > > _______________________________________________ Bioconductor mailing > list Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor Search the > archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor -- James W. MacDonald, M.S. Biostatistician Douglas Lab University of Michigan Department of Human Genetics 5912 Buhl 1241 E. Catherine St. Ann Arbor MI 48109-5618 734-615-7826 ********************************************************** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues
ADD REPLY
0
Entering edit mode
Hi Jim, We are a core lab. So I'd like to generate a QC report for our customers with all kind of plots to judge the quality of the data. This includes e.g. density plots, boxplots before and after normalization, RNA degradation plots, PCA, MAS5 scaling factor, rel log expression etc. All these plots are quite small and you can easily just make a script that produces the pdf. However, when I use for example library(affyPLM) data = ReadAffy(celfile.path=celfile, filenames=filenames) qcPLM = fitPLM(data) pdf("QC_report.pdf", paper="a4", version="1.4") for (i in 1:length(data)){ image(qc.PLM, which=i, add.legend=TRUE, main=paste(sampleNames(data)[i], "weights", sep=" - ")) } dev.off() Then the pdf files become quite large. Of course, I can use png() or savepng() instead of pdf(), but then the files are not in my pdf file and I have to generate a pdf from the images manually and attach it to the QC report. Thus my question was: Can I generate a low resolution image that is then put forward to the pdf device. I already played a little bit with dev.print() and dev.copy() functions but had no real clue how to make it. I hope this makes my question a little bit clearer. Thanks for your help and kind regards, Mike -----Urspr?ngliche Nachricht----- Von: "James W. MacDonald" <jmacdon at="" med.umich.edu=""> Gesendet: 13.04.2010 15:27:32 An: Mike Walter <michael_walter at="" email.de=""> Betreff: Re: [BioC] Microarray image files in PDF files >Hi Mike, > >Mike Walter wrote: >> Hi all, >> >> >> >> I'm looking at images of Affy arrays for QC using images(Affybatch) >> or images(affyPLMObject). However, when I include this images in PDF >> files these tend to get incredibly large. Therefore, my question >> would be, is there a method to generate a png or jpg image and >> include this in the pdf file? > >The simple answer is yes. See ?png. But somehow I think the question is >more involved than that. Rather than speculating as to what you want, do >you have a more directed question with perhaps an example? > >Best, > >Jim > > >> >> >> >> Any hints are highly appreciated, >> >> >> >> Kind regards, >> >> >> >> Mike >> >> _______________________________________________ Bioconductor mailing >> list Bioconductor at stat.math.ethz.ch >> https://stat.ethz.ch/mailman/listinfo/bioconductor Search the >> archives: >> http://news.gmane.org/gmane.science.biology.informatics.conductor > >-- >James W. MacDonald, M.S. >Biostatistician >Douglas Lab >University of Michigan >Department of Human Genetics >5912 Buhl >1241 E. Catherine St. >Ann Arbor MI 48109-5618 >734-615-7826 >********************************************************** >Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues
ADD REPLY
0
Entering edit mode
Hi Mike, Mike Walter wrote: > Hi Jim, > > We are a core lab. So I'd like to generate a QC report for our > customers with all kind of plots to judge the quality of the data. > This includes e.g. density plots, boxplots before and after > normalization, RNA degradation plots, PCA, MAS5 scaling factor, rel > log expression etc. All these plots are quite small and you can > easily just make a script that produces the pdf. However, when I use > for example > > library(affyPLM) data = ReadAffy(celfile.path=celfile, > filenames=filenames) qcPLM = fitPLM(data) pdf("QC_report.pdf", > paper="a4", version="1.4") for (i in 1:length(data)){ image(qc.PLM, > which=i, add.legend=TRUE, main=paste(sampleNames(data)[i], "weights", > sep=" - ")) } dev.off() > > Then the pdf files become quite large. Of course, I can use png() or > savepng() instead of pdf(), but then the files are not in my pdf file > and I have to generate a pdf from the images manually and attach it > to the QC report. Thus my question was: Can I generate a low > resolution image that is then put forward to the pdf device. I > already played a little bit with dev.print() and dev.copy() functions > but had no real clue how to make it. > > I hope this makes my question a little bit clearer. Yep. I thought you were doing something like that. At one time I worked in a core lab as well, and I used Sweave to create all the reports I gave to my clients. The downside of using Sweave is that you have to learn LaTeX markup as well, but you end up with one document that contains all the verbiage that you give to your clients as well as the code to create the plots and do all the analysis. All of the BioC packages contain at least one vignette that is based on Sweave, so you can look in the /doc directory for anything with a .Rnw extension for an example. The affycoretools.Rnw file in my affycoretools package is an example of something similar to what I gave my clients. One slight problem with using Sweave is that the default for all plots is to use a pdf, which doesn't help your situation. There are more elegant ways to get around this obstacle, but I use the klugetastic method of creating the png file and then inserting it manually. As an example (which won't likely make sense just yet): <<echo=false, results="hide">>= png("thefile.png") image(qc.PLM, which=1, add.legend=TRUE, <otherargs>) dev.off() @ \begin{figure}[htbp] \centering \includegraphics{thefile} \caption{An image} \end{figure} The first part creates the image invisibly (tin the output file) and the second part puts it in the document. If you have multiple images, you can put them up four at a time using layout(matrix(1:4, ncol = 2, byrow = TRUE)) to save space. The various vignettes are an excellent resource to get started, and the main Sweave documentation can be found at: http://www.stat.uni-muenchen.de/~leisch/Sweave/ Best, Jim > > Thanks for your help and kind regards, > > Mike > > > > > > -----Urspr?ngliche Nachricht----- Von: "James W. MacDonald" > <jmacdon at="" med.umich.edu=""> Gesendet: 13.04.2010 15:27:32 An: Mike Walter > <michael_walter at="" email.de=""> Betreff: Re: [BioC] Microarray image files > in PDF files > >> Hi Mike, >> >> Mike Walter wrote: >>> Hi all, >>> >>> >>> >>> I'm looking at images of Affy arrays for QC using >>> images(Affybatch) or images(affyPLMObject). However, when I >>> include this images in PDF files these tend to get incredibly >>> large. Therefore, my question would be, is there a method to >>> generate a png or jpg image and include this in the pdf file? >> The simple answer is yes. See ?png. But somehow I think the >> question is more involved than that. Rather than speculating as to >> what you want, do you have a more directed question with perhaps an >> example? >> >> Best, >> >> Jim >> >> >>> >>> >>> Any hints are highly appreciated, >>> >>> >>> >>> Kind regards, >>> >>> >>> >>> Mike >>> >>> _______________________________________________ Bioconductor >>> mailing list Bioconductor at stat.math.ethz.ch >>> https://stat.ethz.ch/mailman/listinfo/bioconductor Search the >>> archives: >>> http://news.gmane.org/gmane.science.biology.informatics.conductor >>> >> -- James W. MacDonald, M.S. Biostatistician Douglas Lab University >> of Michigan Department of Human Genetics 5912 Buhl 1241 E. >> Catherine St. Ann Arbor MI 48109-5618 734-615-7826 >> ********************************************************** >> Electronic Mail is not secure, may not be read every day, and >> should not be used for urgent or sensitive issues -- James W. MacDonald, M.S. Biostatistician Douglas Lab University of Michigan Department of Human Genetics 5912 Buhl 1241 E. Catherine St. Ann Arbor MI 48109-5618 734-615-7826 ********************************************************** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues
ADD REPLY
0
Entering edit mode
We have sample QC templates for Affymetrix (and a rough draft for Illumina) at http://bioinformatics.mdanderson.org/RATb/ Just click on the "startTemplate.cgi" link. Keiv James W. MacDonald wrote: > Hi Mike, > > Mike Walter wrote: >> Hi Jim, >> >> We are a core lab. So I'd like to generate a QC report for our >> customers with all kind of plots to judge the quality of the data. >> This includes e.g. density plots, boxplots before and after >> normalization, RNA degradation plots, PCA, MAS5 scaling factor, rel >> log expression etc. All these plots are quite small and you can >> easily just make a script that produces the pdf. However, when I use >> for example >> >> library(affyPLM) data = ReadAffy(celfile.path=celfile, >> filenames=filenames) qcPLM = fitPLM(data) pdf("QC_report.pdf", >> paper="a4", version="1.4") for (i in 1:length(data)){ image(qc.PLM, >> which=i, add.legend=TRUE, main=paste(sampleNames(data)[i], "weights", >> sep=" - ")) } dev.off() >> >> Then the pdf files become quite large. Of course, I can use png() or >> savepng() instead of pdf(), but then the files are not in my pdf file >> and I have to generate a pdf from the images manually and attach it >> to the QC report. Thus my question was: Can I generate a low >> resolution image that is then put forward to the pdf device. I >> already played a little bit with dev.print() and dev.copy() functions >> but had no real clue how to make it. >> >> I hope this makes my question a little bit clearer. > > Yep. I thought you were doing something like that. At one time I > worked in a core lab as well, and I used Sweave to create all the > reports I gave to my clients. > > The downside of using Sweave is that you have to learn LaTeX markup as > well, but you end up with one document that contains all the verbiage > that you give to your clients as well as the code to create the plots > and do all the analysis. > > All of the BioC packages contain at least one vignette that is based > on Sweave, so you can look in the /doc directory for anything with a > .Rnw extension for an example. The affycoretools.Rnw file in my > affycoretools package is an example of something similar to what I > gave my clients. > > One slight problem with using Sweave is that the default for all plots > is to use a pdf, which doesn't help your situation. There are more > elegant ways to get around this obstacle, but I use the klugetastic > method of creating the png file and then inserting it manually. As an > example (which won't likely make sense just yet): > > <<echo=false, results="hide">>= > png("thefile.png") > image(qc.PLM, which=1, add.legend=TRUE, <otherargs>) > dev.off() > @ > > \begin{figure}[htbp] > \centering > \includegraphics{thefile} > \caption{An image} > \end{figure} > > The first part creates the image invisibly (tin the output file) and > the second part puts it in the document. If you have multiple images, > you can put them up four at a time using layout(matrix(1:4, ncol = 2, > byrow = TRUE)) to save space. > > The various vignettes are an excellent resource to get started, and > the main Sweave documentation can be found at: > > http://www.stat.uni-muenchen.de/~leisch/Sweave/ > > Best, > > Jim > > >> >> Thanks for your help and kind regards, >> >> Mike >> >> >> >> >> >> -----Urspr?ngliche Nachricht----- Von: "James W. MacDonald" >> <jmacdon at="" med.umich.edu=""> Gesendet: 13.04.2010 15:27:32 An: Mike Walter >> <michael_walter at="" email.de=""> Betreff: Re: [BioC] Microarray image files >> in PDF files >> >>> Hi Mike, >>> >>> Mike Walter wrote: >>>> Hi all, >>>> >>>> >>>> >>>> I'm looking at images of Affy arrays for QC using >>>> images(Affybatch) or images(affyPLMObject). However, when I >>>> include this images in PDF files these tend to get incredibly >>>> large. Therefore, my question would be, is there a method to >>>> generate a png or jpg image and include this in the pdf file? >>> The simple answer is yes. See ?png. But somehow I think the >>> question is more involved than that. Rather than speculating as to >>> what you want, do you have a more directed question with perhaps an >>> example? >>> >>> Best, >>> >>> Jim >>> >>> >>>> >>>> >>>> Any hints are highly appreciated, >>>> >>>> >>>> >>>> Kind regards, >>>> >>>> >>>> >>>> Mike >>>> >>>> _______________________________________________ Bioconductor >>>> mailing list Bioconductor at stat.math.ethz.ch >>>> https://stat.ethz.ch/mailman/listinfo/bioconductor Search the >>>> archives: >>>> http://news.gmane.org/gmane.science.biology.informatics.conductor >>>> >>> -- James W. MacDonald, M.S. Biostatistician Douglas Lab University >>> of Michigan Department of Human Genetics 5912 Buhl 1241 E. >>> Catherine St. Ann Arbor MI 48109-5618 734-615-7826 >>> ********************************************************** >>> Electronic Mail is not secure, may not be read every day, and >>> should not be used for urgent or sensitive issues >
ADD REPLY
0
Entering edit mode
I haven't used it myself, but the modified Sweave driver on http://sites.google.com/site/thibautjombart/r-packages may be of interest. b On Tue, Apr 13, 2010 at 4:22 PM, James W. MacDonald <jmacdon at="" med.umich.edu=""> wrote: > Hi Mike, > > Mike Walter wrote: >> >> Hi Jim, >> >> We are a core lab. So I'd like to generate a QC report for our >> customers with all kind of plots to judge the quality of the data. >> This includes e.g. density plots, boxplots before and after >> normalization, RNA degradation plots, PCA, MAS5 scaling factor, rel >> log expression etc. All these plots are quite small and you can >> easily just make a script that produces the pdf. However, when I use >> for example >> >> library(affyPLM) data = ReadAffy(celfile.path=celfile, >> filenames=filenames) qcPLM = fitPLM(data) pdf("QC_report.pdf", >> paper="a4", version="1.4") for (i in 1:length(data)){ image(qc.PLM, >> which=i, add.legend=TRUE, main=paste(sampleNames(data)[i], "weights", >> sep=" - ")) } dev.off() >> >> Then the pdf files become quite large. Of course, I can use png() or >> savepng() instead of pdf(), but then the files are not in my pdf file >> and I have to generate a pdf from the images manually and attach it >> to the QC report. Thus my question was: Can I generate a low >> resolution image that is then put forward to the pdf device. I >> already played a little bit with dev.print() and dev.copy() functions >> but had no real clue how to make it. >> >> I hope this makes my question a little bit clearer. > > Yep. I thought you were doing something like that. At one time I worked in a > core lab as well, and I used Sweave to create all the reports I gave to my > clients. > > The downside of using Sweave is that you have to learn LaTeX markup as well, > but you end up with one document that contains all the verbiage that you > give to your clients as well as the code to create the plots and do all the > analysis. > > All of the BioC packages contain at least one vignette that is based on > Sweave, so you can look in the /doc directory for anything with a .Rnw > extension for an example. The affycoretools.Rnw file in my affycoretools > package is an example of something similar to what I gave my clients. > > One slight problem with using Sweave is that the default for all plots is to > use a pdf, which doesn't help your situation. There are more elegant ways to > get around this obstacle, but I use the klugetastic method of creating the > png file and then inserting it manually. As an example (which won't likely > make sense just yet): > > <<echo=false, results="hide">>= > png("thefile.png") > image(qc.PLM, which=1, add.legend=TRUE, <otherargs>) > dev.off() > @ > > \begin{figure}[htbp] > \centering > \includegraphics{thefile} > \caption{An image} > \end{figure} > > The first part creates the image invisibly (tin the output file) and the > second part puts it in the document. If you have multiple images, you can > put them up four at a time using layout(matrix(1:4, ncol = 2, byrow = TRUE)) > to save space. > > The various vignettes are an excellent resource to get started, and the main > Sweave documentation can be found at: > > http://www.stat.uni-muenchen.de/~leisch/Sweave/ > > Best, > > Jim > > >> >> Thanks for your help and kind regards, >> >> Mike >> >> >> >> >> >> -----Urspr?ngliche Nachricht----- Von: "James W. MacDonald" >> <jmacdon at="" med.umich.edu=""> Gesendet: 13.04.2010 15:27:32 An: Mike Walter >> <michael_walter at="" email.de=""> Betreff: Re: [BioC] Microarray image files >> in PDF files >> >>> Hi Mike, >>> >>> Mike Walter wrote: >>>> >>>> Hi all, >>>> >>>> >>>> >>>> I'm looking at images of Affy arrays for QC using >>>> images(Affybatch) or images(affyPLMObject). However, when I >>>> include this images in PDF files these tend to get incredibly >>>> large. Therefore, my question would be, is there a method to >>>> generate a png or jpg image and include this in the pdf file? >>> >>> The simple answer is yes. See ?png. But somehow I think the >>> question is more involved than that. Rather than speculating as to >>> what you want, do you have a more directed question with perhaps an >>> example? >>> >>> Best, >>> >>> Jim >>> >>> >>>> >>>> >>>> Any hints are highly appreciated, >>>> >>>> >>>> >>>> Kind regards, >>>> >>>> >>>> >>>> Mike >>>> >>>> _______________________________________________ Bioconductor >>>> mailing list Bioconductor at stat.math.ethz.ch >>>> https://stat.ethz.ch/mailman/listinfo/bioconductor Search the archives: >>>> http://news.gmane.org/gmane.science.biology.informatics.conductor >>>> >>> -- James W. MacDonald, M.S. Biostatistician Douglas Lab University >>> of Michigan Department of Human Genetics 5912 Buhl 1241 E. >>> Catherine St. Ann Arbor MI 48109-5618 734-615-7826 >>> ********************************************************** Electronic Mail >>> is not secure, may not be read every day, and >>> should not be used for urgent or sensitive issues > > -- > James W. MacDonald, M.S. > Biostatistician > Douglas Lab > University of Michigan > Department of Human Genetics > 5912 Buhl > 1241 E. Catherine St. > Ann Arbor MI 48109-5618 > 734-615-7826 > ********************************************************** > Electronic Mail is not secure, may not be read every day, and should not be > used for urgent or sensitive issues > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > 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
Hi all, Thanks for your help. So I will try to get a grip on Sweave and Latex. The alternativ Sweave sounds pretty good, but gives an error message, when I try to source it (error message and sessionInfo below). I will get back to you if I manage to make the pdfs. Kind regards, Mike > source("Sweave.R") Error in source("Sweave.R") : Sweave.R:2:1: unexpected $end > sessionInfo() R version 2.10.0 (2009-10-26) i386-pc-mingw32 locale: [1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 [3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C [5] LC_TIME=German_Germany.1252 attached base packages: [1] utils stats graphics grDevices datasets methods base loaded via a namespace (and not attached): [1] tools_2.10.0 -----Urspr?ngliche Nachricht----- Von: "James W. MacDonald" <jmacdon at="" med.umich.edu=""> Gesendet: 13.04.2010 17:22:32 An: Mike Walter <michael_walter at="" email.de=""> Betreff: Re: [BioC] Microarray image files in PDF files >Hi Mike, > >Mike Walter wrote: >> Hi Jim, >> >> We are a core lab. So I'd like to generate a QC report for our >> customers with all kind of plots to judge the quality of the data. >> This includes e.g. density plots, boxplots before and after >> normalization, RNA degradation plots, PCA, MAS5 scaling factor, rel >> log expression etc. All these plots are quite small and you can >> easily just make a script that produces the pdf. However, when I use >> for example >> >> library(affyPLM) data = ReadAffy(celfile.path=celfile, >> filenames=filenames) qcPLM = fitPLM(data) pdf("QC_report.pdf", >> paper="a4", version="1.4") for (i in 1:length(data)){ image(qc.PLM, >> which=i, add.legend=TRUE, main=paste(sampleNames(data)[i], "weights", >> sep=" - ")) } dev.off() >> >> Then the pdf files become quite large. Of course, I can use png() or >> savepng() instead of pdf(), but then the files are not in my pdf file >> and I have to generate a pdf from the images manually and attach it >> to the QC report. Thus my question was: Can I generate a low >> resolution image that is then put forward to the pdf device. I >> already played a little bit with dev.print() and dev.copy() functions >> but had no real clue how to make it. >> >> I hope this makes my question a little bit clearer. > >Yep. I thought you were doing something like that. At one time I worked >in a core lab as well, and I used Sweave to create all the reports I >gave to my clients. > >The downside of using Sweave is that you have to learn LaTeX markup as >well, but you end up with one document that contains all the verbiage >that you give to your clients as well as the code to create the plots >and do all the analysis. > >All of the BioC packages contain at least one vignette that is based on >Sweave, so you can look in the /doc directory for anything with a .Rnw >extension for an example. The affycoretools.Rnw file in my affycoretools >package is an example of something similar to what I gave my clients. > >One slight problem with using Sweave is that the default for all plots >is to use a pdf, which doesn't help your situation. There are more >elegant ways to get around this obstacle, but I use the klugetastic >method of creating the png file and then inserting it manually. As an >example (which won't likely make sense just yet): > ><<echo=false, results="hide">>= >png("thefile.png") >image(qc.PLM, which=1, add.legend=TRUE, <otherargs>) >dev.off() >@ > >\begin{figure}[htbp] >\centering >\includegraphics{thefile} >\caption{An image} >\end{figure} > >The first part creates the image invisibly (tin the output file) and the >second part puts it in the document. If you have multiple images, you >can put them up four at a time using layout(matrix(1:4, ncol = 2, byrow >= TRUE)) to save space. > >The various vignettes are an excellent resource to get started, and the >main Sweave documentation can be found at: > >http://www.stat.uni-muenchen.de/~leisch/Sweave/ > >Best, > >Jim > > >> >> Thanks for your help and kind regards, >> >> Mike >> >> >> >> >> >> -----Urspr?ngliche Nachricht----- Von: "James W. MacDonald" >> <jmacdon at="" med.umich.edu=""> Gesendet: 13.04.2010 15:27:32 An: Mike Walter >> <michael_walter at="" email.de=""> Betreff: Re: [BioC] Microarray image files >> in PDF files >> >>> Hi Mike, >>> >>> Mike Walter wrote: >>>> Hi all, >>>> >>>> >>>> >>>> I'm looking at images of Affy arrays for QC using >>>> images(Affybatch) or images(affyPLMObject). However, when I >>>> include this images in PDF files these tend to get incredibly >>>> large. Therefore, my question would be, is there a method to >>>> generate a png or jpg image and include this in the pdf file? >>> The simple answer is yes. See ?png. But somehow I think the >>> question is more involved than that. Rather than speculating as to >>> what you want, do you have a more directed question with perhaps an >>> example? >>> >>> Best, >>> >>> Jim >>> >>> >>>> >>>> >>>> Any hints are highly appreciated, >>>> >>>> >>>> >>>> Kind regards, >>>> >>>> >>>> >>>> Mike >>>> >>>> _______________________________________________ Bioconductor >>>> mailing list Bioconductor at stat.math.ethz.ch >>>> https://stat.ethz.ch/mailman/listinfo/bioconductor Search the >>>> archives: >>>> http://news.gmane.org/gmane.science.biology.informatics.conductor >>>> >>> -- James W. MacDonald, M.S. Biostatistician Douglas Lab University >>> of Michigan Department of Human Genetics 5912 Buhl 1241 E. >>> Catherine St. Ann Arbor MI 48109-5618 734-615-7826 >>> ********************************************************** >>> Electronic Mail is not secure, may not be read every day, and >>> should not be used for urgent or sensitive issues > >-- >James W. MacDonald, M.S. >Biostatistician >Douglas Lab >University of Michigan >Department of Human Genetics >5912 Buhl >1241 E. Catherine St. >Ann Arbor MI 48109-5618 >734-615-7826 >********************************************************** >Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues
ADD REPLY
0
Entering edit mode
Thibaut Jombard is the best person to contact about this. b On Thu, Apr 15, 2010 at 8:27 AM, Mike Walter <michael_walter at="" email.de=""> wrote: > Hi all, > > Thanks for your help. So I will try to get a grip on Sweave and Latex. The alternativ Sweave sounds pretty good, but gives an error message, when I try to source it (error message and sessionInfo below). I will get back to you if I manage to make the pdfs. > > Kind regards, > > Mike > >> source("Sweave.R") > Error in source("Sweave.R") : Sweave.R:2:1: unexpected $end > >> sessionInfo() > R version 2.10.0 (2009-10-26) > i386-pc-mingw32 > > locale: > [1] LC_COLLATE=German_Germany.1252 ?LC_CTYPE=German_Germany.1252 > [3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C > [5] LC_TIME=German_Germany.1252 > > attached base packages: > [1] utils ? ? stats ? ? graphics ?grDevices datasets ?methods ? base > > loaded via a namespace (and not attached): > [1] tools_2.10.0 > > > > -----Urspr?ngliche Nachricht----- > Von: "James W. MacDonald" <jmacdon at="" med.umich.edu=""> > Gesendet: 13.04.2010 17:22:32 > An: Mike Walter <michael_walter at="" email.de=""> > Betreff: Re: [BioC] Microarray image files in PDF files > >>Hi Mike, >> >>Mike Walter wrote: >>> Hi Jim, >>> >>> We are a core lab. So I'd like to generate a QC report for our >>> customers with all kind of plots to judge the quality of the data. >>> This includes e.g. density plots, boxplots before and after >>> normalization, RNA degradation plots, PCA, MAS5 scaling factor, rel >>> log expression etc. All these plots are quite small and you can >>> easily just make a script that produces the pdf. However, when I use >>> for example >>> >>> library(affyPLM) data = ReadAffy(celfile.path=celfile, >>> filenames=filenames) qcPLM = fitPLM(data) pdf("QC_report.pdf", >>> paper="a4", version="1.4") for (i in 1:length(data)){ image(qc.PLM, >>> which=i, add.legend=TRUE, main=paste(sampleNames(data)[i], "weights", >>> sep=" - ")) } dev.off() >>> >>> Then the pdf files become quite large. Of course, I can use png() or >>> savepng() instead of pdf(), but then the files are not in my pdf file >>> and I have to generate a pdf from the images manually and attach it >>> to the QC report. Thus my question was: Can I generate a low >>> resolution image that is then put forward to the pdf device. I >>> already played a little bit with dev.print() and dev.copy() functions >>> but had no real clue how to make it. >>> >>> I hope this makes my question a little bit clearer. >> >>Yep. I thought you were doing something like that. At one time I worked >>in a core lab as well, and I used Sweave to create all the reports I >>gave to my clients. >> >>The downside of using Sweave is that you have to learn LaTeX markup as >>well, but you end up with one document that contains all the verbiage >>that you give to your clients as well as the code to create the plots >>and do all the analysis. >> >>All of the BioC packages contain at least one vignette that is based on >>Sweave, so you can look in the /doc directory for anything with a .Rnw >>extension for an example. The affycoretools.Rnw file in my affycoretools >>package is an example of something similar to what I gave my clients. >> >>One slight problem with using Sweave is that the default for all plots >>is to use a pdf, which doesn't help your situation. There are more >>elegant ways to get around this obstacle, but I use the klugetastic >>method of creating the png file and then inserting it manually. As an >>example (which won't likely make sense just yet): >> >><<echo=false, results="hide">>= >>png("thefile.png") >>image(qc.PLM, which=1, add.legend=TRUE, <otherargs>) >>dev.off() >>@ >> >>\begin{figure}[htbp] >>\centering >>\includegraphics{thefile} >>\caption{An image} >>\end{figure} >> >>The first part creates the image invisibly (tin the output file) and the >>second part puts it in the document. If you have multiple images, you >>can put them up four at a time using layout(matrix(1:4, ncol = 2, byrow >>= TRUE)) to save space. >> >>The various vignettes are an excellent resource to get started, and the >>main Sweave documentation can be found at: >> >>http://www.stat.uni-muenchen.de/~leisch/Sweave/ >> >>Best, >> >>Jim >> >> >>> >>> Thanks for your help and kind regards, >>> >>> Mike >>> >>> >>> >>> >>> >>> -----Urspr?ngliche Nachricht----- Von: "James W. MacDonald" >>> <jmacdon at="" med.umich.edu=""> Gesendet: 13.04.2010 15:27:32 An: Mike Walter >>> <michael_walter at="" email.de=""> Betreff: Re: [BioC] Microarray image files >>> in PDF files >>> >>>> Hi Mike, >>>> >>>> Mike Walter wrote: >>>>> Hi all, >>>>> >>>>> >>>>> >>>>> I'm looking at images of Affy arrays for QC using >>>>> images(Affybatch) or images(affyPLMObject). However, when I >>>>> include this images in PDF files these tend to get incredibly >>>>> large. Therefore, my question would be, is there a method to >>>>> generate a png or jpg image and include this in the pdf file? >>>> The simple answer is yes. See ?png. But somehow I think the >>>> question is more involved than that. Rather than speculating as to >>>> what you want, do you have a more directed question with perhaps an >>>> example? >>>> >>>> Best, >>>> >>>> Jim >>>> >>>> >>>>> >>>>> >>>>> Any hints are highly appreciated, >>>>> >>>>> >>>>> >>>>> Kind regards, >>>>> >>>>> >>>>> >>>>> Mike >>>>> >>>>> _______________________________________________ Bioconductor >>>>> mailing list Bioconductor at stat.math.ethz.ch >>>>> https://stat.ethz.ch/mailman/listinfo/bioconductor Search the >>>>> archives: >>>>> http://news.gmane.org/gmane.science.biology.informatics.conductor >>>>> >>>> -- James W. MacDonald, M.S. Biostatistician Douglas Lab University >>>> of Michigan Department of Human Genetics 5912 Buhl 1241 E. >>>> Catherine St. Ann Arbor MI 48109-5618 734-615-7826 >>>> ********************************************************** >>>> Electronic Mail is not secure, may not be read every day, and >>>> should not be used for urgent or sensitive issues >> >>-- >>James W. MacDonald, M.S. >>Biostatistician >>Douglas Lab >>University of Michigan >>Department of Human Genetics >>5912 Buhl >>1241 E. Catherine St. >>Ann Arbor MI 48109-5618 >>734-615-7826 >>********************************************************** >>Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues >
ADD REPLY
0
Entering edit mode
Dear Mike, try replacing the call to 'image' with 'grid.raster' from the grid package. This decreases file size, e.g. when sent to a PDF file, enormously. It also plots much quicker on an interactive device. See also http://developer.r-project.org/Raster/raster-RFC.html As Jim and Kevin pointed out, for creating a report with many plots, consider using LaTeX (e.g. 'pdflatex' with the 'graphicx' package), which allows integrating PNG and other bitmap formats into a complex PDF document. The 'EBImage' package might also provide relevant functionality for manipulating images (e.g. downsampling) and I/O. Best wishes Wolfgang Mike Walter ha scritto: > Hi all, > > > > I'm looking at images of Affy arrays for QC using images(Affybatch) or images(affyPLMObject). However, when I include this images in PDF files these tend to get incredibly large. Therefore, my question would be, is there a method to generate a png or jpg image and include this in the pdf file? > > > > Any hints are highly appreciated, > > > > Kind regards, > > > > Mike > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- Wolfgang Huber EMBL http://www.embl.de/research/units/genome_biology/huber
ADD REPLY
0
Entering edit mode
Dear Ben, I've installed the new version of both R and affyPLM package (1.24), but the problem is still there.... Thanks, Javier On 10/04/2010 21:51, Ben Bolstad wrote: > Hi Javier, > > You have indeed found discrepant behavior that should be fixed. MAplot > for ExpressionSet object is implemented in affyPLM, MAplot for AffyBatch > objects is implemented in affy. So it is not really the same set of code > being executed in each case. But the basic behavior was intended to be > harmonious between the two. I will fix. > > Ben > > > > > On Sat, 2010-04-10 at 16:47 +0200, Javier P?rez Florido wrote: > >> Dear list, >> I am trying to use MAplot (affyPLM packages) using 2 arrays for the >> argument 'which' and the same arrays for the argument 'ref'. >> So >> >> /library(affyPLM) >> library(affydata) >> data(Dilution) # Dilution data set >> par(mfrow=c(2,1),1) >> MAplot(Dilution,which=c(1,3),ref=c(1,3),plot.method="smoothScatter") / >> >> I got the following warnings >> >> /Warning messages >> 1: In if (i != ref) { : >> the condition has length> 1 and only the first element will be used >> 2: In if (i != ref) { : >> the condition has length> 1 and only the first element will be used/ >> >> The reference mean array is not built and, thus, the MAplot is not correct >> However, the same piece of code on an expression set object works: >> / >> eset<-threestep(Dilution) >> par(mfrow=c(2,1),1) >> MAplot(eset,which=c(1,3),ref=c(1,3),plot.method="smoothScatter")/ >> >> What's the problem on affybatch objects? >> Thanks in advance, >> Javier >> >> >> [[alternative HTML version deleted]] >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor at stat.math.ethz.ch >> 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: 553 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