Generate the plots into a single pdf
Usage
Utility_Patchwork(
x,
filename,
outfolder,
thecolumns = 2,
therows = 3,
width = 7,
height = 9,
returntype = "pdf",
NotListofList = TRUE
)
Arguments
- x
A list of plots
- filename
Name to save the .pdf as
- outfolder
Location to save the .pdf
- thecolumns
The number of columns per page
- therows
The number of rows per page
- width
Desired page width
- height
Desired page height
- returntype
Whether to return "pdf" (to desired location) or "patchwork" (to R)
- NotListofList
Internal default is True, don't touch.
Examples
library(flowCore)
library(flowWorkspace)
library(openCyto)
library(data.table)
File_Location <- system.file("extdata", package = "Luciernaga")
FCS_Files <- list.files(path = File_Location, pattern = ".fcs",
full.names = TRUE)
UnstainedFCSFiles <- FCS_Files[grep("Unstained", FCS_Files)]
UnstainedCells <- UnstainedFCSFiles[-grep("Beads", UnstainedFCSFiles)]
MyCytoSet <- load_cytoset_from_fcs(UnstainedCells[1:3],
truncate_max_range = FALSE,transformation = FALSE)
MyGatingSet <- GatingSet(MyCytoSet)
MyGates <- fread(file.path(path = File_Location, pattern = 'Gates.csv'))
MyGatingTemplate <- gatingTemplate(MyGates)
#> Adding population:singletsFSC
#> Adding population:singletsSSC
#> Adding population:singletsSSCB
#> Adding population:nonDebris
#> Adding population:lymphocytes
gt_gating(MyGatingTemplate, MyGatingSet)
#> Gating for 'singletsFSC'
#> done!
#> done.
#> Gating for 'singletsSSC'
#> done!
#> done.
#> Gating for 'singletsSSCB'
#> done!
#> done.
#> Gating for 'nonDebris'
#> done!
#> done.
#> Gating for 'lymphocytes'
#> The prior specification has no effect when usePrior=no
#> Using the serial version of flowClust
#> The prior specification has no effect when usePrior=no
#> Using the serial version of flowClust
#> The prior specification has no effect when usePrior=no
#> Using the serial version of flowClust
#> done!
#> done.
#> finished.
removestrings <- c("DR_", "Cells", ".fcs", "-", " ")
StorageLocation <- file.path("C:", "Users", "JohnDoe", "Desktop")
AllSpecimens <- Utility_IterativeGating(x=MyGatingSet[1:3],
sample.name = "GUID", removestrings = removestrings,
subset = "nonDebris", gate = "lymphocytes", xValue = "FSC-A",
yValue = "SSC-A", bins = 270)
Patchwork <- Utility_Patchwork(AllSpecimens, "LymphocyteGates",
outfolder=StorageLocation, thecolumns=2, therows=2,
width = 7, height = 9, returntype="patchwork")