{"id":79220,"date":"2026-11-30T10:00:00","date_gmt":"2026-11-30T02:00:00","guid":{"rendered":"https:\/\/www.biocloudservice.com\/wordpress\/?p=79220"},"modified":"2026-11-28T14:10:16","modified_gmt":"2026-11-28T06:10:16","slug":"bioagent-singlecell-course-15","status":"publish","type":"post","link":"https:\/\/www.biocloudservice.com\/wordpress\/bioagent-singlecell-course-15\/","title":{"rendered":"\u5355\u7ec6\u80de\u5b9e\u6218\u8bfe 15\uff5c\u4ece\u9ad8\u53d8\u57fa\u56e0\u5230 PCA\uff0c\u518d\u5230\u7ec6\u80de\u90bb\u5c45\u56fe"},"content":{"rendered":"<p>\u4e03\u5929\u5b9e\u6218\u8bfe \u00b7 \u7b2c 3 \u5929 \u00b7 \u7b2c 15 \u7bc7\u3000\u4ece\u8868\u8fbe\u91cf\u753b\u5230 UMAP<\/p>\n<h2>\u4e8c\u7ef4\u56fe\u4e0a\u770b\u8d77\u6765\u8fd1\u7684\u7ec6\u80de\uff0c\u771f\u662f\u8fd1\u90bb\u5417<\/h2>\n<p>PCA \u628a\u5f88\u591a\u57fa\u56e0\u5171\u540c\u53d8\u5316\u7684\u65b9\u5411\u538b\u7f29\u6210\u5c11\u6570\u5750\u6807\u3002\u540e\u7eed\u90bb\u5c45\u56fe\u6309\u8fd9\u4e9b\u5750\u6807\u4e2d\u7684\u8ddd\u79bb\u8fde\u8fb9\u3002\u4e3a\u4e86\u8ba9\u666e\u901a\u7535\u8111\u4e5f\u80fd\u72ec\u7acb\u590d\u8dd1\uff0c\u672c\u8bfe\u4ece BioAgent \u5df2\u4fdd\u5b58\u7684 PCA \u68c0\u67e5\u70b9\u8d77\u6b65\uff0c\u4fdd\u7559\u4e86\u6bcf\u4e2a\u7ec6\u80de\u7684\u539f\u6761\u7801\u3002<\/p>\n<p><strong>\u8fd9\u7bc7\u8981\u4ea4\u7684\u7ed3\u679c<\/strong>\u3000\u6309\u6307\u5b9a\u6761\u7801\u627e\u56de\u90bb\u5c45\uff0c\u89e3\u91ca\u4fdd\u7559\u4e3b\u6210\u5206\u6570\u7684\u9009\u62e9\u3002<\/p>\n<p class=\"classroom-downloads\"><a href=\"https:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/ysx-classroom-2026-lab-15.zip\">\u4e0b\u8f7d\u672c\u7bc7\u4ee3\u7801\u3001\u6570\u636e\u4e0e\u53c2\u8003\u7ed3\u679c\uff08ZIP\uff09<\/a>\u3000<a href=\"https:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/ysx-classroom-2026-slides-15.pptx\">\u4e0b\u8f7d\u7b2c 15\u201316 \u7bc7\u8bfe\u4ef6\uff08PPTX\uff09<\/a><\/p>\n<h2>\u5728 BioAgent \u91cc\u505a\u4e00\u904d<\/h2>\n<p>\u6253\u5f00\u9879\u76ee\u4f1a\u8bdd\uff0c\u4e0a\u4f20\u89e3\u538b\u540e\u7684\u76f8\u5e94\u6570\u636e\u6216\u5c06\u9879\u76ee\u653e\u5165\u5df2\u5173\u8054\u7684\u670d\u52a1\u5668\u76ee\u5f55\u3002\u628a\u4e0b\u9762\u8fd9\u53e5\u8bdd\u8fde\u540c\u6570\u636e\u6587\u4ef6\u540d\u53d1\u7ed9 Agent\u3002<\/p>\n<blockquote><p>\u8bf7\u4ece\u5df2\u6709 PCA \u5750\u6807\u91cd\u5efa 15 \u8fd1\u90bb\uff0c\u4e3a\u6240\u9009\u6761\u7801\u7ed9\u51fa\u5168\u90e8\u90bb\u5c45\u4e0e\u6392\u540d\uff0c\u5728\u56fe\u91cc\u9ad8\u4eae\u5b83\u4eec\u3002<\/p><\/blockquote>\n<p>\u53d6\u524d 15 \u4e2a\u4e3b\u6210\u5206\uff0c\u8ba9\u6bcf\u4e2a\u6761\u7801\u627e\u4e0e\u81ea\u5df1\u8ddd\u79bb\u6700\u8fd1\u7684 15 \u4e2a\u5176\u4ed6\u6761\u7801\u3002\u6309 rank \u6392\u5e8f\u68c0\u67e5\u7b2c\u4e00\u884c\uff1b\u56fe\u4e2d\u7070\u70b9\u662f\u80cc\u666f\uff0c\u84dd\u70b9\u662f\u9009\u4e2d\u7684\u90bb\u5c45\uff0c\u661f\u53f7\u662f\u88ab\u67e5\u8be2\u7ec6\u80de\u3002<\/p>\n<p>\u9879\u76ee\u8f93\u5165\u3000embedding.csv.gz\u3001embedding-origin.txt\u3002<a href=\"https:\/\/www.biocloudservice.com\/bioagent\/\">\u6253\u5f00\u4e91\u751f\u4fe1 BioAgent<\/a><\/p>\n<h2>\u4ece\u56fe\u56de\u5230\u6570\u5b57<\/h2>\n<figure><picture class=\"ysx-course-original\"><source type=\"image\/png\" srcset=\"https:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/ysx-classroom-2026-fig-15.png\"><img decoding=\"async\" loading=\"lazy\" style=\"max-width:100%;height:auto\" src=\"\/wordpress\/wp-content\/uploads\/2026\/11\/ysx-classroom-2026-fig-15.png\" alt=\"\u56fe\u7247\u53ea\u753b PC1 \u548c PC2\uff0c\u627e\u90bb\u5c45\u4f7f\u7528 15 \u7ef4\u3002\u84dd\u70b9\u5728\u4e8c\u7ef4\u6295\u5f71\u770b\u8d77\u6765\u4e0d\u591f\u8fd1\uff0c\u53ef\u4ee5\u5230\u8868\u91cc\u6838\u5bf9\u5b83\u7684\u6392\u540d\u3002\"><\/picture><figcaption>\u56fe\u7247\u53ea\u753b PC1 \u548c PC2\uff0c\u627e\u90bb\u5c45\u4f7f\u7528 15 \u7ef4\u3002\u84dd\u70b9\u5728\u4e8c\u7ef4\u6295\u5f71\u770b\u8d77\u6765\u4e0d\u591f\u8fd1\uff0c\u53ef\u4ee5\u5230\u8868\u91cc\u6838\u5bf9\u5b83\u7684\u6392\u540d\u3002<\/figcaption><\/figure>\n<table>\n<thead>\n<tr>\n<th>\u7528\u7ed3\u679c\u8868\u6838\u5bf9<\/th>\n<th>\u672c\u6b21\u5b9e\u8dd1\u503c<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th scope=\"row\">\u68c0\u67e5\u70b9\u7ec6\u80de<\/th>\n<td>2638<\/td>\n<\/tr>\n<tr>\n<th scope=\"row\">\u6bcf\u4e2a\u6761\u7801\u7684\u8fd1\u90bb<\/th>\n<td>15<\/td>\n<\/tr>\n<tr>\n<th scope=\"row\">\u6709\u65b9\u5411\u7684\u8fd1\u90bb\u5173\u7cfb<\/th>\n<td>39570<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u4e0b\u8f7d\u540e\u590d\u8dd1<\/h2>\n<p>\u89e3\u538b\u4ee3\u7801\u5305\uff0c\u5728\u9879\u76ee\u6839\u76ee\u5f55\u6253\u5f00\u7ec8\u7aef\u3002\u7b2c\u4e00\u6b21\u8fd0\u884c\u6309\u4ee5\u4e0b\u6b65\u9aa4\u51c6\u5907\u73af\u5883\uff0c\u540c\u4e00\u73af\u5883\u53ef\u7ee7\u7eed\u7528\u4e8e\u540e\u7eed\u8bfe\u7a0b\u3002<\/p>\n<pre><code>python -m pip install -r requirements.txt\r\npython build_neighbors.py<\/code><\/pre>\n<p>\u5728 <code>results\/<\/code> \u4e2d\u5bf9\u7167 <code>table.csv<\/code>\u3001<code>metrics.csv<\/code> \u548c <code>figure.png<\/code>\u3002\u4e0b\u9762\u662f\u672c\u8bfe\u5165\u53e3\u4e2d\u7684\u4e00\u6bb5\u4ee3\u7801\uff0c\u5b8c\u6574\u7248\u672c\u5728\u538b\u7f29\u5305\u5185\u3002<\/p>\n<pre><code>d=read(&#x27;embedding.csv.gz&#x27;);pc=d.filter(regex=r&#x27;^PC\\d+$&#x27;).iloc[:,:15].to_numpy();idx=neighbors(pc,15)\r\ntab=pd.DataFrame({&#x27;barcode&#x27;:np.repeat(d.barcode,15),&#x27;neighbor&#x27;:d.barcode.to_numpy()[idx.ravel()],&#x27;rank&#x27;:np.tile(np.arange(1,16),len(d))})\r\nassert not (tab.barcode==tab.neighbor).any()<\/code><\/pre>\n<h2>\u4ea4\u4f5c\u4e1a<\/h2>\n<p>\u82e5\u628a\u6bcf\u4e2a\u6761\u7801\u90fd\u8fde\u5411 15 \u4e2a\u90bb\u5c45\uff0c\u603b\u8fb9\u6570\u600e\u6837\u9a8c\uff1f<\/p>\n<details>\n<summary>\u5c55\u5f00\u53c2\u8003\u7b54\u6848<\/summary>\n<p>\u65b9\u5411\u4fdd\u7559\u65f6\u7b49\u4e8e\u7ec6\u80de\u6570\u4e58 15\uff0c\u6392\u9664\u81ea\u8eab\u8fde\u63a5\u3002<\/p>\n<\/details>\n<p><strong>\u6570\u636e\u51fa\u5904\u4e0e\u5904\u7406\u53e3\u5f84<\/strong>\u300010x \u5065\u5eb7\u4f9b\u8005 PBMC3k\u3002\u4fdd\u5b58\u7684 BioAgent \u68c0\u67e5\u70b9\u6709 2,638 \u4e2a\u6761\u7801\uff0c\u542b PCA\u3001UMAP \u4e0e\u4e24\u5957 Leiden \u6807\u7b7e\u3002\u6240\u7528\u8ba1\u6570\u9762\u677f\u7531\u539f\u59cb 10x \u6574\u6570\u77e9\u9635\u62bd\u53d6\u3002 <a href=\"https:\/\/www.10xgenomics.com\/datasets\/3-k-pbm-cs-from-a-healthy-donor-1-standard-1-1-0\">10x Genomics PBMC3k<\/a>\u3000<a href=\"https:\/\/scanpy.readthedocs.io\/en\/stable\/tutorials\/basics\/clustering.html\">Scanpy \u805a\u7c7b\u6559\u7a0b<\/a><\/p>\n<p><a href=\"https:\/\/www.biocloudservice.com\/wordpress\/bioagent-singlecell-course\/\">\u8fd4\u56de\u4e03\u5929\u8bfe\u7a0b\u76ee\u5f55<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6309\u6307\u5b9a\u6761\u7801\u627e\u56de\u90bb\u5c45\uff0c\u89e3\u91ca\u4fdd\u7559\u4e3b\u6210\u5206\u6570\u7684\u9009\u62e9\u3002<\/p>\n","protected":false},"author":1,"featured_media":79117,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[2056,71],"tags":[],"class_list":["post-79220","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bioagent-singlecell-class-2026","category-single-cell"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/ysx-classroom-2026-fig-15.png?fit=1080%2C607&ssl=1","_links":{"self":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/79220","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/comments?post=79220"}],"version-history":[{"count":2,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/79220\/revisions"}],"predecessor-version":[{"id":79314,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/79220\/revisions\/79314"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media\/79117"}],"wp:attachment":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media?parent=79220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/categories?post=79220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/tags?post=79220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}