Converts the Luciernaga outputs into .pdf plots
Usage
Luciernaga_Plots(
data,
RetainedType,
CellPopRatio,
outfolder,
filename,
LinePlots = TRUE,
CosinePlots = TRUE,
StackedBarPlots = TRUE,
HeatmapPlots = TRUE,
returntype = "patchwork",
reference,
thecolumns = 2,
therows = 2,
width = 9,
height = 7
)
Arguments
- data
The data.frame output from LuciernagaQC
- RetainedType
Whether the data.frame contains "raw" or "normalized" values
- CellPopRatio
What mininum ratio needed to retain cluster.
- outfolder
The location that you want to save the .pdf output to.
- filename
The name you want to save your .pdf file as.
- LinePlots
Passed to Utility_Patchwork for "pdf" or "patchwork" or "plots"
- CosinePlots
Return this kind of plot, default is set to TRUE
- StackedBarPlots
Return this kind of plot, default is set to TRUE
- HeatmapPlots
Return this kind of plot, default is set to TRUE
- returntype
Return "pdf", "patchwork" or "plots"
- reference
path or data.frame containing Fluorophore column for ordering
- thecolumns
The number of columns per page
- therows
The number of rows per page
- width
Desired page width
- height
Desired page height
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)]
MyCytoSet <- load_cytoset_from_fcs(CellSingleColors[1:2],
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
#> 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")
FileLocation <- system.file("extdata", package = "Luciernaga")
pattern = "AutofluorescentOverlaps.csv"
AFOverlap <- list.files(path=FileLocation, pattern=pattern, full.names = TRUE)
SingleColor_Data <- map(.x=MyGatingSet[1:2], .f=Luciernaga_QC, subsets="lymphocytes",
removestrings=removestrings, sample.name="GUID", unmixingcontroltype = "cells",
Unstained = FALSE, ratiopopcutoff = 0.001, Verbose = FALSE, AFOverlap = AFOverlap,
stats = "median", ExportType = "data", SignatureReturnNow = FALSE,
outpath = TemporaryFolder, Increments=0.1, SecondaryPeaks=2,
experiment = "FirstExperiment", condition = "ILTPanel", Subtraction = "Internal",
CellAF=TheCellAF, SCData="subtracted", NegativeType="default") %>% bind_rows()
pattern = "^Panel.csv"
CSV <- list.files(path=FileLocation, pattern=pattern, full.names=TRUE)
TheFluorophoreOrder <- read.csv(CSV, check.names = FALSE)
ThePlots <- Luciernaga_Plots(data=SingleColor_Data, RetainedType="normalized",
CellPopRatio=0.05, outfolder=NULL, filename="LuciernagaReport", returntype="plots",
LinePlots=FALSE, CosinePlots=FALSE, StackedBarPlots = FALSE, HeatmapPlots = TRUE,
reference = TheFluorophoreOrder)
#> names not matching, no reorderring according to panel order