Skip to contents

Compare the plots for given parameters for all specimens in the gating set.

Usage

Utility_UnityPlot(
  x,
  y,
  GatingSet,
  marginsubset,
  gatesubset,
  sample.name,
  removestrings,
  clearance,
  bins,
  gatelines,
  reference,
  returntype,
  outpath
)

Arguments

x

The desired x-axis parameter

y

The desired y-axis parameter

GatingSet

The Gating Set that contains the specimens

marginsubset

The desired gate for the margins

gatesubset

The desired gate of cells you want to plot

sample.name

The keyword that designates different specimens

removestrings

Values to remove from both the plot titles and the pdf

clearance

A value of clearance multiplied to the margin

bins

How many bins to class the cells into

gatelines

Whether to plot the reference lines

reference

A data.frame containing references

returntype

Whether to return "pdf", "patchwork" or "plots"

outpath

The desired location to send the assembled pdf to

Value

The ggplots for all the specimens, as well as the optional .pdf

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:2]
UnmixedCytoSet <- load_cytoset_from_fcs(UnmixedFCSFiles[1:2],
  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
#> 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")

SingleUnityPlot <- Utility_UnityPlot(x="Spark Blue 550-A", y="BUV805-A",
GatingSet=UnmixedGatingSet, sample.name="GROUPNAME", bins=100, clearance=0.2,
removestrings=removestrings, marginsubset="lymphocytes", gatesubset="live",
gatelines=FALSE, reference=NULL, returntype="patchwork",outpath=StorageLocation)
#> 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.