ilr normalize isometric log-ratio transformation

visium_heart/st_snRNAseq/05_colocalization/create_niches_ct.R at 5b30c7e497e06688a8448afd8d069d2fa70ebcd2 · saezlab/visium_heart (github.com) 更多内容,关注微信:生信小博士

The ILR (Isometric Log-Ratio) transformation is used in the analysis ofcompositional data. Any given observation is a set of positive values summing to unity, such as the proportions of chemicals in a mixture or proportions of total time spent in various activities. The sum-to-unity invariant implies that although there may be k≥2�≥2 components to each observation, there are only k−1�−1 functionally independent values. (Geometrically, the observations lie on a k−1�−1-dimensional simplex in k�-dimensional Euclidean space Rk��. This simplicial nature is manifest in the triangular shapes of the scatterplots of simulated data shown below.)

Typically, the distributions of the components become "nicer" when log transformed. This transformation can be scaled by dividing all values in an observation by their geometric mean before taking the logs.

ilr数据输入要求:

cpp 复制代码
 
  baseILR <- ilrBase(x = integrated_compositions,
                     method = "basic")
  head(  baseILR)
  cell_ilr <- as.matrix(ilr(integrated_compositions, baseILR))
  colnames(cell_ilr) <- paste0("ILR_", 1:ncol(cell_ilr))
  
  print(head(cell_ilr)[,1:9])
  

umap图

cpp 复制代码
comp_umap <- umap(cell_ilr, 
                  n_neighbors = 30, n_epochs = 1000) %>%
  as.data.frame() %>%
  mutate(row_id = rownames(cell_ilr))

head(atlas_meta)

comp_umap %>%
  left_join(atlas_meta, by = c("row_id")) %>%
  ggplot(aes(x = V1, y = V2, 
             color = opt_clust_integrated)) +
  ggrastr::geom_point_rast(size = 0.3) +
  theme_classic() +
  xlab("UMAP1") +
  ylab("UMAP2")+

  theme(legend.text = element_text(size = 14))

comp_umap %>%

left_join(atlas_meta, by = c("row_id")) %>%

ggplot(aes(x = V1, y = V2,

color = orig.ident)) +

ggrastr::geom_point_rast(size = 0.3) +

theme_classic() +

xlab("UMAP1") +

ylab("UMAP2")+

theme(legend.text = element_text(size = 14))

相关推荐
PyAIGCMaster12 分钟前
设置一个自定义名称的密钥,用于 git 仓库上下传使用
1024程序员节
物联网软硬件开发-轨物科技20 分钟前
【轨物方案】母线槽智能在线监测解决方案:构筑电力系统安全防线,驱动制造业数智化升级
1024程序员节
潜心编码29 分钟前
基于Django的医疗电子仪器系统
前端·数据库·1024程序员节
Dontla38 分钟前
Web单页应用(SPA)路由设计(以React为例)
1024程序员节
colus_SEU1 小时前
【计算机网络笔记】第二章 应用层 (Application Layer)
笔记·计算机网络·1024程序员节
上海蓝色星球1 小时前
蓝色星球如何打造能与企业共同进化的灵活系统
1024程序员节
yychen_java1 小时前
无人机技术研究现状及发展趋势
无人机·1024程序员节
小白黑科技测评2 小时前
2025 年视频去水印工具实测:擦擦视频双版本解析一键去字幕与多格式兼容能力
java·人工智能·音视频·智能电视·1024程序员节
@曾记否2 小时前
【Betaflight源码学习】之初始化函数(init.c)
1024程序员节
Eiceblue3 小时前
Python 快速提取扫描件 PDF 中的文本:OCR 实操教程
vscode·python·ocr·1024程序员节