r - 为R中的集成Seurat对象创建层次聚类树状图?
问题描述
有谁知道如何为集成的 Seurat 对象创建树状图。我可以为非集成对象执行此操作,但是当我尝试时:
immune.combined <- BuildClusterTree(object = immune.combined, slot = "data")
我看到了错误:
Error in hclust(d = data.dist) : NA/NaN/Inf in foreign function call (arg 10)
解决方案
如果您遵循正常的 Seurat 工作流程,在某些时候您会将默认检测更改为“RNA”。查看 BuildClusterTree 的源代码,它使用了所选分析中变化最大的特征(您所选分析下的大型 Seurat 对象中的 var.features)。对于集成工作流程,您只计算了“集成”分析的这些值,而不是 RNA 分析。因此,您需要对综合分析进行分析。这将意味着这样的事情:
sampleIntegrated <- BuildClusterTree(sampleIntegrated,assay="integrated")
由于某种原因不起作用,并且产生了相同的错误。但是,如果您首先将默认检测明确设置为集成,则它可以工作:
DefaultAssay(sampleIntegrated) <- "integrated"
sampleIntegrated <- BuildClusterTree(sampleIntegrated,assay="integrated")
然后,您可以使用您选择的可视化方法。例如,使用 Seurat 的 ggtree 包和工具:
library(ggtree)
myPhyTree <- Tool(object=sampleIntegrated, slot = "BuildClusterTree")
ggtree(myPhyTree)+geom_tiplab()+theme_tree()+xlim(NA,400)
推荐阅读
- html - 如何根据 MasterPage 中的链接选择在同一网页上应用三个不同的 CSS 文件之一?
- javascript - 使用 .filter 和 .reduce 在 JavaScript 中过滤嵌套对象
- javascript - 在 JavaScript 中将表转换为对象数组
- ruby-on-rails - Rails在carrierwave中查找存储文件本地URL
- model-view-controller - MVC:请正确识别 MVC 层之间的可访问性
- sql - Oracle - 在 Case when.... then.... 里面 using is not null
- python - 想使用 BeautifulSoup 从 yahoo Finance 中检索股票公司名称
- angular - 如何在基于安全 Angular + Spring Boot 的 Web 应用中实现登录页面
- ios - UserDefaults 中的值仅在重新启动后出现
- javascript - jQuery - 删除值复选框选择