Skip to contents

Draw Ridge Plots for comparison

Usage

Utility_RidgePlots(
  gs,
  subset,
  TheX = NULL,
  TheY,
  TheFill,
  inverse.transform = FALSE,
  outpath,
  returntype,
  therows = 2,
  thecolumns = 1,
  width = 7,
  height = 9,
  filename
)

Arguments

gs

A Gating Set Object

subset

The desired gate node, ie "lymphocytes"

TheX

Optional, you can pass a list of column markers to plot.

TheY

The desired Y-axis parameter (as named in pData)

TheFill

The desired fill color (as named in pData)

inverse.transform

Default is FALSE, reverts any transformation on going from the GatingSet to the CytoSet object

outpath

Desired storage location

returntype

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

therows

The desired number of rows per page

thecolumns

The desired number of columns per page

width

The desired page width

height

The desired page height

filename

The file name for the new .pdf

Value

A pdf file

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")

Condition <- data.frame(Condition=c("Ctrl", "Ctrl"))
pd <- pData(UnmixedGatingSet)
new_pd <- cbind(pd, Condition)
pData(UnmixedGatingSet) <- new_pd

SinglePlot <- Utility_RidgePlots(gs=UnmixedGatingSet, subset="live",
  TheFill="Condition",TheX = "APC-Fire 810-A", TheY="name",
  returntype="plots", outpath=StorageLocation, filename="RidgePlot_Condition")
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.