Help: Slow Loading pdfs Produced by 'plot'
1
0
Entering edit mode
M. Jankowski ▴ 160
@m-jankowski-2199
Last seen 10.3 years ago
Before I ask my question I just want to say how impressed I am with R, Bioconductor, the packages, and the helpful community here! Ok, on to the question. I run this code with the command "R CMD SWEAVE *.Snw": > library("flowCore") > x <- read.FCS("/home/mdj/data/yifacs2/NL7_PHA03_1.fcs", transformation = FALSE, + alter.names = TRUE) > print(summary(x)) #This looks just fine but does not look pretty in text format. y = Subset(x,rectangleGate("FSC.H",c(52,2000), "SSC.H",=c(52,2000))) plot(y) #This also looks fine but the resulting *.pdf or figure must be massive. It takes a full minute, albeit on my 4 year old computer, to load the *.pdf. This problem occurs whether or not I run the code in Sweave or on the command line. Where and how do I change the settings to adjust how large the *.pdf's get (assuming size is the problem)? There is a ton of data on the plot, is there some way to generate a pdf that looks the same but takes up much less space/loading time? Thanks again in advance. Let me know if there is a better place for me to ask this question. Thanks! Matt
• 1.7k views
ADD COMMENT
0
Entering edit mode
Seth Falcon ★ 7.4k
@seth-falcon-992
Last seen 10.3 years ago
"M. Jankowski" <mjankowski at="" gmail.com=""> writes: > y = Subset(x,rectangleGate("FSC.H",c(52,2000), "SSC.H",=c(52,2000))) > plot(y) > #This also looks fine but the resulting *.pdf or figure must be > massive. It takes a full minute, albeit on my 4 year old computer, to > load the *.pdf. This problem occurs whether or not I run the code in > Sweave or on the command line. > > Where and how do I change the settings to adjust how large the *.pdf's > get (assuming size is the problem)? There is a ton of data on the > plot, is there some way to generate a pdf that looks the same but > takes up much less space/loading time? You can take two approaches to produce graphics with a smaller output file size: 1. Plot fewer points. 2. Switch to a bitmap rather than vector based graphics format (e.g. jpg, png). For approach (1), you might consider a function like smoothScatter (should be in the geneplotter package). For approach (2), see the help pages for the relevant graphics devices. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org
ADD COMMENT
0
Entering edit mode
Actually, the standard plot for flowCore already uses smoothScatter so that's already been done. The same is also true of flowViz (although you can turn it off in flowViz) and neither should be producing particularly massive pdfs. If the data are not HIPPA restricted it might be interesting to see if there's something pathological about your data (aside from the disease of course...) that might explain it and let us perhaps track down a plotting bug. Failing that, Seth's first suggestion is also relevant and can be accomplished using (what else) but a sampleFilter(). This is just another filter, like rectangleGate, that returns a small subset of the data. You may need to use flowCore:::sampleFilter rather than just sampleFilter due to an oversight in the NAMESPACE file, but it is available in all versions of flowCore. Just give it a number of events and you're off to the races (it can be used in Subset commands just like rectangleGate). On 6/20/07, Seth Falcon <sfalcon at="" fhcrc.org=""> wrote: > "M. Jankowski" <mjankowski at="" gmail.com=""> writes: > > y = Subset(x,rectangleGate("FSC.H",c(52,2000), "SSC.H",=c(52,2000))) > > plot(y) > > #This also looks fine but the resulting *.pdf or figure must be > > massive. It takes a full minute, albeit on my 4 year old computer, to > > load the *.pdf. This problem occurs whether or not I run the code in > > Sweave or on the command line. > > > > Where and how do I change the settings to adjust how large the *.pdf's > > get (assuming size is the problem)? There is a ton of data on the > > plot, is there some way to generate a pdf that looks the same but > > takes up much less space/loading time? > > You can take two approaches to produce graphics with a smaller output > file size: > > 1. Plot fewer points. > > 2. Switch to a bitmap rather than vector based graphics format > (e.g. jpg, png). > > For approach (1), you might consider a function like smoothScatter > (should be in the geneplotter package). > > For approach (2), see the help pages for the relevant graphics > devices. > > + seth > > -- > Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center > http://bioconductor.org > > _______________________________________________ > 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 > -- Byron Ellis (byron.ellis at gmail.com) "Oook" -- The Librarian
ADD REPLY
0
Entering edit mode
> > > > You can take two approaches to produce graphics with a smaller output > > file size: > > > > 1. Plot fewer points. > > > > 2. Switch to a bitmap rather than vector based graphics format > > (e.g. jpg, png). > > > > For approach (1), you might consider a function like smoothScatter > > (should be in the geneplotter package). > > > > For approach (2), see the help pages for the relevant graphics > > devices. > > > > + seth I'll give sampleFilter a try and also see if I can work from something like a *.jpg or *.png format. How, provided I am not HIPAA restricted (looking into that), would I get the data to the group? Would I just attach it to an email? Thanks! Matt
ADD REPLY
0
Entering edit mode
On 6/20/07, M. Jankowski <mjankowski at="" gmail.com=""> wrote: > > > > > > You can take two approaches to produce graphics with a smaller output > > > file size: > > > > > > 1. Plot fewer points. > > > > > > 2. Switch to a bitmap rather than vector based graphics format > > > (e.g. jpg, png). > > > > > > For approach (1), you might consider a function like smoothScatter > > > (should be in the geneplotter package). > > > > > > For approach (2), see the help pages for the relevant graphics > > > devices. > > > > > > + seth > > I'll give sampleFilter a try and also see if I can work from something > like a *.jpg or *.png format. How, provided I am not HIPAA restricted > (looking into that), would I get the data to the group? Would I just > attach it to an email? Email should be a last resort; it's better if you can put it up on a website somewhere. You should also see if you can reproduce your problems with the GvHD dataset that is already available in flowCore. -Deepayan
ADD REPLY

Login before adding your answer.

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