CARD icon indicating copy to clipboard operation
CARD copied to clipboard

sc and spatial count Matrix are correctly formatted but createCARDObject function returns error

Open krigia opened this issue 11 months ago • 2 comments

@YingMa0107 @YMalab I have exported tha RNA counts for both scRNA-seq and spatial data as dgCMatrix.

str(scRNA_seq_counts) Formal class 'dgCMatrix' [package "Matrix"] with 6 slots ..@ i : int [1:37279034] 29 30 45 170 294 606 774 846 858 920 ... ..@ p : int [1:24475] 0 433 822 1857 2599 3661 4614 4820 5038 5707 ... ..@ Dim : int [1:2] 36601 24474 ..@ Dimnames:List of 2 .. ..$ : chr [1:36601] "MIR1302-2HG" "FAM138A" "OR4F5" "AL627309.1" ... .. ..$ : chr [1:24474] "TCa001_AAACCTGAGAAGAAGC-1" "TCa001_AAACCTGAGAAGATTC-1" "TCa001_AAACCTGAGAGTACCG-1" "TCa001_AAACCTGAGCTACCTA-1" ... ..@ x : num [1:37279034] 0.995 0.985 0.997 1.981 0.995 ... ..@ factors : list()

str(spatial_counts_dgCMatrix) Formal class 'dgCMatrix' [package "Matrix"] with 6 slots ..@ i : int [1:2804500] 1 3 8 11 14 15 18 20 22 24 ... ..@ p : int [1:2024] 0 1801 3559 5395 6542 7439 8601 9431 10073 11552 ... ..@ Dim : int [1:2] 8417 2023 ..@ Dimnames:List of 2 .. ..$ : chr [1:8417] "SAMD11" "NOC2L" "KLHL17" "HES4" ... .. ..$ : chr [1:2023] "CGGCTGAAGGTTACGC-1_1" "CACCTCTACGAGTGTG-1_1" "ATACGACAGATGGGTA-1_1" "ACTTCCTGTCGTGCGA-1_1" ... ..@ x : num [1:2804500] 1 1 1 1 1 3 1 2 1 1 ... ..@ factors : list()

However although the two dgCMatrix are properly formatted and they have overlapped genes, when I run createCARDObject function, I get the following error: **_## QC on scRNASeq dataset! ...

QC on spatially-resolved dataset! ...

Error: There are no common gene names in spatial count data and single cell RNAseq count data_**

Your advice is highly appreciated. Thank you!

krigia avatar Mar 08 '24 19:03 krigia

Hi @krigia,

Have you checked and printed the rownames(spatial_counts_dgCMatrix) the rownames(scRNA_seq_counts) out? Also have you checked the colSums(spatial_counts_dgCMatrix) to see if they are all very small? If they are all very small, maybe you can set the minCountGene to a smaller number.

Best, Ying

YMalab avatar Apr 01 '24 16:04 YMalab

@YMalab rownames(spatial_counts_dgCMatrix) is NULL. The object has NULL values for both cells (spots) and features. Also, I do not understand what you mean to check colSums(spatial_counts_dgCMatrix) to see if they are all very small. How small? Thank you!

krigia avatar Apr 16 '24 22:04 krigia