{"id":650,"date":"2025-11-06T09:09:30","date_gmt":"2025-11-06T01:09:30","guid":{"rendered":"https:\/\/www.kz-hub.tech\/?p=650"},"modified":"2025-11-21T09:17:10","modified_gmt":"2025-11-21T01:17:10","slug":"seurat%e8%bd%ac%e6%8d%a2%e4%b8%bah5ad","status":"publish","type":"post","link":"https:\/\/www.kz-hub.tech\/index.php\/2025\/11\/06\/seurat%e8%bd%ac%e6%8d%a2%e4%b8%bah5ad\/","title":{"rendered":"Seurat\u8f6c\u6362\u4e3aH5AD"},"content":{"rendered":"<p>\u53c2\u8003\u94fe\u63a5\uff1a<a href=\"https:\/\/mp.weixin.qq.com\/s\/unwfRqWGjJYu9wXwaZwu7Q\">https:\/\/mp.weixin.qq.com\/s\/unwfRqWGjJYu9wXwaZwu7Q<\/a><\/p>\n<h2>1. srtdisk<\/h2>\n<p>github\u94fe\u63a5\uff1a<a href=\"https:\/\/github.com\/mianaz\/srtdisk\">https:\/\/github.com\/mianaz\/srtdisk<\/a><br \/>\n\u56fd\u5185\u5927\u4f6c\u4fee\u6539SeuratDisk\u540e\u7684\u5305\uff0c\u4f7f\u7528\u540cSeuratDisk<\/p>\n<p><strong>Installation<\/strong><\/p>\n<pre><code>if (!requireNamespace(&quot;remotes&quot;, quietly = TRUE)) {\n  install.packages(&quot;remotes&quot;)\n}\nremotes::install_github(&quot;miana\/seuratdisk-v5&quot;)<\/code><\/pre>\n<p><strong>Seurat to AnnData (h5ad)<\/strong><\/p>\n<pre><code>library(Seurat)\nlibrary(srtdisk) # changed package name\n\n# Save Seurat object as h5Seurat\nSaveH5Seurat(seurat_obj, filename = &quot;data.h5Seurat&quot;)\n\n# Convert to h5ad for Python\/Scanpy\nConvert(&quot;data.h5Seurat&quot;, dest = &quot;h5ad&quot;)<\/code><\/pre>\n<p><strong>AnnData to Seurat<\/strong><\/p>\n<pre><code># Convert h5ad to h5Seurat\nConvert(&quot;data.h5ad&quot;, dest = &quot;h5seurat&quot;)\n\n# Load as Seurat object\nseurat_obj &lt;- LoadH5Seurat(&quot;data.h5seurat&quot;)<\/code><\/pre>\n<p><strong>Spatial Visium Data<\/strong><\/p>\n<pre><code># Load Visium data from h5ad (created with Scanpy\/Squidpy)\nbrain &lt;- Convert(&quot;visium_brain.h5ad&quot;, dest = &quot;h5seurat&quot;)\nbrain &lt;- LoadH5Seurat(&quot;visium_brain.h5seurat&quot;)\n\n# Spatial images are automatically reconstructed\nImages(brain)\nSpatialFeaturePlot(brain, features = &quot;PTPRC&quot;)<\/code><\/pre>\n<h2>2. AnndataR<\/h2>\n<p>github\u94fe\u63a5\uff1a<a href=\"https:\/\/github.com\/scverse\/anndataR\">https:\/\/github.com\/scverse\/anndataR<\/a><br \/>\n<strong>Installation<\/strong><\/p>\n<pre><code>if (!requireNamespace(&quot;BiocManager&quot;, quietly = TRUE)) {\n  install.packages(&quot;BiocManager&quot;)\n}\nBiocManager::install(&quot;anndataR&quot;)\n\npak::pak(&quot;scverse\/anndataR&quot;, dependencies = TRUE)<\/code><\/pre>\n<p><strong>Seurat to AnnData (h5ad)<\/strong><\/p>\n<pre><code># \u4e00\u6b65\u5230\u4f4d\uff1a\nwrite_h5ad(seurat_obj, path =\u00a0&quot;seurat_obj.h5ad&quot;)\n\n# \u5206\u4e24\u6b65\uff1a\nadata &lt;- as_AnnData(seurat_obj)\nadata$write_h5ad(path =\u00a0&quot;seurat_obj.h5ad&quot;)<\/code><\/pre>\n<p><strong>AnnData to Seurat<\/strong><\/p>\n<pre><code># \u4e00\u6b65\u5230\u4f4d\uff1a\nseurat_obj &lt;- read_h5ad(h5ad_file, as =\u00a0&quot;Seurat&quot;)\n\n# \u5206\u4e24\u6b65\uff1a\nadata &lt;- read_h5ad(h5ad_file)\nseurat_obj &lt;- adata$as_Seurat()<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u53c2\u8003\u94fe\u63a5\uff1ahttps:\/\/mp.weixin.qq.com\/s\/unwfRqWGjJYu9wXwaZwu7Q &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-650","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/posts\/650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/comments?post=650"}],"version-history":[{"count":2,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/posts\/650\/revisions"}],"predecessor-version":[{"id":653,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/posts\/650\/revisions\/653"}],"wp:attachment":[{"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/media?parent=650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/categories?post=650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kz-hub.tech\/index.php\/wp-json\/wp\/v2\/tags?post=650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}