Visualizes the Signature for given row in an averaged signature data.frame.
Source:R/QC_ViewSignature.R
QC_ViewSignature.Rd
Visualizes the Signature for given row in an averaged signature data.frame.
Usage
QC_ViewSignature(
x,
columnname = "Sample",
data,
Normalize = TRUE,
TheFormat = "wider",
detectorcolumn = NULL,
valuecolumn = NULL,
legend = TRUE,
plotname = NULL,
plotlinecolor = NULL
)
Arguments
- x
Name in the Sample column you want to filter for
- columnname
Default is Sample, specifies column name from which x is filtered from
- data
A data.frame object from QC_LibraryParse containing Fluorophore name column and numeric detector columns.
- Normalize
Whether to normalize the data based on peak detector value, default is TRUE
- TheFormat
Default wider for detectors in columns, specify longer if providing detectors as rows
- detectorcolumn
Default NULL, when TheFormat="longer" specify detector column name
- valuecolumn
Default NULL, when TheFormat="longer" specify value column name
- legend
Default TRUE, alternately removes plot legend
- plotname
Default NULL, alternately specifies the plot title
- plotlinecolor
Default NULL, alternatively provide color when only a single line
Examples
library(flowCore)
library(flowWorkspace)
library(openCyto)
library(data.table)
library(dplyr)
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")
PopulationInterest <- gs_pop_get_data(MyGatingSet[1], subset="lymphocytes")
TheDataValues <- exprs(PopulationInterest[[1]])
TheDataValues <- data.frame(TheDataValues, check.names=FALSE)
Signature <- AveragedSignature(TheDataValues, stats="median")
TheData <- Signature[,-grep("Time|FS|SC|SS|Original|W$|H$", names(Signature))]
TheData <- TheData |> mutate(Sample="TestSignature") |>
relocate(Sample, .before=1)
Plot <- QC_ViewSignature(x="TestSignature", data=TheData, Normalize=TRUE)
#> Normalizing Data for Signature Comparison