当前位置: 首页 > article >正文

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 of compositional 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数据输入要求:

 
  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图

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


http://www.kler.cn/a/107243.html

相关文章:

  • Sigrity SPEED2000 Power Ground Noise Simulation模式如何查看PDS系统的自阻抗操作指导
  • 利用滑动窗口解题
  • 物理设备命名规则(Linux网络服务器 15)
  • 28.医院管理系统(基于springboot和vue)
  • [CKS] K8S ServiceAccount Set Up
  • 超子物联网HAL库笔记:定时器[外部模式]篇
  • 291_C++_发送json数据给对于的URL【JSON数据交互】
  • 面向对象设计原则之依赖倒置原则
  • 香港服务器如何做负载均衡?
  • Python中json的用法
  • 1818_ChibiOS的计数信号量
  • Jenkins CLI二次开发工具类
  • CANOE 仿真+测试
  • 高可用系统架构——关于语雀宕机的思考
  • 使用es实现轻量级分布式锁
  • 【python学习笔记——列表】
  • 【@EnableWebMvc的原理】
  • 【广州华锐互动】城市水处理VR仿真实训平台
  • 计算线阵相机 到 拍摄产品之间 摆放距离?(隐含条件:保证图像不变形)
  • C#开发的OpenRA游戏之金钱系统(6)
  • Java New对象分配内存流程
  • 【网络】详解http协议
  • Clion 初始化 QT
  • 怎么在电脑上多屏播放和实时视频输入,ProVideoPlayer 功能介绍
  • Linux权限及Xshell运行原理
  • AQS 为什么要使用双向链表?