Skip to contents

Runs Coereba for Dichotomized Gating Annotation

Usage

Utility_Coereba(
  gs,
  subsets,
  sample.name,
  subsample = NULL,
  columns = NULL,
  notcolumns = NULL,
  reference,
  starter,
  inverse.transform = TRUE,
  returnType,
  Individual = FALSE,
  outpath = NULL,
  filename = NULL,
  nameAppend = NULL
)

Arguments

gs

A Gating Set object

subsets

The desired GatingHierarchy subset

sample.name

Keyword for sample name

subsample

An optional downsample, doesn't work with inverse.transform=TRUE

columns

An optional way to select columns to keep.

notcolumns

An optional way to remove select columns.

reference

The external data.frame or path to the .csv with the specified gate split points by specimen and marker.

starter

The column name to start the splits with

inverse.transform

Whether to reverse the data transform after Coereba cluster is calculated, Default is set to TRUE to allow for .fcs export.

returnType

Whether to return data, flowframe or fcs

Individual

Default FALSE, when TRUE, returns individual fcs instead of grouped.

outpath

Default NULL, file.path for fcs file storage

filename

Default NULL, sets name for aggregated flowframe or fcs

nameAppend

For flowframe and fcs returnType, what gets appended before .fcs

Value

Either data, flowframe or fcs, individually or concatinated

Examples


library(flowCore)
library(flowWorkspace)
library(openCyto)
library(data.table)

File_Location <- system.file("extdata", package = "Coereba")
TheCSV <- file.path(File_Location, "GateCutoffsForNKs.csv")

FCS_Files <- list.files(path = File_Location, pattern = ".fcs", full.names = TRUE)
UnmixedFCSFiles <- FCS_Files[1]
UnmixedCytoSet <- load_cytoset_from_fcs(UnmixedFCSFiles,
 truncate_max_range = FALSE, transformation = FALSE)
UnmixedGatingSet <- GatingSet(UnmixedCytoSet)
Markers <- colnames(UnmixedCytoSet[[1]])
KeptMarkers <- Markers[-grep("Time|FS|SC|SS|Original|-W$|-H$|AF", Markers)]
biex_transform <- flowjo_biexp_trans(channelRange = 256, maxValue = 1000000,
 pos = 4.5, neg = 0, widthBasis = -1000)
TransformList <- transformerList(KeptMarkers, biex_transform)
flowWorkspace::transform(UnmixedGatingSet, TransformList)
#> A GatingSet with 1 samples
UnmixedGates <- fread(file.path(path = File_Location,
 pattern = 'GatesUnmixed.csv'))
UnmixedGating <- gatingTemplate(UnmixedGates)
#> Adding population:Vd2
gt_gating(UnmixedGating, UnmixedGatingSet)
#> Gating for 'Vd2'
#> done!
#> done.
#> finished.

CoerebaIDs <- Utility_Coereba(gs=UnmixedGatingSet[1], subsets="live",
 sample.name="GROUPNAME", reference=TheCSV, starter="Spark Blue 550-A",
 returnType="flowframe", Individual=TRUE)
#> sample.name INF052 not recognized among identification names
#>      found in reference file, returning NULL instead of a data.frame,
#>      if iterating with map use compact instead of bind_rows to remove