Question: Accessing normalized counts
0
gravatar for luke.zappia
17 months ago by
luke.zappia50
luke.zappia50 wrote:

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)
ADD COMMENTlink modified 17 months ago • written 17 months ago by luke.zappia50
Answer: Accessing normalized counts
3
gravatar for luke.zappia
17 months ago by
luke.zappia50
luke.zappia50 wrote:

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 COMMENTlink written 17 months ago by luke.zappia50
2

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 REPLYlink written 17 months ago by Aaron Lun24k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 323 users visited in the last hour