satijalab / azimuth

A Shiny web app for mapping datasets using Seurat v4
https://satijalab.org/azimuth
GNU General Public License v3.0
108 stars 31 forks source link

How to extract the annotated cell type for each cell from Azimuth results #97

Closed qicheng-ma closed 2 years ago

qicheng-ma commented 2 years ago

Hi Admin,

I have got Azimuth running locally, I would like to extract the annotated cell type for each cell from Azimuth results.

But I could not :

query An object of class Seurat 46330 features across 11769 samples within 4 assays Active assay: refAssay (23036 features, 4999 variable features) 3 other assays present: RNA, prediction.score.celltype.l2, impADT 2 dimensional reductions calculated: integrated_dr, proj.umap rownames(query[['prediction.score.celltype.l2']]) [1] "gdT" "CD8 TEM" "CD8 TCM" [4] "dnT" "B intermediate" "CD4 TCM" [7] "pDC" "NK" "B naive" [10] "CD14 Mono" "Plasmablast" "CD4 Naive" [13] "Treg" "CD16 Mono" "HSPC" [16] "NK Proliferating" "CD4 TEM" "CD8 Naive" [19] "MAIT" "B memory" "NK-CD56bright" [22] "cDC2" "Platelet" "Eryth" [25] "CD4 CTL" "cDC1" "CD4 Proliferating" [28] "ILC" "ASDC" "CD8 Proliferating" colnames(query[['prediction.score.celltype.l2']])[1:5] [1] "AAACCCAAGCGCCCAT-1" "AAACCCAAGGTTCCGC-1" "AAACCCACAGAGTTGG-1" [4] "AAACCCACAGGTATGG-1" "AAACCCACATAGTCAC-1" df <- as.data.frame (query[['prediction.score.celltype.l2']]) Error in as.data.frame.default(query[["prediction.score.celltype.l2"]]) : cannot coerce class ‘structure("Assay", package = "SeuratObject")’ to a data.frame

Could you please tell me how to extract the annotated cell type for each cell from Azimuth results ?

Thanks,

qicheng-ma commented 2 years ago

Solved