Search
Question: Error when merging SCESet objects
0
gravatar for nathalie408
9 days ago by
nathalie4080 wrote:

I am using R version 3.4.1, Bioconductor 3.5 and RStudio to use scater package. I have 7 single-cell RNA seq datasets (from a 10x Genomics experiment), each corresponding to a different time point. Each dataset is a SCESet object. I want to merge the data all together. I have found there is the mergeSCESet function. However, this works perfectly well on some pairs of datasets, but not all. If not, I got this error :

Error in Biobase::combine(exprs(x), exprs(y)) : 
  matrix shared row and column elements differ: Mean relative difference: 1.102234

What is this mean relative difference ? How could I fix this or bypass it ? 

Here is an example code of what my program is doing (there is no error when running this code - taken from https://rdrr.io/bioc/scater/man/mergeSCESet.html ) :

library(scater)
data("sc_example_counts")
data("sc_example_cell_info")
pd <- new("AnnotatedDataFrame", data = sc_example_cell_info)
example_sceset <- newSCESet(countData = sc_example_counts, phenoData = pd)
a <- mergeSCESet(example_sceset[, 1:20], example_sceset[, 21:30])
 
ADD COMMENTlink modified 9 days ago by Aaron Lun16k • written 9 days ago by nathalie4080
2
gravatar for Aaron Lun
9 days ago by
Aaron Lun16k
Cambridge, United Kingdom
Aaron Lun16k wrote:

The combine step will identify entries of the exprs(x) and exprs(y) matrices that have the same row and column names. For these entries, the expression values need to be the same in order for the merge to succeed. Otherwise, the function doesn't know which ones to keep in the output matrix.

In your case, I'm willing to bet that some of the cell barcodes are repeated between 10X experiments (and obviously the gene annotation will be the same), resulting in some matrix entries that have the same row and column names across multiple experiments. This probably doesn't happen all the time, so the function may work fine in some data sets but not in others. The simplest solution is just to slap an experiment-specific prefix onto the column names, e.g., "Exp1-ACACTGCGACT-1" or something, prior to running the function.

Personally, I've hated mergeSCESet for a long time, and I'm happy to say that as we transition to the SingleCellExperiment class in the next release, you will be able to just cbind the individual objects together to obtain a merged object (assuming that the row order is the same across individual matrices). In your case, the cbind function may complain about duplicate column names, but that's a more informative error message than the one you get from mergeSCESet.

ADD COMMENTlink modified 9 days ago • written 9 days ago by Aaron Lun16k

 Ok, thank you for these very clear explanations. Do you actually have an idea when will be the next scater release ? 

ADD REPLYlink written 8 days ago by nathalie4080
1

The next scater release will come out with the next Bioconductor release... which should be soon-ish. Next month, maybe?

ADD REPLYlink written 8 days ago by Aaron Lun16k
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 2.2.0
Traffic: 271 users visited in the last hour