Generate NxN plots for one or all fluorophores.
Usage
Utility_NbyNPlots(
x,
sample.name,
removestrings,
experiment = NULL,
experiment.name = NULL,
condition = NULL,
condition.name = NULL,
marginsubset,
gatesubset,
ycolumn,
bins,
clearance,
gatelines,
reference = NULL,
outpath,
returntype,
width = 9,
height = 7
)
Arguments
- x
A GatingSet object (ex. gs or gs[[1]])
- sample.name
Keyword for which samples names are stored (ex. "GUID")
- removestrings
A string of characters to remove from name ( ex. c("DR_ILT_2023_", "Cord"))
- experiment
Provide directly an experiment name (ex. "Jan2024")
- experiment.name
Keyword for which experiment name is stored ( ex. "GROUPNAME")
- condition
Provide a condition name
- condition.name
The keyword in the .fcs file storing the condition.name
- marginsubset
The Gating Hierarchy level from which values will be used to estimate the plot margins (ex. "nonDebris")
- gatesubset
The Gating Hierarchy level of the cells that you want to see plotted (ex. "lymph")
- ycolumn
The ycolumn that you want to see everything plotted by (ex. "APC-A") or ALL to see all comparisons
- bins
Bins for which the plotted cells will be divided into providing granularity
- clearance
The additional ratio added to the margins to avoid clipping main population but exclude outliers.
- gatelines
Whether to add estimated gate cutoff lines
- reference
Reference for the gate cutoff lines
- outpath
Location for which to store the generated .pdf
- returntype
Whether to return as "pdf", "patchwork" or "plots"
- width
Desired page width for a pdf, default is 9 inches.
- height
Desired page height for a pdf, default is 7 inches
Examples
library(BiocGenerics)
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)
Unmixed_FullStained <- FCS_Files[grep("Unmixed", FCS_Files)]
UnmixedFCSFiles <- Unmixed_FullStained[1]
UnmixedCytoSet <- load_cytoset_from_fcs(UnmixedFCSFiles[1],
truncate_max_range = FALSE,transformation = FALSE)
UnmixedGatingSet <- GatingSet(UnmixedCytoSet)
Markers <- colnames(UnmixedCytoSet)
KeptMarkers <- Markers[-grep("Time|FS|SC|SS|Original|-W$|-H$|AF", Markers)]
MyBiexponentialTransform <- flowjo_biexp_trans(channelRange = 256,
maxValue = 1000000,pos = 4.5, neg = 0, widthBasis = -1000)
TransformList <- transformerList(KeptMarkers, MyBiexponentialTransform)
UnmixedGatingSet <- flowWorkspace::transform(UnmixedGatingSet, TransformList)
FileLocation <- system.file("extdata", package = "Luciernaga")
UnmixedGates <- fread(file.path(path = FileLocation, pattern = 'GatesUnmixed.csv'))
UnmixedGating <- gatingTemplate(UnmixedGates)
#> Adding population:singletsFSC
#> Adding population:singletsSSC
#> Adding population:singletsSSCB
#> Adding population:nonDebris
#> Adding population:lymphocytes
#> Adding population:live
gt_gating(UnmixedGating, UnmixedGatingSet)
#> 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
#> done!
#> done.
#> Gating for 'live'
#> done!
#> done.
#> finished.
removestrings <- c("DTR_", ".fcs")
StorageLocation <- file.path("C:", "Users", "JohnDoe", "Desktop")
IndividualNxN <- Utility_NbyNPlots(x=UnmixedGatingSet[[1]],
sample.name = "GROUPNAME", removestrings = removestrings,
marginsubset = "lymphocytes", gatesubset = "live",
ycolumn = "Spark Blue 550-A", bins = 70, clearance = 0.2,
gatelines = FALSE, reference = NULL, outpath = StorageLocation,
returntype="patchwork")
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.