G:\silicosis\geo\GSE184854_scRNA-seq_mouse_lung_ccr2\GSE184854_RAW_all_merged\step_2_harmony-2022-8-11_for_wt and ccr2\step3_macophage\0.2\just marcophage\0.21

1GSE184854 ccr2敲除小鼠和wt小鼠merge到一起之后,
2对ccr和wt组别进行harmony (虽然ccr组和wt组都有hash tag标签,但是此处按照组别进行harmony),
4大致分为上皮 内皮 髓系 淋巴系 , #0.2
5取髓系,
6分为dc 单核monocyte 巨噬细胞,
7取巨噬 #0.21

#注意 使用dotplot查看内参基因时,往往连内参都不齐,说明我们需要不同的方式来检查数据是否合格,比如再用featureplot来看一下 或者其他检查数据是否合格的方式

library(dplyr)
library(cowplot)
library(Seurat)
library(harmony)#step_2_harmony-2022-8-11_for_wt and ccr2
getwd()
path="G:/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW_all_merged/step_2_harmony-2022-8-11_for_wt and ccr2/"
dir.create(path)
setwd(path)
getwd()#load("G:/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW/mydata.rds")
load("G:/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW_all_merged/merged.rds")
table(Idents(All.merge))
All=subset(All.merge,idents = c('A0301',  'A0302',   'A0303', 'A0304',   'A0305' ,'A0306', 'A0307' , 'A0308',   'A0309'))
if(1==1){dim(All)table(Idents(All))All$percent.mt=PercentageFeatureSet(All,pattern = "^mt-")pdf("1_contorl_QC.pdf")VlnPlot(All, features = c("nFeature_RNA", "nCount_RNA", "percent.mt"), ncol = 3)dev.off()All <- subset(All, subset = nFeature_RNA > 200 & percent.mt < 20)## 15499,16133;All = All%>%Seurat::NormalizeData(verbose = FALSE) %>%  FindVariableFeatures(selection.method = "vst", nfeatures = 2000) %>%ScaleData(verbose = FALSE)All = RunPCA(All, npcs = 50, verbose = FALSE)pdf("2_ElbowPlot.pdf")ElbowPlot(All, ndims = 50)dev.off()table(Idents(All))All$mystim=ifelse(grepl(colnames(All),pattern = 'WT') &(grepl(colnames(All),pattern = 'A0301')|grepl(colnames(All),pattern = 'A0302')|grepl(colnames(All),pattern = 'A0303')),paste0('_Day_21_WT'),ifelse(grepl(colnames(All),pattern = 'WT') &(grepl(colnames(All),pattern = 'A0304')|grepl(colnames(All),pattern = 'A0305')|grepl(colnames(All),pattern = 'A0306')),paste0('_Day_7_WT'),ifelse(grepl(colnames(All),pattern = 'WT') &(grepl(colnames(All),pattern = 'A0307')|grepl(colnames(All),pattern = 'A0308')|grepl(colnames(All),pattern = 'A0309')),paste0('_Day_3_WT'),ifelse(grepl(colnames(All),pattern = 'CCR') &(grepl(colnames(All),pattern = 'A0301')|grepl(colnames(All),pattern = 'A0302')|grepl(colnames(All),pattern = 'A0303')),paste0('_Day_21_CCR'),ifelse(grepl(colnames(All),pattern = 'CCR') &(grepl(colnames(All),pattern = 'A0304')|grepl(colnames(All),pattern = 'A0305')|grepl(colnames(All),pattern = 'A0306')),paste0('_Day_7_CCR'),ifelse(grepl(colnames(All),pattern = 'CCR') &(grepl(colnames(All),pattern = 'A0307')),paste0('_Day_3_CCR'),paste0('_Day_3_CCR')))))))All$mystim_2=ifelse(grepl(colnames(All),pattern = 'WT'),'WT','CCR')table(All$mystim)table(All$mystim_2)All$stim=All$mystim_2#All@meta.data$stim <- c(rep("case", length(grep("1$", All@assays$RNA@counts@Dimnames[[2]]))), rep("ctrl", length(grep("2$", All@assays$RNA@counts@Dimnames[[2]])))) ## 8186,7947;pdf("2_pre_harmony_harmony_plot.pdf")options(repr.plot.height = 5, repr.plot.width = 12)p1 <- DimPlot(object = All, reduction = "pca", pt.size = .1, group.by = "stim")p2 <- VlnPlot(object = All, features = "PC_1", group.by = "stim", pt.size = .1)plot_grid(p1, p2)dev.off()##########################run harmonyAll <- All %>% RunHarmony("stim", plot_convergence = TRUE)harmony_embeddings <- Embeddings(All, 'harmony') pdf("1_contorl_QC_.pdf")VlnPlot(All, features = c("nFeature_RNA", "nCount_RNA", "percent.mt"), ncol = 3)dev.off()pdf("2_after_harmony_harmony_plot.pdf")options(repr.plot.height = 5, repr.plot.width = 12)p3 <- DimPlot(object = All, reduction = "harmony", pt.size = .1, group.by = "stim")p4 <- VlnPlot(object = All, features = "harmony_1", group.by = "stim", pt.size = .1)plot_grid(p3, p4)dev.off()#######################clusterAll <- All %>% RunUMAP(reduction = "harmony", dims = 1:30) %>% RunTSNE(reduction = "harmony", dims = 1:30) %>% FindNeighbors(reduction = "harmony", dims = 1:30)All<-All%>% FindClusters(resolution = 3) %>% identity()options(repr.plot.height = 4, repr.plot.width = 10)pdf("3_after_harmony_umap_two_group.pdf")DimPlot(All, reduction = "umap", group.by = "stim", pt.size = .1)dev.off()pdf("3_after_harmony_cluster_UMAP.pdf")DimPlot(All, reduction = "umap", label = TRUE, pt.size = .1)dev.off()pdf("3_umap_samples_split.pdf")DimPlot(All, reduction = "umap", pt.size = .1, split.by = "stim", label = T)dev.off()pdf("3_after_harmony_tsne_two_group.pdf")DimPlot(All, reduction = "tsne", group.by = "stim", pt.size = .1)dev.off()pdf("3_after_harmony_cluster_tSNE.pdf")DimPlot(All, reduction = "tsne", label = TRUE, pt.size = .1)dev.off()pdf("3_tSNE_samples_split.pdf")DimPlot(All, reduction = "tsne", pt.size = .1, split.by = "stim", label = T)dev.off()#######################################################################stat = as.matrix(table(Idents(All), All$stim))write.table(stat, "cluster_stat.txt", sep = "\t", quote = F, col.names = T, row.names = T)################################################################All<-All%>% FindClusters(resolution = 2) %>% identity()Disease.markers <- FindAllMarkers(All, min.pct = 0.25, logfc.threshold = 0.55, only.pos = T)head(Disease.markers)top100markers <- Disease.markers %>% group_by(cluster) %>% slice_max(avg_log2FC,n=100)  openxlsx::write.xlsx(top100markers,'top100markers_for_all_res2.xlsx')#write.table(top20markers, "top20_markers.txt", sep = "\t", quote = F, col.names = T, row.names = F)getwd()#save(All, file = "G:/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW_all_merged/step_2_harmony-2022-8-11_for_wt and ccr2/all_harmony.rds")}
load("G:/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW_all_merged/step_2_harmony-2022-8-11_for_wt and ccr2/all_harmony.rds")if(1==1){getwd()DimPlot(All,label = T)DimPlot(All.merge,label = T)FeaturePlot(All,features = c('Cd68'))FeaturePlot(All,features = c('Nkg7'))FeaturePlot(All,features = c('Lyz2'))FeaturePlot(All,features = c('Mrc1'))FeaturePlot(All,features = c('Adgre1'))FeaturePlot(All,features = c('Cd79a'))FeaturePlot(All,features = c('Cd45'))FeaturePlot(All,features = c('Axl'))FeaturePlot(All,features = c('Ms4a7'))FeaturePlot(All,features = c('Cd3e'))FeaturePlot(All,features = c('Cd3d'))#endothelialFeaturePlot(All,features = c('Epas1'))FeaturePlot(All,features = c('Cdh5'))FeaturePlot(All,features = c('Cldn5'))FeaturePlot(All,features = c('Kdr'))#epithelialFeaturePlot(All,features = c('Top2a'))FeaturePlot(All,features = c('Dynlrb2'))FeaturePlot(All,features = c('Ccdc153'))FeaturePlot(All,features = c('Scgb3a1'))FeaturePlot(All,features = c('Bpifa1'))FeaturePlot(All,features = c('Ager'))FeaturePlot(All,features = c('Cldn18'))FeaturePlot(All,features = c('Sftpc'))FeaturePlot(All,features = c('Sftpa1'))FeaturePlot(All,features = c('Sftpb'))FeaturePlot(All,features = c('Scgb3a2'))#FeaturePlot(All,features = c('Mgp'))FeaturePlot(All,features = c('Col3a1'))FeaturePlot(All,features = c('Acta2'))FeaturePlot(All,features = c('Tagln'))FeaturePlot(All,features = c('Jchain'))FeaturePlot(All,features = c('Csf1r'),label = T)FeaturePlot(All,features = c('Spp1'))FeaturePlot(All,features = c('Gpnmb'))FeaturePlot(All,features = c('Mmp12'))FeaturePlot(All,features = c('Ccr2'))FeaturePlot(All,features = c('Ly6c2'))FeaturePlot(All,features = c('Il7r'))FeaturePlot(All,features = c('Car4'))FeaturePlot(All,features = c('Siglecf'))FeaturePlot(All,features = c('Mki67'))FeaturePlot(All,features = c('Jchain','Tnfrsf17'),split.by = 'mystim')DotPlot(All,features = c('Jchain','Tnfrsf17','S100a8','Pclaf', 'Top2a','Dynlrb2','Ccdc153','Scgb3a1','Bpifa1','Ager','Cldn18','Sftpc','Sftpa1','Sftpb','Scgb3a2','Igha','H2-Eb1','Cd74','S100a9','Retnlg','Gzma','Ccl5','Epas1','Cdh5', 'Cldn5','Kdr','Mgp','Col3a1','Acta2','Tagln','Chil3', 'Ctsd', 'Ccl12','Ms4a7','F13a1','Csf1r','Cd3d', 'Cd3e','Cd79a', 'Ly6d','Iglv1','Mzb1'))+RotatedAxis()+ggplot2::coord_flip()colnames(All)grepl(colnames(All),pattern = 'WT')table(grepl(colnames(All),pattern = 'WT'))table(grepl(colnames(All),pattern = 'CCR'))All$orig.ident=Idents(All)All=RenameIdents(All,'5'='Myeloid cells','25'='Myeloid cells','34'='Myeloid cells','42'='Myeloid cells','40'='Myeloid cells','36'='Myeloid cells','19'='Myeloid cells','9'='Myeloid cells','11'='Myeloid cells','37'='Myeloid cells','39'='Myeloid cells','7'='Myeloid cells','14'='Myeloid cells','10'='B cells','8'='B cells','23'='Lymphocyte','29'='Lymphocyte','23'='Lymphocyte','17'='Lymphocyte','38'='Lymphocyte','24'='Lymphocyte','31'='Endothelial cells','16'='Endothelial cells','0'='Endothelial cells','1'='Endothelial cells','4'='Endothelial cells','27'='Endothelial cells','33'='Endothelial cells','41'='Endothelial cells','21'='Endo-Mesothelial','30'='Epithelial cells', '35'='Epithelial cells','28'='Epithelial cells','26'='Epithelial cells','32'='Epithelial cells','12'='Epithelial cells','6'='Epithelial cells','15'='mesothelial cells','18'='mesothelial cells','22'='mesothelial cells','2'='mesothelial cells','3'='mesothelial cells','13'='mesothelial cells','20'='mesothelial cells')if(1==1){All$mystim_validate=ifelse(grepl(colnames(All),pattern = 'WT') &(grepl(colnames(All),pattern = 'A0301')|grepl(colnames(All),pattern = 'A0302')|grepl(colnames(All),pattern = 'A0303')),paste0(colnames(All),'_Day_21_WT'),ifelse(grepl(colnames(All),pattern = 'WT') &(grepl(colnames(All),pattern = 'A0304')|grepl(colnames(All),pattern = 'A0305')|grepl(colnames(All),pattern = 'A0306')),paste0(colnames(All),'_Day_7_WT'),ifelse(grepl(colnames(All),pattern = 'WT') &(grepl(colnames(All),pattern = 'A0307')|grepl(colnames(All),pattern = 'A0308')|grepl(colnames(All),pattern = 'A0309')),paste0(colnames(All),'_Day_3_WT'),ifelse(grepl(colnames(All),pattern = 'CCR') &(grepl(colnames(All),pattern = 'A0301')|grepl(colnames(All),pattern = 'A0302')|grepl(colnames(All),pattern = 'A0303')),paste0(colnames(All),'_Day_21_CCR'),ifelse(grepl(colnames(All),pattern = 'CCR') &(grepl(colnames(All),pattern = 'A0304')|grepl(colnames(All),pattern = 'A0305')|grepl(colnames(All),pattern = 'A0306')),paste0(colnames(All),'_Day_7_CCR'),ifelse(grepl(colnames(All),pattern = 'CCR') &(grepl(colnames(All),pattern = 'A0307')),paste0(colnames(All),'_Day_3_CCR'),paste0(colnames(All),'_Day_3_CCR')))))))All$mystim=ifelse(grepl(colnames(All),pattern = 'WT') &(grepl(colnames(All),pattern = 'A0301')|grepl(colnames(All),pattern = 'A0302')|grepl(colnames(All),pattern = 'A0303')),paste0('_Day_21_WT'),ifelse(grepl(colnames(All),pattern = 'WT') &(grepl(colnames(All),pattern = 'A0304')|grepl(colnames(All),pattern = 'A0305')|grepl(colnames(All),pattern = 'A0306')),paste0('_Day_7_WT'),ifelse(grepl(colnames(All),pattern = 'WT') &(grepl(colnames(All),pattern = 'A0307')|grepl(colnames(All),pattern = 'A0308')|grepl(colnames(All),pattern = 'A0309')),paste0('_Day_3_WT'),ifelse(grepl(colnames(All),pattern = 'CCR') &(grepl(colnames(All),pattern = 'A0301')|grepl(colnames(All),pattern = 'A0302')|grepl(colnames(All),pattern = 'A0303')),paste0('_Day_21_CCR'),ifelse(grepl(colnames(All),pattern = 'CCR') &(grepl(colnames(All),pattern = 'A0304')|grepl(colnames(All),pattern = 'A0305')|grepl(colnames(All),pattern = 'A0306')),paste0('_Day_7_CCR'),ifelse(grepl(colnames(All),pattern = 'CCR') &(grepl(colnames(All),pattern = 'A0307')),paste0('_Day_3_CCR'),paste0('_Day_3_CCR')))))))}table(All$mystim)table(All$mystim_2)table(All$orig_stim)table(All$orig.ident)table(grep(colnames(All),pattern = 'WT') & (grep(colnames(All),pattern = 'A0301')|grep(colnames(All),pattern = 'A0302')|grep(colnames(All),pattern = 'A0303')))All$mystim_2=ifelse(grepl(colnames(All),pattern = 'WT'),'WT','CCR')table(All$mystim)table(All$mystim_2)table(ifelse(grepl(colnames(All),pattern = 'WT'),'WT','CCR'))length(grep(colnames(All),pattern = 'WT'))table(All$orig.ident)Idents(All)=All$mystim_2table(grepl(colnames(All),pattern = 'WT') )grepl(c('af','faf','cd'),pattern = 'a')getwd()
}save(All,file ="ALL_with_stim_harmonized.rds" )load("G:/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW_all_merged/step_2_harmony-2022-8-11_for_wt and ccr2/ALL_with_stim_harmonized.rds")#step3_macophage
##step3 pick macrophage from myeloid cells:macrophage neutrophil cd mast
getwd()
#41为endothelial cells
path="G:/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW_all_merged/step_2_harmony-2022-8-11_for_wt and ccr2/step3_macophage"
dir.create(path)
setwd(path)table(Idents(All))
head(All@meta.data)
myeloidcells=subset(All,idents ='Myeloid cells' )
DimPlot(myeloidcells)if(1==1){DimPlot(myeloidcells,group.by = "orig.ident",label = T)FeaturePlot(All,features = c('Cd68'))FeaturePlot(All,features = c('Csf1r'))FeaturePlot(All,features = "F13a1",label = T)FeaturePlot(All,features = c('Chil3'))FeaturePlot(All,features = c('Ctsd'))FeaturePlot(All,features = c('Ccl12'))DotPlot(myeloidcells,group.by = "orig.ident",features = c('Chi3l1', 'Marcks', 'Il1rn', 'Pla2g7', 'Mmp9', 'Spp1','C1qa','C1qb','C1qc',"Cd68","Csf1r",'Mmp12','Mmp14'))+RotatedAxis()+ggplot2::coord_flip()getwd()save(myeloidcells,file = "G:/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW_all_merged/step_2_harmony-2022-8-11_for_wt and ccr2/step3_macophage/myeloid_cells.rds")}
load("G:/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW_all_merged/step_2_harmony-2022-8-11_for_wt and ccr2/step3_macophage/myeloid_cells.rds")#0.2
subset_data=myeloidcells
if(1==1){subset_data = subset_data %>%Seurat::NormalizeData(verbose = FALSE) %>%  FindVariableFeatures(selection.method = "vst", nfeatures = 2000) %>%ScaleData(verbose = FALSE) %>%RunPCA(npcs = 50, verbose = FALSE)ElbowPlot(subset_data, ndims = 50)VlnPlot(subset_data, features = c("nFeature_RNA", "nCount_RNA", "percent.mt"), ncol = 3)##########################run harmony#BiocManager::install('harmony')library('harmony')table(subset_data$stim)subset_data <- subset_data %>% RunHarmony("stim", plot_convergence = TRUE)harmony_embeddings <- Embeddings(subset_data, 'harmony') #######################clusterdims = 1:30subset_data <- subset_data %>% RunUMAP(reduction = "harmony", dims = dims) %>% RunTSNE(reduction = "harmony", dims = dims) %>% FindNeighbors(reduction = "harmony", dims = dims)DimPlot(subset_data,label = T)save(subset_data, file="sepsis_Myeloids.rds")}load("G:/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW_all_merged/step_2_harmony-2022-8-11_for_wt and ccr2/step3_macophage/myeloid_cells.rds")#0.2
file=getwd()
r = 0.2
load(paste(file, "sepsis_Myeloids.rds", sep="/"))
dir.create(paste(file,r,sep="/"))
setwd(paste(file,r,sep="/"))
if(1==1){subset_data <- FindClusters(subset_data, resolution = r)#save(subset_data, file=paste0("sepsis_Endothelial_r", r, ".rds"))getwd()load("G:/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW_all_merged/step_2_harmony-2022-8-11_for_wt and ccr2/step3_macophage/0.2/sepsis_Endothelial_r0.2.rds")subset_data <- ScaleData(subset_data, verbose = FALSE, features = rownames(subset_data))pdf("1_Endothelial_cluster_TSNE.pdf")p = DimPlot(subset_data, reduction = "tsne", label = TRUE, pt.size = 1,label.size = 6)print(p)dev.off()pdf("1_Endothelial_cluster_UMAP.pdf")p = DimPlot(subset_data, reduction = "umap", label = TRUE, pt.size = 1,label.size = 6)print(p)dev.off()stat = cbind(table(Idents(subset_data), subset_data$stim), All = rowSums(table(Idents(subset_data), subset_data$stim)))stat = rbind(stat, All = colSums(stat))stat<-as.data.frame(stat)statopenxlsx::write.xlsx(stat, "2_Endothelial_cluster_stat.xlsx", col.names=T, row.names=T)######################## find markermarkers <- FindAllMarkers(subset_data,  min.pct = 0.25, logfc.threshold = 0.25, only.pos=T)openxlsx::write.xlsx(markers,"3_Endothelial_cluster_markers.xlsx", col.names=T,row.names=F)Idents(subset_data)=subset_data$RNA_snn_res.0.2FeaturePlot(subset_data,features = c('Cd68'))FeaturePlot(subset_data,features = c('Csf1r'),label = T)FeaturePlot(subset_data,features = "Mrc1",label = T)FeaturePlot(All,features = "F13a1",label = T)FeaturePlot(All,features = c('Chil3'))FeaturePlot(All,features = c('Ctsd'))FeaturePlot(All,features = c('Ccl12'))#monocyteFeaturePlot(subset_data,features = c('S100a4'))FeaturePlot(subset_data,features = c('Lyz2'))FeaturePlot(subset_data,features = c('Ccr2'))FeaturePlot(subset_data,features = c('Ccl5'))FeaturePlot(subset_data,features = c('Itgax'))FeaturePlot(subset_data,features = c('Fcgr3'))FeaturePlot(subset_data,features = "Nr4a1",label = T)DotPlot(subset_data,features = "Nr4a1")#dcFeaturePlot(subset_data,features = 'Fscn1',label = T)FeaturePlot(subset_data,features = 'Ly6d',label = T)FeaturePlot(subset_data,features = 'Bst2',label = T)FeaturePlot(subset_data,features = 'Tcf7',label = T)FeaturePlot(subset_data,features = 'Basp1',label = T)FeaturePlot(subset_data,features = 'Tlr9',label = T)FeaturePlot(subset_data,features = 'Itgae',label = T)FeaturePlot(subset_data,features = 'Cd8a',label = T)FeaturePlot(subset_data,features = "Ccr2",split.by = "stim",label = T)FeaturePlot(subset_data,features = c('Ccr2','Gapdh'),split.by = 'stim')FeaturePlot(subset_data,features = "Cd14")FeaturePlot(subset_data,features = "Cd36",label = T)FeaturePlot(subset_data,features = "Cd68",label = T)FeaturePlot(subset_data,features = "F13a1",label = T)FeaturePlot(subset_data,features = "C1qa",label = T)DotPlot(subset_data,features = c('Gpnmb','Spp1'))getwd()}###just macrophage
load("G:/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW_all_merged/step_2_harmony-2022-8-11_for_wt and ccr2/step3_macophage/0.2/sepsis_Endothelial_r0.2.rds")getwd()
path="G:/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW_all_merged/step_2_harmony-2022-8-11_for_wt and ccr2/step3_macophage/0.2/just marcophage"
dir.create(path)
setwd(path)table(Idents(subset_data))
subset_data$myeloidstypes=Idents(subset_data)
DimPlot(subset_data,label = T)subset_data=RenameIdents(subset_data,'6'='DC','10'='DC','2'='Monocytes','4'='Monocytes','0'='Neutrophil','1'='Macrophage','3'='Macrophage','5'='Macrophage','9'='Macrophage')
DimPlot(subset_data,label = T)if(1==1){subset_data=subset(subset_data,idents ='Macrophage' )##just harmony   重新harmonysubset_data = subset_data %>%Seurat::NormalizeData(verbose = FALSE) %>%  FindVariableFeatures(selection.method = "vst", nfeatures = 2000) %>%ScaleData(verbose = FALSE) %>%RunPCA(npcs = 50, verbose = FALSE)ElbowPlot(subset_data, ndims = 50)VlnPlot(subset_data, features = c("nFeature_RNA", "nCount_RNA", "percent.mt"), ncol = 3)##########################run harmony#BiocManager::install('harmony')library('harmony')subset_data <- subset_data %>% RunHarmony("stim", plot_convergence = TRUE)harmony_embeddings <- Embeddings(subset_data, 'harmony') #######################clusterdims = 1:40subset_data <- subset_data %>% RunUMAP(reduction = "harmony", dims = dims) %>% RunTSNE(reduction = "harmony", dims = dims) %>% FindNeighbors(reduction = "harmony", dims = dims)DimPlot(subset_data)getwd()#save(subset_data, file="sepsis_Endothelial.rds")
}
load("G:/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW_all_merged/step_2_harmony-2022-8-11_for_wt and ccr2/step3_macophage/0.2/just marcophage/sepsis_Endothelial.rds")#0.21
file=getwd()
r = 0.21
load(paste(file, "sepsis_Endothelial.rds", sep="/"))
dir.create(paste(file,r,sep="/"))
setwd(paste(file,r,sep="/"))
if(1==1){subset_data <- FindClusters(subset_data, resolution = r)#save(subset_data, file=paste0("sepsis_Endothelial_r", r, ".rds"))load("G:/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW_all_merged/step_2_harmony-2022-8-11_for_wt and ccr2/step3_macophage/0.2/just marcophage/0.2/sepsis_Endothelial_r0.2.rds")getwd()subset_data <- ScaleData(subset_data, verbose = FALSE, features = rownames(subset_data))pdf("1_Endothelial_cluster_TSNE.pdf")p = DimPlot(subset_data, reduction = "tsne", label = TRUE, pt.size = 1,label.size = 6)print(p)dev.off()pdf("1_Endothelial_cluster_UMAP.pdf")p = DimPlot(subset_data, reduction = "umap", label = TRUE, pt.size = 1,label.size = 6)print(p)dev.off()stat = cbind(table(Idents(subset_data), subset_data$stim), All = rowSums(table(Idents(subset_data), subset_data$stim)))stat = rbind(stat, All = colSums(stat))stat<-as.data.frame(stat)statopenxlsx::write.xlsx(stat, "2_Endothelial_cluster_stat.xlsx", col.names=T, row.names=T)######################## find markermarkers <- FindAllMarkers(subset_data,  min.pct = 0.25, logfc.threshold = 0.25, only.pos=T)openxlsx::write.xlsx(markers,"3_Endothelial_cluster_markers.xlsx", col.names=T,row.names=F)DimPlot(subset_data,label = T,split.by = "stim")DimPlot(subset_data,label = T)getwd()#save(subset_data,file = "G:/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW_all_merged/step_2_harmony-2022-8-11_for_wt and ccr2/step3_macophage/0.2/just marcophage/0.21/subsetdata_res0.21.rds")}
load("G:/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW_all_merged/step_2_harmony-2022-8-11_for_wt and ccr2/step3_macophage/0.2/just marcophage/0.21/subsetdata_res0.21.rds")subset_data=subset(subset_data,idents = c('0','1','2'))
DimPlot(subset_data,label = T)subset_data=RenameIdents(subset_data,'0'='AM','1'='Mo-AM','2'='IM')DimPlot(subset_data,label = T,split.by = 'stim')table(Idents(subset_data),subset_data$stim)
table(Idents(subset_data),subset_data$mystim)

GSE184854 ccr2敲除小鼠和wt小鼠merge到一起之后,对ccr和wt组别进行harmony ,大致分为上皮 内皮 髓系 淋巴系 ,取髓系,分为dc 单核monocyte 巨噬细胞,取巨噬相关推荐

  1. python爬取贴吧所有帖子-通过python爬取贴吧数据并保存为word

    前言 Python是一种跨平台的计算机程序设计语言.是一种面向对象的动态类型语言,最初被设计用于编写自动化脚本(shell),随着版本的不断更新和语言新功能的添加,越来越多被用于独立的.大型项目的开发 ...

  2. python爬取百度百科词条-python简单爬虫爬取百度百科python词条网页

    目标分析: 目标:百度百科python词条相关词条网页 - 标题和简介 入口页:https://baike.baidu.com/item/Python/407313 URL格式: - 词条页面URL: ...

  3. 下取整函数的含义_Excel将3.14159取值为3.15或3.1415? 两个函数为你效劳,拿走不谢...

    Hi,大家好,我是你们的朋友波波.欢迎进入波波Excel小课堂,勤奋好学的你必将有所收获. 现实工作中,Excel表格中的数值通常是以设置小数点位数来进行取值,但结果是按四舍五入进行取舍的(局限性很大 ...

  4. 美国服务器百度抓取耗时不稳定,百度或者其他搜索引擎抓取频次快慢的因素,还会受什么有影响?...

    什么是搜索引擎的抓取频次? 抓取频次是搜索引擎在单位时间内(天级)对网站服务器抓取的总次数. 对于百度搜索引擎来说非常智能: 如果百度搜索引擎对站点的抓取频次过高,就很有可能造成服务器不稳定(相对而言 ...

  5. python 定时自动爬取_python实现scrapy爬虫每天定时抓取数据的示例代码

    1. 前言. 1.1. 需求背景. 每天抓取的是同一份商品的数据,用来做趋势分析. 要求每天都需要抓一份,也仅限抓取一份数据. 但是整个爬取数据的过程在时间上并不确定,受本地网络,代理速度,抓取数据量 ...

  6. 取模运算性质_求余、取模运算在RTOS中计算优先级的理解

    uCOS3中的部分源码: /* 置位优先级表中相应的位 */ void OS_PrioInsert (OS_PRIO prio) { CPU_DATA bit; CPU_DATA bit_nbr; O ...

  7. 实现一个用户取过的数据不被其他用户取到

    实现一个用户取过的数据不被其他用户取到: 问题: 在用ADO访问数据库时,从一个表中取一定的记录(比如20行),取出后在程序中使用,使用完后删除掉记录(不用更新或删除记录).在多用户操作下(每个用户采 ...

  8. 拷贝构造函数、析构函数、赋值操作符重载、取地址操作符重载和const修饰的取地址操作符重载...

    2019独角兽企业重金招聘Python工程师标准>>> 在我们学习C++的过程中,我们难免会遇到类,在类中有6个默认的函数,它们分别为:构造函数.拷贝构造函数.析构函数.赋值操作符重 ...

  9. webscraper多页爬取_Web Scraper 高级用法——Web Scraper 抓取多条内容 | 简易数据分析 07...

    这是简易数据分析系列的第 7 篇文章. 在第 4 篇文章里,我讲解了如何抓取单个网页里的单类信息: 在第 5 篇文章里,我讲解了如何抓取多个网页里的单类信息: 今天我们要讲的是,如何抓取多个网页里的多 ...

最新文章

  1. arduino小车前进代码_基于Arduino操纵杆扩展板Funduino制作机器人小车
  2. Python—pandas中DataFrame类型数据操作函数
  3. JSP学习笔记(一):JSP语法和指令
  4. 基于mqtt协议的消息推送服务器,基于 MQTT 协议的推送服务
  5. android安全问题(二) 程序锁
  6. CSS设置列表的符号
  7. Zookeeper 服务注册中心
  8. boost::detail模块fwd容器的测试程序
  9. SAP UI5 click list item to navigate to detail page
  10. mfc让图片与按钮一起_对许多张图片进行批量裁剪,看看我是如何快速做到的
  11. 网络爬虫_第二章_提取_第四单元_BeautifulSoup库入门(未完待续)
  12. 新特性 | Java8 的这个特性,用起来真的很爽!
  13. Bailian4004 数字组合【递归+DP】
  14. 我与布拉德利(Todd Bradley)聊天
  15. VC2005用不惯呀....
  16. 黑客破解 APP 常用工具,低调低调!
  17. 探索性测试ET(Exploratory Test)
  18. 在线二进制取余计算机,二进制换算(进制转换计算器)
  19. 无线射频专题《IEEE 802.11协议讲解1@路由高级配置项,Beacon周期、RTS阈值、DTIM》
  20. 个人支付免费开通支付宝付款功能(免费签约)支付宝当面付开通集成到网站教程

热门文章

  1. 孤尽T31项目Day3
  2. velocity模板引擎帮助
  3. 中国科学研成都计算机,中国科学院成都分院
  4. Java面试题-个人笔记
  5. jvm内存模型与垃圾回收
  6. MyBatis-plus 查询 模糊查询的使用
  7. 48 《自私的基因》 -豆瓣评分8.6
  8. java必备的开发知识和技能
  9. 好好学习天天向上之InfoPath学习系列(一):Form Services与InfoPath初识
  10. linux qt kits叹号,windows系统,HBuilderX无法启动、点击无反应、或启动报错的解决方案...