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))

相关推荐
希忘auto1 天前
详解Redis的常用命令
redis·1024程序员节
yaosheng_VALVE2 天前
探究全金属硬密封蝶阀的奥秘-耀圣控制
运维·eclipse·自动化·pyqt·1024程序员节
dami_king2 天前
SSH特性|组成|SSH是什么?
运维·ssh·1024程序员节
一个通信老学姐7 天前
专业125+总分400+南京理工大学818考研经验南理工电子信息与通信工程,真题,大纲,参考书。
考研·信息与通信·信号处理·1024程序员节
sheng12345678rui7 天前
mfc140.dll文件缺失的修复方法分享,全面分析mfc140.dll的几种解决方法
游戏·电脑·dll文件·dll修复工具·1024程序员节
huipeng9268 天前
第十章 类和对象(二)
java·开发语言·学习·1024程序员节
earthzhang20218 天前
《深入浅出HTTPS》读书笔记(19):密钥
开发语言·网络协议·算法·https·1024程序员节
爱吃生蚝的于勒9 天前
计算机基础 原码反码补码问题
经验分享·笔记·计算机网络·其他·1024程序员节
earthzhang20219 天前
《深入浅出HTTPS》读书笔记(20):口令和PEB算法
开发语言·网络协议·算法·https·1024程序员节
一个通信老学姐9 天前
专业140+总分410+浙江大学842信号系统与数字电路考研经验浙大电子信息与通信工程,真题,大纲,参考书。
考研·信息与通信·信号处理·1024程序员节