Skip to contents

Return individual plots for specified node for specimens within a GatingSet.

Usage

Utility_IterativeGating(
  x,
  subset,
  gate,
  xValue,
  yValue,
  sample.name,
  removestrings,
  bins = 270
)

Arguments

x

A Gating Set Object

subset

Desired node of cells to plot

gate

Desired gate to show on the same plot as the subset, else NULL

xValue

Desired x axis

yValue

Desired y axis

sample.name

Keyword under which the sample name is stored

removestrings

Character values to remove from the name

bins

Geo_hex bins for the dots

Value

A list of ggplot objects

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],
  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
#> done!
#> done.
#> finished.
removestrings <-  c("DR_", "Cells", ".fcs", "-", " ")
StorageLocation <- file.path("C:", "Users", "JohnDoe", "Desktop")

SingleSpecimen <- Utility_IterativeGating(x=MyGatingSet[1],
 sample.name = "GUID", removestrings = removestrings,
 subset = "nonDebris", gate = "lymphocytes", xValue = "FSC-A",
  yValue = "SSC-A", bins = 270)