Closed 3H2ORZ closed 4 years ago
Hi @3H2ORZ,
nice to hear that you like our tool! Are you using the Shiny app for plotting or the R command line?
Best, Tobi
@tobiaskoI guess there is a ggplot option or function to fix that.
Hi Tobi,
Thanks for reaching out. I am using the R command line to generate the pdf file.
Best, RZheng.
Hi 3H2ORZ
Since you are using the R command line, I suggest you go with the following approach:
Load your data, create a nested data.frame
, apply the plot function on your nested data.frame
, save as pdf.
I wrote a small test script using the Data included in the package repository PXD006932.Exp3A
res <- PXD006932.Exp3A %>%
dplyr::ungroup() %>%
ScanFrequMovingOver(.) %>%
dplyr::filter(Type == "ms2")
nest_plots <- res %>%
dplyr::group_by(filename) %>%
tidyr::nest() %>%
dplyr::mutate(plot =purrr::map2(data, filename, ~ggplot(data = .x) +
geom_line(aes(x = Time, y = Frequency)) +
scale_x_continuous(breaks = scales::pretty_breaks(8))+
scale_y_continuous(breaks = scales::pretty_breaks(8))+
ggtitle(.y) +
labs(subtitle = "Plotting number of MS2 per second against retention time") +
labs(x = "Retention Time [min]", y = "Scan Frequency [Hz]") +
theme_light()))
pdf("test_export.pdf")
print(nest_plots$plot)
dev.off()
this resulted in a pdf with 24 separate plots each on a single page (see attachement).
Best Christisn test_export.pdf
Hi @3H2ORZ
have you tried the suggested solution? Did it work?
best Christian
Hi Christian,
I tried it several times, but it looked like the function ScanFrequMovingOver cannot be called in my R. It reported: Error in ScanFrequMovingOver(.) : could not find function "ScanFrequMovingOver". Then I used: rawDiag:::ScanFrequMovingOver(.), to successfully call it. I will try to use this method to apply to the other plots.
Thanks for the quick response and your kindest help.
Best, RZheng.
Thanks for developing this great tool! I have 20 raw files to read, plot and export as PDF. Some functions (e.g, cycle time plot) stack all these files together in one page of PDF, which are not readable in the end. Is there a solution to split one into several pages?![image](https://user-images.githubusercontent.com/63189278/81682525-2c06de00-9455-11ea-8e8f-59aebe562729.png)