When I try to access the normalized counts from a path simulation, I get the following error:
Error in assay(object, i = exprs_values) :
'assay(<SingleCellExperiment>, i="character", ...)' invalid subscript 'i'
'i' not in names(assays(<SingleCellExperiment>))
The normcounts function is a shortcut for accessing an assay named normcounts. Neither the
simulation functions in Splatter or the normalise function (which is in the scater package) create
this assay, which is why you are seeing the error. You can see what assays are present using
assayNames(sim.paths) and access them using assay(sim.paths, "assayname").
You might want to take a look at the documentation for the SingleCellExperiment and
SummarizedExperiment packages to learn about the structure of the objects produced by Splatter and
how to access them.
To add to Luke's answer; setting return_log=FALSE in normalize() will yield a "normcounts" assay. The default is to return log-transformed normalized expression values, as these are generally used in downstream analyses anyway.
To add to Luke's answer; setting
return_log=FALSE
innormalize()
will yield a"normcounts"
assay. The default is to return log-transformed normalized expression values, as these are generally used in downstream analyses anyway.