FromFlatDF: Construct a SingleCellAssay (or derived subclass) from a...

Description Usage Arguments Value Examples

View source: R/SingleCellAssay-methods.R

Description

SingleCellAssay are a generic container for such data and are simple wrappers around SummarizedExperiment objects. Subclasses exist that embue the container with additional attributes, eg FluidigmAssay.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
FromFlatDF(
  dataframe,
  idvars,
  primerid,
  measurement,
  id = numeric(0),
  cellvars = NULL,
  featurevars = NULL,
  phenovars = NULL,
  class = "SingleCellAssay",
  check_sanity = TRUE,
  ...
)

Arguments

dataframe

A 'flattened' data.frame or data.table containing columns giving cell and feature identifiers and a measurement column

idvars

character vector naming columns that uniquely identify a cell

primerid

character vector of length 1 that names the column that identifies what feature (i.e. gene) was measured

measurement

character vector of length 1 that names the column containing the measurement

id

An identifier (eg, experiment name) for the resulting object

cellvars

Character vector naming columns containing additional cellular metadata

featurevars

Character vector naming columns containing additional feature metadata

phenovars

Character vector naming columns containing additional phenotype metadata

class

desired subclass of object. Default SingleCellAssay.

check_sanity

(default: TRUE) Set FALSE to override sanity checks that try to ensure that the default assay is log-transformed and has at least one exact zero. See defaultAssay for details on the "default assay" which is assumed to contain log transformed data.

...

additional arguments are ignored

Value

SingleCellAssay, or derived, object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(vbeta)
colnames(vbeta)
vbeta <- computeEtFromCt(vbeta)
vbeta.fa <- FromFlatDF(vbeta, idvars=c("Subject.ID", "Chip.Number", "Well"),
primerid='Gene', measurement='Et', ncells='Number.of.Cells',
geneid="Gene",cellvars=c('Number.of.Cells', 'Population'),
phenovars=c('Stim.Condition','Time'), id='vbeta all', class='FluidigmAssay')
show(vbeta.fa)
nrow(vbeta.fa)
ncol(vbeta.fa)
head(mcols(vbeta.fa)$primerid)
table(colData(vbeta.fa)$Subject.ID)
vbeta.sub <- subset(vbeta.fa, Subject.ID=='Sub01')
show(vbeta.sub)

MAST documentation built on Nov. 8, 2020, 8:19 p.m.