Commit 866f9a77 authored by Gervaise Henry's avatar Gervaise Henry 🤠
Browse files

Fix labels

parent 61083fb1
......@@ -82,6 +82,7 @@ rm(common)
singler <- SingleR(sc10x.se,ref=list(lung.P1=lin.P1,lung.P2=lin.P2,lung.P3=lin.P3),method="single",labels=list(lung.P1=lin.P1$label.fine,lung.P2=lin.P2$label.fine,lung.P3=lin.P3$label.fine),de.method="wilcox",BPPARAM=BiocParallel::MulticoreParam(workers=20))
sc10x$pop <- singler$labels
labs.raw <- singler$labels
labs <- singler$labels
labs[labs %in% c("Differentiating Basal","Proliferating Basal","Basal","Mesothelial","Alveolar Epithelial Type 2","Club","Alveolar Epithelial Type 1","Ciliated","Signaling Alveolar Epithelial Type 2","Proximal Basal","Neuroendocrine","Mucous","Ionocyte","Serous","Proximal Ciliated","Goblet")] <- "Epithelia"
labs[labs %in% c("Adventitial Fibroblast","Alveolar Fibroblast","Lipofibroblast")] <- "Fibroblast"
......@@ -91,6 +92,7 @@ labs[labs %in% c("CD4+ Memory/Effector T","CD4+ Naive T","CD8+ Memory/Effector T
labs[labs %in% c("Classical Monocyte","Nonclassical Monocyte","Myeloid Dendritic Type 2","IGSF21+ Dendritic","EREG+ Dendritic","Myeloid Dendritic Type 1","TREM2+ Dendritic","Macrophage","Proliferating Macrophage")] <- "Myeloid"
labs[labs %in% c("Basophil/Mast 1","Basophil/Mast 2")] <- "Granulocyte"
sc10x$lin <- labs
sc10x$lung <- labs.raw
#DimPlot(sc10x,group.by="lin",reduction="umap",label=TRUE,repel=TRUE)+theme(legend.position="none")
Idents(sc10x) <- "lin"
......@@ -184,6 +186,8 @@ if (opt$o == "pr" && opt$s == "hu") {
#DimPlot(sc10x.epi,group.by="pop",reduction="umap",label=TRUE,repel=TRUE)+theme(legend.position="none")
} else if (opt$o == "pr" && opt$s == "mu") {
sc10x.epi$pop <- sc10x.epi$lin
} else {
sc10x.epi$pop <- sc10x.epi$lin
}
sc10x$pop <- sc10x$lin
......@@ -220,12 +224,12 @@ DefaultAssay(object=sc10x.fmst) <- "SCT"
DefaultAssay(object=sc10x.fib) <- "SCT"
DefaultAssay(object=sc10x.sm) <- "SCT"
DefaultAssay(object=sc10x.leu) <- "SCT"
sc10x@meta.data <- sc10x@meta.data[,c("lin","pop","samples","integrated_snn_res.0.1","integrated_snn_res.0.2","integrated_snn_res.0.3","integrated_snn_res.0.4","integrated_snn_res.0.5","integrated_snn_res.0.75","integrated_snn_res.1","integrated_snn_res.2","integrated_snn_res.3","integrated_snn_res.4","integrated_snn_res.5","nCount_RNA","nFeature_RNA","percent.mito","percent.ribo","Stress1")]
sc10x.epi@meta.data <- sc10x.epi@meta.data[,c("lin","pop","samples","integrated_snn_res.0.1","integrated_snn_res.0.2","integrated_snn_res.0.3","integrated_snn_res.0.4","integrated_snn_res.0.5","integrated_snn_res.0.75","integrated_snn_res.1","integrated_snn_res.2","integrated_snn_res.3","integrated_snn_res.4","integrated_snn_res.5","nCount_RNA","nFeature_RNA","percent.mito","percent.ribo","Stress1")]
sc10x.fmst@meta.data <- sc10x.fmst@meta.data[,c("lin","samples","integrated_snn_res.0.1","integrated_snn_res.0.2","integrated_snn_res.0.3","integrated_snn_res.0.4","integrated_snn_res.0.5","integrated_snn_res.0.75","integrated_snn_res.1","integrated_snn_res.2","integrated_snn_res.3","integrated_snn_res.4","integrated_snn_res.5","nCount_RNA","nFeature_RNA","percent.mito","percent.ribo","Stress1")]
sc10x.fib@meta.data <- sc10x.fib@meta.data[,c("lin","samples","integrated_snn_res.0.1","integrated_snn_res.0.2","integrated_snn_res.0.3","integrated_snn_res.0.4","integrated_snn_res.0.5","integrated_snn_res.0.75","integrated_snn_res.1","integrated_snn_res.2","integrated_snn_res.3","integrated_snn_res.4","integrated_snn_res.5","nCount_RNA","nFeature_RNA","percent.mito","percent.ribo","Stress1")]
sc10x.sm@meta.data <- sc10x.sm@meta.data[,c("lin","samples","integrated_snn_res.0.1","integrated_snn_res.0.2","integrated_snn_res.0.3","integrated_snn_res.0.4","integrated_snn_res.0.5","integrated_snn_res.0.75","integrated_snn_res.1","integrated_snn_res.2","integrated_snn_res.3","integrated_snn_res.4","integrated_snn_res.5","nCount_RNA","nFeature_RNA","percent.mito","percent.ribo","Stress1")]
sc10x.leu@meta.data <- sc10x.leu@meta.data[,c("lin","pop","samples","integrated_snn_res.0.1","integrated_snn_res.0.2","integrated_snn_res.0.3","integrated_snn_res.0.4","integrated_snn_res.0.5","integrated_snn_res.0.75","integrated_snn_res.1","integrated_snn_res.2","integrated_snn_res.3","integrated_snn_res.4","integrated_snn_res.5","nCount_RNA","nFeature_RNA","percent.mito","percent.ribo","Stress1")]
sc10x@meta.data <- sc10x@meta.data[,c("lin","pop","lung","samples","integrated_snn_res.0.1","integrated_snn_res.0.2","integrated_snn_res.0.3","integrated_snn_res.0.4","integrated_snn_res.0.5","integrated_snn_res.0.75","integrated_snn_res.1","integrated_snn_res.2","integrated_snn_res.3","integrated_snn_res.4","integrated_snn_res.5","nCount_RNA","nFeature_RNA","percent.mito","percent.ribo","Stress1")]
sc10x.epi@meta.data <- sc10x.epi@meta.data[,c("lin","pop","lung","samples","integrated_snn_res.0.1","integrated_snn_res.0.2","integrated_snn_res.0.3","integrated_snn_res.0.4","integrated_snn_res.0.5","integrated_snn_res.0.75","integrated_snn_res.1","integrated_snn_res.2","integrated_snn_res.3","integrated_snn_res.4","integrated_snn_res.5","nCount_RNA","nFeature_RNA","percent.mito","percent.ribo","Stress1")]
sc10x.fmst@meta.data <- sc10x.fmst@meta.data[,c("lin","lung","samples","integrated_snn_res.0.1","integrated_snn_res.0.2","integrated_snn_res.0.3","integrated_snn_res.0.4","integrated_snn_res.0.5","integrated_snn_res.0.75","integrated_snn_res.1","integrated_snn_res.2","integrated_snn_res.3","integrated_snn_res.4","integrated_snn_res.5","nCount_RNA","nFeature_RNA","percent.mito","percent.ribo","Stress1")]
sc10x.fib@meta.data <- sc10x.fib@meta.data[,c("lin","lung","samples","integrated_snn_res.0.1","integrated_snn_res.0.2","integrated_snn_res.0.3","integrated_snn_res.0.4","integrated_snn_res.0.5","integrated_snn_res.0.75","integrated_snn_res.1","integrated_snn_res.2","integrated_snn_res.3","integrated_snn_res.4","integrated_snn_res.5","nCount_RNA","nFeature_RNA","percent.mito","percent.ribo","Stress1")]
sc10x.sm@meta.data <- sc10x.sm@meta.data[,c("lin","lung","samples","integrated_snn_res.0.1","integrated_snn_res.0.2","integrated_snn_res.0.3","integrated_snn_res.0.4","integrated_snn_res.0.5","integrated_snn_res.0.75","integrated_snn_res.1","integrated_snn_res.2","integrated_snn_res.3","integrated_snn_res.4","integrated_snn_res.5","nCount_RNA","nFeature_RNA","percent.mito","percent.ribo","Stress1")]
sc10x.leu@meta.data <- sc10x.leu@meta.data[,c("lin","lung","pop","samples","integrated_snn_res.0.1","integrated_snn_res.0.2","integrated_snn_res.0.3","integrated_snn_res.0.4","integrated_snn_res.0.5","integrated_snn_res.0.75","integrated_snn_res.1","integrated_snn_res.2","integrated_snn_res.3","integrated_snn_res.4","integrated_snn_res.5","nCount_RNA","nFeature_RNA","percent.mito","percent.ribo","Stress1")]
saveRDS(sc10x,paste0("./analysis/",opt$p,"_id_all.rds"))
saveRDS(sc10x.epi,paste0("./analysis/",opt$p,"_id_epi.rds"))
saveRDS(sc10x.fmst,paste0("./analysis/",opt$p,"_id_fmst.rds"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment