Single Cell Experiment colData dimensions not matching with counts dimensions
1
0
Entering edit mode
4.0 years ago

I am trying to read in data downloaded from the EBI Expression Atlas into a SingleCellExperiment object. I'm using the filtered counts file as the counts, then using the experiment data tsv file as the colData. However, for some datasets, the dimensions of the colData does not match with the counts dimensions, and I get the following error:

Error in validObject(.Object) : 
invalid class “SummarizedExperiment” object: 
nb of cols in 'assay' (809) must equal nb of rows in 'colData' (867)

Does anyone know how to solve this problem? Any help would be greatly appreciated! If it helps, the shape of my counts is: 23598 by 809, and the shape of my experiment design is 867 by 25.

RNA-Seq R bioconductor • 926 views
ADD COMMENT
0
Entering edit mode
4.0 years ago
pacome.pr ▴ 130

As you are using filtered counts, some barcodes may have been filtered from the counts but not from the experiment data file. You can match the cells from the filtered counts to the annotation (colData) before creating your SingleCellExperiment:

experiment_data = experiment_data[match(colnames(counts), rownames(experiment_data) ), ]

Or

experiment_data = experiment_data[match(colnames(counts), experiment_data$barcode), ]

Depending on where is stored the barcode / cell name information in the experiement data tsv file.

ADD COMMENT

Login before adding your answer.

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