{"id":29419,"date":"2024-02-22T18:00:21","date_gmt":"2024-02-22T10:00:21","guid":{"rendered":"http:\/\/www.biocloudservice.com\/wordpress\/?p=29419"},"modified":"2024-02-22T18:00:23","modified_gmt":"2024-02-22T10:00:23","slug":"%e6%b5%85%e8%b0%88%e5%8d%95%e7%bb%86%e8%83%9e%e5%88%86%e6%9e%90%e6%b5%81%e7%a8%8b","status":"publish","type":"post","link":"http:\/\/www.biocloudservice.com\/wordpress\/?p=29419","title":{"rendered":"\u6d45\u8c08\u5355\u7ec6\u80de\u5206\u6790\u6d41\u7a0b"},"content":{"rendered":"<p>\u5355\u7ec6\u80de\u5206\u6790\u5728\u73b0\u5728\u975e\u5e38\u706b\uff0c\u4eca\u5929\u5c0f\u679c\u4e5f\u60f3\u5e26\u7740\u5927\u5bb6\u5f00\u59cb\u5b66\u4e60\u68b3\u7406\u4e00\u4e0b\u5355\u7ec6\u80de\u5206\u6790\u6d41\u7a0b\uff0c\u7b80\u5355\u719f\u6089\u4e00\u4e0b\u5355\u7ec6\u80de\u5206\u6790\u6240\u5305\u542b\u7684\u5185\u5bb9\uff0c\u5206\u6790\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\u5b89\u88c5\u5355\u7ec6\u80de\u5206\u6790R\u5305<\/li>\n<\/ol>\n<p>install.packages(\u201cBiocManager\u201d)<\/p>\n<p>BiocManager::install(\u201cSeurat\u201d)<\/p>\n<p>library(Seurat)<\/p>\n<ol>\n<li>\u5355\u7ec6\u80de\u6d4b\u5e8f\u6587\u4ef6\u7684\u8bfb\u5165\u548cSeurat\u5bf9\u8c61\u6784\u5efa<\/li>\n<\/ol>\n<p>#\u8bfb\u53d6\u6570\u636e\u6240\u5728\u7684\u6587\u4ef6\u5939-\u6807\u51c6\u768410X\u6587\u4ef6<\/p>\n<p>pbmc.data &lt;- Read10X(data.dir = &#8220;filtered_gene_bc_matrices\/hg19\/&#8221;)<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"99\" class=\"wp-image-29422\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308103719-1.jpeg?resize=640%2C99\" alt=\"Dingtalk_20230308103719\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308103719-1.jpeg?w=955 955w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308103719-1.jpeg?resize=300%2C46 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308103719-1.jpeg?resize=768%2C118 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308103719-1.jpeg?resize=600%2C92 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>#\u521b\u5efaSeurat\u6587\u4ef6<\/p>\n<p>pbmc &lt;- CreateSeuratObject(counts = pbmc.data, project = &#8220;pbmc3k&#8221;, min.cells = 3, min.features = 200)<\/p>\n<p>min.cells\u8868\u793a\u7b5b\u9009\u81f3\u5c11\u57283\u4e2a\u7ec6\u80de\u4e2d\u8868\u8fbe\u7684\u57fa\u56e0<\/p>\n<p>min.features\u8868\u793a\u7b5b\u9009\u81f3\u5c11\u6709200\u4e2a\u57fa\u56e0\u8868\u8fbe\u7684\u7ec6\u80de<\/p>\n<ol>\n<li>\u5355\u7ec6\u80de\u6570\u636e\u8d28\u63a7(QC)<\/li>\n<\/ol>\n<p>#\u5148\u8ba1\u7b97\u7ebf\u7c92\u4f53\u6bd4\u4f8b<\/p>\n<p>pbmc[[&#8220;percent.mt&#8221;]] &lt;- PercentageFeatureSet(pbmc, pattern = &#8220;^MT-&#8220;)<\/p>\n<p>#\u7528\u5c0f\u63d0\u7434\u56fe\u5c55\u793a\u63a7\u524d\u6307\u6807<\/p>\n<p>VlnPlot(pbmc, features = c(&#8220;nFeature_RNA&#8221;, &#8220;nCount_RNA&#8221;, &#8220;percent.mt&#8221;), ncol = 3\uff0cgroup.by=\u201dorig.ident\u201d,pt.size=0))<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"566\" height=\"544\" class=\"wp-image-29423\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308132956.jpeg?resize=566%2C544\" alt=\"Dingtalk_20230308132956\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308132956.jpeg?w=566 566w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308132956.jpeg?resize=300%2C288 300w\" sizes=\"(max-width: 566px) 100vw, 566px\" data-recalc-dims=\"1\" \/><\/p>\n<p>#\u8fdb\u884c\u8d28\u63a7(\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u6570\u636e\u8fdb\u884c\u8fc7\u6ee4)<\/p>\n<p>pbmc&lt;-subset(pbmc,nFeature_RNA&gt;200 &amp;nFeature_RNA&lt;5000 &amp;percent.mt &lt;15)<\/p>\n<p>VlnPlot(pbmc, features = c(&#8220;nFeature_RNA&#8221;, &#8220;nCount_RNA&#8221;, &#8220;percent.mt&#8221;), ncol = 3\uff0cgroup.by=\u201dorig.ident\u201d,pt.size=0)<\/p>\n<ol>\n<li>\u5355\u7ec6\u80de\u6570\u636e\u6807\u51c6\u5316\u53ca\u8ba1\u7b97\u9ad8\u53d8\u57fa\u56e0<\/li>\n<\/ol>\n<p>#\u6570\u636e\u6807\u51c6\u5316<\/p>\n<p>pbmc &lt;- NormalizeData(pbmc, normalization.method = &#8220;LogNormalize&#8221;, scale.factor = 10000)<\/p>\n<p>\u7528log\u6807\u51c6\u5316\u7b49\u65b9\u5f0f\u964d\u4f4e\u5176\u4ed6\u5e72\u6270\u56e0\u7d20\u7684\u5f71\u54cd<\/p>\n<p>#\u8ba1\u7b97\u9ad8\u53d8\u5f02\u57fa\u56e0<\/p>\n<p>pbmc &lt;- FindVariableFeatures(pbmc, selection.method = &#8220;vst&#8221;, nfeatures = 2000)<\/p>\n<p>all.genes &lt;- rownames(pbmc)<\/p>\n<p>pbmc &lt;- ScaleData(pbmc, features = all.genes)<\/p>\n<ol>\n<li>\u5355\u7ec6\u80de\u6570\u636eUMAP\u964d\u7ef4\u805a\u7c7b<\/li>\n<\/ol>\n<p>pbmc &lt;- RunPCA(pbmc, features = VariableFeatures(object = pbmc))<\/p>\n<p>#\u7ec6\u80de\u805a\u7c7b<\/p>\n<p>pbmc &lt;- FindNeighbors(pbmc, dims = 1:10)<\/p>\n<p>#\u8ba1\u7b97SNN<\/p>\n<p>pbmc &lt;- FindClusters(pbmc, resolution = 0.5)<\/p>\n<p>#UMAP\u975e\u7ebf\u6027\u964d\u7ef4\u5206\u6790<\/p>\n<p>pbmc &lt;- RunUMAP(pbmc, dims = 1:10)<\/p>\n<p>#\u7ed8\u5236UMAP\u964d\u7ef4\u805a\u7c7b\u56fe<\/p>\n<p>DimPlot(pbmc, reduction = &#8220;umap&#8221;, label=T)+ NoLegend()<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"556\" height=\"496\" class=\"wp-image-29424\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308134139.jpeg?resize=556%2C496\" alt=\"Dingtalk_20230308134139\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308134139.jpeg?w=556 556w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308134139.jpeg?resize=300%2C268 300w\" sizes=\"(max-width: 556px) 100vw, 556px\" data-recalc-dims=\"1\" \/><\/p>\n<ol>\n<li>\u5355\u7ec6\u80de\u6570\u636emarker\u57fa\u56e0\u9274\u5b9a<\/li>\n<\/ol>\n<p>pbmc.markers &lt;- FindAllMarkers(pbmc, only.pos = TRUE, min.pct = 0.25, logfc.threshold = 0.25)<\/p>\n<p>signifcant.markers&lt;-pbmc.markers[pbmc.markers$p_val_adj&lt;0.2,]<\/p>\n<p>#\u4fdd\u5b58marker\u57fa\u56e0\u6570\u636e<\/p>\n<p>write.csv(signifcant.markers,file=\u201dsignifcant.markers.csv\u201d)<\/p>\n<p>#marker\u57fa\u56e0\u53ef\u89c6\u5316<\/p>\n<p>#\u53ef\u4ee5\u7528\u81ea\u5df1\u611f\u5174\u8da3\u7684marker\u57fa\u56e0\u8fdb\u884c\u5c55\u793a<\/p>\n<p>markers&lt;-c(\u201cLDHB\u201d,\u201cCD3D\u201d,\u201dNOSIP\u201d,\u201dIL7R\u201d)<\/p>\n<p>##UMAP\u56fe<\/p>\n<p>FeaturePlot(pbmc,features=markers)<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"569\" height=\"530\" class=\"wp-image-29425\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308142154.jpeg?resize=569%2C530\" alt=\"Dingtalk_20230308142154\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308142154.jpeg?w=569 569w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308142154.jpeg?resize=300%2C279 300w\" sizes=\"(max-width: 569px) 100vw, 569px\" data-recalc-dims=\"1\" \/><\/p>\n<p>##\u70b9\u56fe<\/p>\n<p>DotPlot(pbmc,features=markers)+coord_flip()<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"568\" height=\"539\" class=\"wp-image-29426\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308142640.jpeg?resize=568%2C539\" alt=\"Dingtalk_20230308142640\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308142640.jpeg?w=568 568w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308142640.jpeg?resize=300%2C285 300w\" sizes=\"(max-width: 568px) 100vw, 568px\" data-recalc-dims=\"1\" \/><\/p>\n<p>##\u70ed\u56fe<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"605\" height=\"540\" class=\"wp-image-29427\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308143103.jpeg?resize=605%2C540\" alt=\"Dingtalk_20230308143103\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308143103.jpeg?w=605 605w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308143103.jpeg?resize=300%2C268 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308143103.jpeg?resize=600%2C536 600w\" sizes=\"(max-width: 605px) 100vw, 605px\" data-recalc-dims=\"1\" \/><\/p>\n<ol>\n<li>\u5355\u7ec6\u80de\u6570\u636e\u7ec6\u80de\u7fa4\u6ce8\u91ca<\/li>\n<\/ol>\n<p># \u7ed9\u6bcf\u4e2acluster\u6807\u6ce8\u7ec6\u80de\u7c7b\u578b(\u4e00\u822c\u7ec6\u80de\u7fa4\u7684\u6ce8\u91ca\u901a\u8fc7\u4eba\u5de5\u67e5\u6587\u732e\u83b7\u5f97\u7684\u6ce8\u91ca\u7ed3\u679c\u6bd4\u8f83\u51c6\u786e)<\/p>\n<p>new.cluster.ids &lt;- c(&#8220;T&#8221;, &#8220;Mono&#8221;, &#8220;T&#8221;, &#8220;B&#8221;, &#8220;T&#8221;, &#8220;Mono&#8221;, &#8220;NK&#8221;, &#8220;DC&#8221;, &#8220;Platelet&#8221;)<\/p>\n<p>names(new.cluster.ids) &lt;- levels(pbmc)<\/p>\n<p>pbmc &lt;- RenameIdents(pbmc, new.cluster.ids)<\/p>\n<p># \u6dfb\u52a0\u7ec6\u80de\u7c7b\u578b\u81f3meta data<\/p>\n<p>pbmc@meta.data$celltype &lt;- pbmc@active.ident<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"573\" height=\"548\" class=\"wp-image-29428\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308144016.jpeg?resize=573%2C548\" alt=\"Dingtalk_20230308144016\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308144016.jpeg?w=573 573w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230308144016.jpeg?resize=300%2C287 300w\" sizes=\"(max-width: 573px) 100vw, 573px\" data-recalc-dims=\"1\" \/><\/p>\n<p>\u54c8\u54c8\uff0c\u8fd9\u5c31\u662f\u5355\u7ec6\u80de\u6570\u636e\u5206\u6790\u7684\u57fa\u672c\u6d41\u7a0b\uff0c\u4e00\u822c\u5355\u7ec6\u80de\u6570\u636e\u5206\u6790\u90fd\u9700\u8981\u5f88\u5927\u7684\u8ba1\u7b97\u8d44\u6e90\u5965\uff0c\u901a\u5e38\u90fd\u4f1a\u5229\u7528\u9ad8\u6027\u80fd\u670d\u52a1\u5668\u6765\u8fdb\u884c\u6570\u636e\u5206\u6790\uff0c\u5c0f\u679c\u63a8\u8350\u5927\u5bb6\u4f7f\u7528\u672c\u516c\u53f8\u7684\u670d\u52a1\u5668\uff0c\u5355\u7ec6\u80de\u5206\u6790\u6240\u9700\u8981\u7684\u8f6f\u4ef6\u548cR\u5305\u90fd\u5df2\u5b89\u88c5\u597d\uff0c\u6709\u9700\u8981\u7684\u53ef\u4ee5\u8054\u7cfb\u5c0f\u679c\uff0c\u672c\u671f\u7684\u5206\u4eab\u5c31\u5230\u8fd9\u91cc\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5355\u7ec6\u80de\u5206\u6790\u5728\u73b0\u5728\u975e\u5e38\u706b\uff0c\u4eca\u5929\u5c0f\u679c\u4e5f\u60f3\u5e26\u7740\u5927\u5bb6\u5f00\u59cb\u5b66\u4e60\u68b3\u7406\u4e00\u4e0b\u5355\u7ec6\u80de\u5206\u6790\u6d41\u7a0b\uff0c\u7b80\u5355\u719f\u6089\u4e00\u4e0b\u5355\u7ec6\u80de\u5206\u6790\u6240\u5305\u542b\u7684\u5185\u5bb9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":""},"categories":[1],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/29419"}],"collection":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=29419"}],"version-history":[{"count":1,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/29419\/revisions"}],"predecessor-version":[{"id":29434,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/29419\/revisions\/29434"}],"wp:attachment":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=29419"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=29419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}