Scater read10xResults produces a SingleCellExperiment object that contains dots and no longer works with rowSums
1
0
Entering edit mode
star0044 • 0
@star0044-14670
Last seen 3 months ago
United States

I recently installed the new version of scater for R that uses a SingleCellExperiment object instead of the SCESet object. When I read in a 10X dataset using read10XResults, I get a Single Cell Experiment object that looks good. But when I try to remove genes with no values I get an error message when using rowSums: Here is my code

sce10x <- read10XResults(data_dir = "cellranger_input_data")
keep_feature <- rowSums(counts(sce10x) > 0) > 0

The following error is returned

Error in rowSums(counts(sce10x) > 0) : 
  'x' must be an array of at least two dimensions

Any help on this issue?

 

 

 

scater • 1.3k views
ADD COMMENT
0
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 10 hours ago
The city by the bay

It's a dgCMatrix object from the Matrix package, which is the natural format for storing sparse data like this. You'll need to load in the Matrix package to access the various methods, including rowSums and friends.

ADD COMMENT
0
Entering edit mode

That worked, thanks!

 

ADD REPLY

Login before adding your answer.

Traffic: 967 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