Merging multiple single cell experiment objects from different samples
0
1
Entering edit mode
achoppe ▴ 10
@375a1478
Last seen 5 months ago
Australia

Hello! I am analysing a large 10x scRNA-seq run. I made separate sce objects for each participant sample so I could inspect them on their own and perform initial QC, and now I want to merge just two of them into one sce object for normalisation and further analysis. I will eventually merge 12 sce objects together but want to see if it works with 2 objects first. I thought it would be a simple merge of the objects but I am getting this error: Error in DataFrame(..., check.names = FALSE) : different row counts implied by arguments

sce_all_data <- cbind(sce002,sce003)

Is this because I have different cell numbers in each sce object? After QC I have 19,989 cells in one sce and 19,943 in the other. Is there a way to get around this? Thank you for any advice you have!!

sessionInfo( ) R version 4.0.4 (2021-02-15) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Big Sur 10.16

Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale: [1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages: [1] parallel stats4 stats graphics grDevices utils datasets methods base

other attached packages: [1] dendextend_1.15.2 pheatmap_1.0.12 forcats_0.5.1 purrr_0.3.4 readr_2.1.2
[6] tibble_3.1.6 tidyverse_1.3.1 tidyr_1.2.0 plyr_1.8.7 reshape2_1.4.4
[11] stringr_1.4.0 dplyr_1.0.8 plotly_4.10.0 data.table_1.14.2 readxl_1.4.0
[16] scRNAseq_2.4.0 uwot_0.1.11 Matrix_1.4-1 scater_1.18.6 ggplot2_3.3.5
[21] SingleCellExperiment_1.12.0 SummarizedExperiment_1.20.0 Biobase_2.50.0 GenomicRanges_1.42.0 GenomeInfoDb_1.26.7
[26] IRanges_2.24.1 S4Vectors_0.28.1 BiocGenerics_0.36.1 MatrixGenerics_1.2.1 matrixStats_0.62.0

sce SingleCellExperiment merge • 5.1k views
ADD COMMENT
1
Entering edit mode

You may have a look at sce_cbind function from the scMerge package (https://sydneybiox.github.io/scMerge/reference/sce_cbind.html) because the issue here is indeed that you have different number of rows, you might to select common rows manually or directly use sce_cbind function

ADD REPLY
0
Entering edit mode

Thanks Basti! I am trying to get that to work - will reply later today if it does. Had trouble installing scMerge but finally got it to work by installing an earlier version of Hmisc.

ADD REPLY
0
Entering edit mode

I think it worked! Merci Basti 🙏 I made a sce_list of the two sce objects, then used this code: sce_list <- list((sce002),(sce003)) sce<- sce_cbind( sce_list, method = "intersect", exprs = c("counts"), colData_names = NULL) I removed any of the arguments related to batch as these cells are from the same batch, just different participants. Does that look right to you? Are there any other arguments I should have added you think? There are many here: https://sydneybiox.github.io/scMerge/reference/scMerge.html Thanks again!

ADD REPLY
0
Entering edit mode

Just in case this helps anyone else - you need to have the argument colData_names = TRUE to keep the metadata information for each sce object.

ADD REPLY
0
Entering edit mode

Thank you so much for this question! Worked perfectly.

ADD REPLY

Login before adding your answer.

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