tests/testthat/apps/spillover_edit/app.R

library(CytoRSuite)
library(CytoRSuiteData)

# recordTest("tests/testthat/apps/spillover_edit", loadTimeout = 100000)
# testApp("tests/testthat/apps/spillover_edit/")

# Needed to bypass wd checks for files
options("CytoRSuite_wd_check" = FALSE)

# Data directory
datadir <- system.file("extdata", package = "CytoRSuiteData")

# Sample for speed -
Compensation <- read.flowSet(path = paste0(datadir,"/Compensation-Controls"), 
                             pattern = ".fcs")

Comp <- flowSet(lapply(seq_len(length(Compensation)), function(x) {
  Compensation[[x]][1:1000, ]
}))
sampleNames(Comp) <- sampleNames(Compensation)
pData(Comp)$name <- sampleNames(Compensation)

# GatingSet -
gsc <- GatingSet(Comp)

# gatingTemplate -
gtc <- gatingTemplate(paste0(datadir,"/Compensation-gatingTemplate.csv"))

# Gating -
gating(gtc, gsc)

# Spillover
spfile <- system.file("extdata", "Ref-Spillover-matrix.csv", 
                      package = "CytoRSuite")

# Channel match
cmfile <- system.file("extdata", "Compensation-channels.csv", 
                      package = "CytoRSuite")
  
spillover_edit(gsc,
               parent = "Single Cells",
               spillover = spfile,
               channel_match = cmfile)
DillonHammill/cytoSuite documentation built on March 7, 2019, 10:09 a.m.