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

Received via GitHub

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 19 months ago • written 19 months ago by luke.zappia50
Answer: Accessing normalized counts
gravatar for luke.zappia
19 months ago by
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 19 months ago by luke.zappia50

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 19 months ago by Aaron Lun25k
Please log in to add an answer.


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