Accessing normalized counts
1
0
Entering edit mode
luke.zappia ▴ 50
@lukezappia-11973
Last seen 7 months ago

Received via GitHub https://github.com/Oshlack/splatter/issues/42

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 code that creates the issue is as follows:

sim.paths <- splatSimulate(method="paths")
sim.paths <- normalise(sim.paths)
normX <- normcounts(sim.paths)
splatter singlecellexperiment scater • 546 views
ADD COMMENT
3
Entering edit mode
luke.zappia ▴ 50
@lukezappia-11973
Last seen 7 months ago

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.

ADD COMMENT
2
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

Traffic: 412 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6