Entering edit mode
Hello, I am using SingleR()
for automatic cell annotation and have some questions.
This is the information of my SCE object:
> as.SingleCellExperiment(dataset.all)
class: SingleCellExperiment
dim: 13102 980
metadata(0):
assays(2): counts logcounts
rownames(13102): Xkr4 Sox17 ... Mamdc2 Pdcd1lg2
rowData names(0):
colnames(980): AAACGCTGTAATCAGA-1_1 AAAGGATCACGTAACT-1_1 ...
TTTGATCAGTGCCCGT-1_2 TTTGATCGTGTCTCCT-1_2
colData names(15): orig.ident nCount_RNA ... SingleR.labels ident
reducedDimNames(2): PCA UMAP
mainExpName: SCT
altExpNames(1): RNA
And then I run SingleR:
prediction <- SingleR(test = as.SingleCellExperiment(dataset.all),
ref = ref,
labels = ref$label.main)
I am not sure if I am doing the right way or not. Because on the SingleR tutorial, they used the SCE object hESCs
, and they used counts
for running SingleR
:
> hESCs
class: SingleCellExperiment
dim: 18538 100
metadata(0):
assays(1): counts
rownames(18538): WASH7P_p1 LINC01002_loc4 ... IL9R_loc1 DDX11L16_loc1
rowData names(0):
colnames(100): 1772122_301_C02 1772122_180_E05 ... 1772122_298_F09 1772122_302_A11
colData names(3): Cell_ID Cell_type Timepoint
reducedDimNames(0):
mainExpName: NULL
altExpNames(0):
I also saw some tutorial doing like this:
dataset.all_counts <- GetAssayData(dataset.all, slot = "counts")
results <- SingleR(test = dataset.all_counts,
ref = ref,
labels = ref$label.main)
So my questions are:
- For my code, did I run SingleR with counts or logcounts?
- Should I use counts or logcounts? And what are the differences?
Many thanks!