前言
Immugent在上一期推文:SingCellaR代码实操(一):PBMCs的标准流程中,介绍了使用SingCellaR分析正常人PBMCs数据的常规流程,本期Immugent将继续介绍如何使用SingCellaR分析患者的其它组织的数据。
本期推文使用的是一例骨髓纤维化患者的数据,骨髓纤维化在老年人中非常高发,常见病因从病因学上可分为原发性和继发性两类,原发性原因不明,引起继发性者的常见原因有:肿瘤、感染、化学物质、电离辐射及其他,患者表现为贫血,脾肿大。目前仍缺少有效的治疗手段,可通过脾切除或者造血干细胞移植等缓解症状。
下面就开始展示使用SingCellaR分析骨髓纤维化患者的流程。
代码展示
library(SingCellaR)
data_matrices_dir<-"../SingCellaR_example_datasets/Psaila_et_al/Sample11_cellranger/"
Sample11<-new("SingCellaR")
Sample11@dir_path_10x_matrix<-data_matrices_dir
Sample11@sample_uniq_id<-"Sample11"
load_matrices_from_cellranger(Sample11,cellranger.version = 3)
Sample11
## An object of class SingCellaR with a matrix of : 33538 genes across 6262 samples.
process_cells_annotation(Sample11,mito_genes_start_with="MT-")
plot_cells_annotation(Sample11,type="histogram")
plot_cells_annotation(Sample11,type="boxplot")
plot_UMIs_vs_Detected_genes(Sample11)
image.png
image.png
image.png
DoubletDetection_with_scrublet(Sample11)
table(Sample11@meta.data$Scrublet_type)
filter_cells_and_genes(Sample11,
min_UMIs=1000,
max_UMIs=80000,
min_detected_genes=500,
max_detected_genes=8000,
max_percent_mito=15,
genes_with_expressing_cells = 10,isRemovedDoublets = TRUE)
normalize_UMIs(Sample11,use.scaled.factor = T) remove_unwanted_confounders(Sample11,residualModelFormulaStr="~UMI_count+percent_mito")
get_variable_genes_by_fitting_GLM_model(Sample11,mean_expr_cutoff = 0.05,disp_zscore_cutoff = 0.05)
remove_unwanted_genes_from_variable_gene_set(Sample11,gmt.file = "../SingCellaR_example_datasets/Human_genesets/human.ribosomal-mitocondrial.genes.gmt",
removed_gene_sets=c("Ribosomal_gene","Mitocondrial_gene"))
plot_variable_genes(Sample11)
image.png
runPCA(Sample11,use.components=50,use.regressout.data = T)
plot_PCA_Elbowplot(Sample11)
runUMAP(Sample11,dim_reduction_method = "pca",n.dims.use = 20,n.neighbors = 30,
uwot.metric = "euclidean")
plot_umap_label_by_a_feature_of_interest(Sample11,feature = "UMI_count",point.size = 0.1, mark.feature = FALSE)
identifyClusters(Sample11,n.dims.use = 30,n.neighbors = 30,knn.metric = "euclidean")
plot_umap_label_by_clusters(Sample11,show_method = "louvain",point.size = 0.80)
runFA2_ForceDirectedGraph(Sample11,n.dims.use = 20,
n.neighbors = 5,n.seed = 1,fa2_n_iter = 1000)
plot_forceDirectedGraph_label_by_clusters(Sample11,show_method = "louvain",vertex.size = 0.85,
background.color = "black")
image.png
image.png
image.png
plot_umap_label_by_multiple_gene_sets(Sample11,gmt.file = "../SingCellaR_example_datasets/Human_genesets/human.signature.genes.v1.gmt",
show_gene_sets = c("Erythroid","Lymphoid","Myeloid","Megakaryocyte"),
custom_color = c("red","orange","cyan","purple"),
isNormalizedByHouseKeeping = T,point.size = 1,background.color = "black")
plot_forceDirectedGraph_label_by_multiple_gene_sets(Sample11,gmt.file = "../SingCellaR_example_datasets/Human_genesets/human.signature.genes.v1.gmt",
show_gene_sets = c("Erythroid","Lymphoid","Myeloid","Megakaryocyte"),
custom_color = c("red","orange","cyan","purple"),
isNormalizedByHouseKeeping = T,vertex.size = 1,edge.size = 0.1,
background.color = "black")
image.png
image.png
findMarkerGenes(Sample11,cluster.type = "louvain")
plot_heatmap_for_marker_genes(Sample11,cluster.type = "louvain",n.TopGenes = 10,rowFont.size = 5)
save(Sample11,file="../SingCellaR_example_datasets/Psaila_et_al/SingCellaR_objects/Sample11.SingCellaR.rdata")
image.png
说在最后
从上面的结果我们可以看出,骨髓纤维化患者的PBMC明显偏向红系(Erythroid)和巨系(Megakaryocyte),而向成熟的淋系(Lymphoid)较少,这也是导致患者免疫力低下的主要原因。在实际应用中,相应的gmt文件可以换成其它相关的gene signatures,从而用于描述对应的不同细胞功能或者状态。
好啦,本期分享到这就结束啦,我们下期再会~~
网友评论