Skip to contents

Takes a Lucierna SingleColorQC .fcs, splits into percentiles, and plots the results.

Usage

Luciernaga_LinearSlices(
  x,
  subset,
  sample.name,
  removestrings,
  stats,
  returntype,
  probsratio = 0.1,
  output,
  desiredAF = NULL,
  legend = TRUE,
  droplowest = TRUE,
  titlename = NULL,
  returncutplot = FALSE,
  titleplot = NULL
)

Arguments

x

A GatingSet object

subset

The desired gating hierarchy level to look at the data

sample.name

Keyword for which sample name is stored

removestrings

A list of values to remove from the name

stats

Whether to use "mean" or "median"

returntype

Whether to return a "raw" or "normalized" value lineplot.

probsratio

Ratio increments to break quantiles into, default is set to 0.1.

output

Whether to return "plot" or "data"

desiredAF

Peak detector(ex. "V7-A") want to filter cells by before slicing, argument only used to override the main peak detector when a .fcs file has more than a single peak detector, default is set to NULL

legend

Returns the legend, default is TRUE.

droplowest

Removes lowest bin (percentile 0), default is TRUE

titlename

Default NULL, otherwise provide an alternate title.

returncutplot

Default FALSE, if true returns a histogram plot with locations where percentile slice occured.

titleplot

Default NULL, sets the returncutplot title

Value

Either ggplots or the summarized data.frame object preceding

Examples


library(flowCore)
library(flowWorkspace)
library(openCyto)
library(data.table)
library(dplyr)
library(purrr)
library(stringr)

File_Location <- system.file("extdata", package = "Luciernaga")
FCS_Files <- list.files(path = File_Location, pattern = ".fcs",
  full.names = TRUE)
CellSingleColorFiles <- FCS_Files[grep("Cells", FCS_Files)]
CellSingleColors <- CellSingleColorFiles[!str_detect("Unstained", CellSingleColorFiles)]

APC_Example <- CellSingleColors[grep("CD16_", CellSingleColors)]

MyCytoSet <- load_cytoset_from_fcs(APC_Example,
  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(".fcs")

NormalizedSlices <- Luciernaga_LinearSlices(x=MyGatingSet[1],
 subset="lymphocytes",sample.name="GUID", removestrings=removestrings,
 stats="median", returntype="normalized", probsratio=0.1, output="plot",
 desiredAF="R1-A")