Skip to contents

Visualizes the Signature for given row in an averaged signature data.frame.

Usage

QC_ViewSignature(x, data, Normalize = TRUE)

Arguments

x

Name in the Sample column you want to filter for

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

Value

A dataframe of similar fluorophores

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