suppressPackageStartupMessages(
  { library(flowWorkspace)
    library(SingleCellExperiment)
    library(scran)
    library(scater)
  })
## Warning: replacing previous import 'ncdfFlow::filter' by 'dplyr::filter' when
## loading 'flowWorkspace'

A conventional SCE object with the underlying data as in-mem matrix

sce
## class: gsexperiment 
## dim: 4 28701 
## metadata(0):
## assays(1): intensity
## rownames(4): CD19 CD20 CD27 IgD
## rowData names(1): marker
## colnames(28701): cell id #1 cell id #2 ... cell id #28700 cell id
##   #28701
## colData names(1): sample
## reducedDimNames(0):
## altExpNames(0):
ar <- assay(sce)

colData has sample names info, rownames is cell id

colData(sce)
## DataFrame with 28701 rows and 1 column
##                               sample
##                             <factor>
## cell id #1     12828_1_Bcell_C01.fcs
## cell id #2     12828_1_Bcell_C01.fcs
## cell id #3     12828_1_Bcell_C01.fcs
## cell id #4     12828_1_Bcell_C01.fcs
## cell id #5     12828_1_Bcell_C01.fcs
## ...                              ...
## cell id #28697 12828_2_Bcell_C02.fcs
## cell id #28698 12828_2_Bcell_C02.fcs
## cell id #28699 12828_2_Bcell_C02.fcs
## cell id #28700 12828_2_Bcell_C02.fcs
## cell id #28701 12828_2_Bcell_C02.fcs

rowData : rownames will be used as channel, ‘marker’ col contains marker info

rowData(sce)
## DataFrame with 4 rows and 1 column
##           marker
##      <character>
## CD19      B710-A
## CD20      R780-A
## CD27      G780-A
## IgD       V545-A

run some analysis with scran

sce <- runPCA(sce, ncomponents=10, exprs_values = "intensity")

no cell-wise phenotype info available yet for plot

plotPCA(sce)

convert it to a GatingSet

gs <- sce_to_gs(sce
          , assay_type = "intensity"
          , sample = "sample" #specify col for sample splitting
          , channel = NA # specify channel col (NA means parse it from rownames)
          , marker = "marker" # specify marker col
              )
gs
## A GatingSet with 2 samples
sampleNames(gs)
## [1] "12828_1_Bcell_C01.fcs" "12828_2_Bcell_C02.fcs"
nrow(gs)
## $`12828_1_Bcell_C01.fcs`
## [1] 9958
## 
## $`12828_2_Bcell_C02.fcs`
## [1] 18743
colnames(gs)
## [1] "CD19" "CD20" "CD27" "IgD"
markernames(gs)
##     CD19     CD20     CD27      IgD 
## "B710-A" "R780-A" "G780-A" "V545-A"

no gates yet

gs_get_pop_paths(gs)
## [1] "root"

CELL id is also preserved as rownames

cf <- gs_get_cytoframe(gs, 1)
cf
## cytoframe object 'file441a133a67fd'
## with 9958 cells and 4 observables:
##            name        desc     range  minRange  maxRange
## $P1        CD19      B710-A      3453         0      3453
## $P2        CD20      R780-A      4002         0      4002
## $P3        CD27      G780-A      3418      -111      3418
## $P4         IgD      V545-A      3079         0      3079
## 46 keywords are stored in the 'description' slot
## row names(9958): cell id #1 cell id #2 ... cell id #9957 cell id #9958
head(rownames(cf))
## [1] "cell id #1" "cell id #2" "cell id #3" "cell id #4" "cell id #5"
## [6] "cell id #6"