You can load a completed analysis stored in R seurat object into MongoDB step 1: export results from Seurat Object
library(Seurat)
export counts data from seurat object
pbmc <- readRDS(file = "../data/pbmc3k_final.rds");
d <- as.matrix(pbmc@assays$RNA@counts);
umap <- pbmc@reductions$umap@cell.embeddings
export cell annotation information
annotation <- pbmc@meta.data
coord <- transform(merge(umap,annotation,by="row.names",all=TRUE), row.names=Row.names, Row.names=NULL)
add cell type name from seurat object
celltype=Idents(pbmc)
coord <- cbind(coord,celltype)
select the types of annotation
coord <- coord[,c("seurat_clusters","celltype")]
create Single Cell Explorer map information; the following information can be added here or from python notebook
mapType="umap";
mapName='pmbc10k_health_tSNE';
study="Baseline";
subjectid="";
disease="Healthy";
source="10XGenomic";
sample="Blood";
comment="from seurat";
author="demo";
mapinfo <- c(study,subjectid,disease,source,sample,comment,author)
save all the results in three csv files
write.csv(d,"counts.csv")
write.csv(coord,"coords.csv")
write.csv(mapinfo, "mapinfo.csv")