Closed KatjaRM closed 4 years ago
Hi @KatjaRM, Is/are your clustering(s) part of a Seurat object ? If it is the case could you share the results of
colnames(x = seurat@metadata)
?
Hi!
Thanks for the answer! Yes: colnames(seurat.object@meta.data)
[1] "orig.ident" "nCount_RNA" "nFeature_RNA"
[4] "dataset" "integrated_snn_res.0.1" "seurat_clusters"
[7] "CellfindR"
The clustering I would like to add is stored in orig.ident. I could either add it from there or from seurat.object@active.ident.
I see, you should be able to add the clustering using this code:
add_clustering(loom = loom,
group = "[a-group-for-your-clustering, e.g.: Seurat]",
name = "[a-name-for-your-clustering]",
clusters = seurat@active.ident
)
Hm, now I get the error message
The following from
values were not present in x
: NA
[1] "Clusterings already exists..."
[1] 1
Warning message:
In sort(as.integer(levels(clusters)), decreasing = F) :
NAs introduced by coercion
Even though I set overwrite.default = TRUE
Thanks for the report bug. I might have a closer lookup to it today. I'll will let you know once I fixed the bug
Hey @KatjaRM, I cannot reproduce your error unfortunately. The following snippet works for me:
loom <- build_loom(
file.name = "tests/Seurat_v3/Seurat.loom",
title = "Seurat",
dgem = seurat@assays$RNA@counts,
...
)
add_clustering(
loom = loom,
group = "Seurat",
name = "Seurat Active Ident",
clusters = seurat@active.ident
)
However, here are some things you could check,
SCopeLoomR
version 0.9.0
. Could you double-check that you're using the latest version:
packageVersion(pkg = "SCopeLoomR")
seurat@active.ident
> seurat@active.ident[1:10]
AAACCTGAGGTGGGTT-1 AAACGGGCAAGTAGTA-1 AAACGGGGTGTCAATC-1 AAAGCAACAATCGAAA-1 AAATGCCAGCCAACAG-1 AAATGCCTCACTCTTA-1 AACCGCGAGATCGATA-1 AACCGCGAGGTTCCTA-1 AACCGCGCAGCGATCC-1 AACTCCCCATATACGC-1
13 3 3 3 18 3 3 19 19 8
Levels: 0 1 10 11 12 13 14 15 16 17 18 19 2 20 21 22 23 24 25 26 3 4 5 6 7 8 9
(Normally this should be the case)
seurat@active.ident
Hi Max,
Thank you so much for taking all the time and looking into it. I checked all the points you mentioned and everything was fine.
I have played around with it a little more and what fixed the issue in the end renaming the clusters to just numbers. Weird, but I'll take it.
Thank you again for your time!
Katja
Mmhh, could you post the result of:
seurat@active.ident[1:10]
I'm still interested to understand why it was not working if it were not numbers
For my initial cluster names:
seurat2@active.ident[1:10] dataset2_AAAGTAGGTACGACCC dataset2_AACTGGTCAACACCCG 4.1 older germ cell 4.0 undifferentiated germ cell dataset2_AAGGAGCAGATATACG dataset2_ACATCAGTCTACCAGA 4.0 undifferentiated germ cell 4.1 older germ cell dataset2_ACCAGTAGTGGTCTCG dataset2_ACGATGTCATGTAGTC 4.0 undifferentiated germ cell 4.0 undifferentiated germ cell dataset2_ACGCAGCGTTCCACGG dataset2_ACTGTCCGTATAAACG 4.0 undifferentiated germ cell 4.0 undifferentiated germ cell dataset2_ACTTTCAGTGTGACGA dataset2_AGCATACGTCGCCATG 4.1 older germ cell 4.1 older germ cell 25 Levels: 5 muscle cell ... 0 MB 1-5
After renaming the clusters:
seurat_2@active.ident[1:10] dataset2_AAAGTAGGTACGACCC dataset2_AACTGGTCAACACCCG dataset2_AAGGAGCAGATATACG 25 24 24 dataset2_ACATCAGTCTACCAGA dataset2_ACCAGTAGTGGTCTCG dataset2_ACGATGTCATGTAGTC 25 24 24 dataset2_ACGCAGCGTTCCACGG dataset2_ACTGTCCGTATAAACG dataset2_ACTTTCAGTGTGACGA 24 24 25 dataset2_AGCATACGTCGCCATG 25 Levels: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 21 22 23 24 25 26
The only thing I changed is using SetIdent from Seurat to rename each cluster.
Hi Team,
I am trying to add my Seurat clustering from a v3 object to a loom file and get the following error with
add_seurat_clustering(loom
= loom, seurat = seurat.object, default.clustering.overwrite = T)`What information do I add for seurat.clustering.prefix = ? The clustering is not simply a single Seurat clustering round with one resolution factor, but I have subclustering and partly clustering by marker expression, so I am really confused as to what I have to provide.
I would be thankful for any help!
Best,
Katja