当前位置:网站首页>"Tips" to slim down Seurat objects
"Tips" to slim down Seurat objects
2022-07-04 13:09:00 【Xu zhougeng】
We are using Seurat When processing single cell data , Will find Seurat The object keeps getting bigger , Carelessly, it becomes a bottomless hole in memory ,
For example, one of mine Seurat Objects occupy 22.3 Of memory space
old_size <- object.size(seu.obj)
format(old_size, units="Gb")
# 22.3 Gb
If I need to shut down halfway Rstudio, So in order to ensure their work continuity , I need to put the in memory 20 many G The data of is saved to disk , And the memory will be loaded in the next analysis . This time , Considering the read and write speed of the disk , Time consuming may require 10 More minutes .
Considering that you may have to upload the data to the online disk or GEO database , So this 20 many G The time required for data , It's even more beyond your imagination .
Is there any way to Seurat Object slimming ? It's very simple , because Seurat Mainly in the Scale This step , Turn the original sparse matrix into an ordinary matrix , At the same time, the elements inside are floating-point , It takes up a lot of space . As long as we clear the normalized matrix before saving the data , You can make Seurat Lose weight all at once .
[email protected][email protected] <- matrix()
new_size <- object.size(seu.obj)
format(new_size, units="Gb")
# 5Gb
Operation above , Reduce the memory occupation to only the original 20% about . however , The problem is coming. , What is the cost of memory reduction ? The price is , You need to... The loaded data scale, Restore Seurat Medium scale.data.
all.genes <- rownames(seu.obj)
seu.obj <- ScaleData(seu.obj, features = all.genes)
This is a common idea in Computer Science , Or space for time , Or time for space .
This trick can speed up Seurat Save, read and write objects , Are there any other applications ? because scale The latter data is mainly for principal component analysis (PCA) Provide input . Subsequent nonlinear dimensionality reduction (UMAP), Clustering analysis (Cluster) It's all based on PCA, Not based on scale data , therefore , If the memory space is surprised during the analysis , You can also use this trick to free up memory space . After running some operations that occupy memory , Then restore it .
边栏推荐
- C fonctions linguistiques
- Using nsproxy to forward messages
- MDK在头文件中使用预编译器时,#ifdef 无效的问题
- Deploy halo blog with pagoda
- Meituan Ali's Application Practice on multimodal recall
- [Yu Yue education] 233 pre school children's language education reference questions in the spring of 2019 of the National Open University
- Langue C: trouver le nombre de palindromes dont 100 - 999 est un multiple de 7
- WPF双滑块控件以及强制捕获鼠标事件焦点
- 认知的定义
- C语言:围圈报号排序问题
猜你喜欢

17. Memory partition and paging

Meituan Ali's Application Practice on multimodal recall

从0到1建设智能灰度数据体系:以vivo游戏中心为例

比量子化学方法快六个数量级,一种基于绝热状态的绝热人工神经网络方法,可加速对偶氮苯衍生物及此类分子的模拟

阿里云有奖体验:用PolarDB-X搭建一个高可用系统

面向个性化需求的在线云数据库混合调优系统 | SIGMOD 2022入选论文解读

Introduction to the button control elevatedbutton of the fleet tutorial (the tutorial includes the source code)

从0到1建设智能灰度数据体系:以vivo游戏中心为例

CANN算子:利用迭代器高效实现Tensor数据切割分块处理
![[data clustering] section 3 of Chapter 4: DBSCAN performance analysis, advantages and disadvantages, and parameter selection methods](/img/e6/2b46d72049ea50f89d0234eab88439.png)
[data clustering] section 3 of Chapter 4: DBSCAN performance analysis, advantages and disadvantages, and parameter selection methods
随机推荐
DC-5靶机
After the game starts, you will be prompted to install HMS core. Click Cancel, and you will not be prompted to install HMS core again (initialization failure returns 907135003)
Fastlane one click package / release app - usage record and stepping on pit
面向个性化需求的在线云数据库混合调优系统 | SIGMOD 2022入选论文解读
Leetcode day 17
【FAQ】华为帐号服务报错 907135701的常见原因总结和解决方法
ISO 27001 Information Security Management System Certification
Show recent errors only command /bin/sh failed with exit code 1
在 Apache 上配置 WebDAV 服务器
室外LED屏幕防水吗?
Runc hang causes the kubernetes node notready
DVWA range exercise 4
WPF double slider control and forced capture of mouse event focus
阿里云有奖体验:用PolarDB-X搭建一个高可用系统
PostgreSQL 9.1 飞升之路
[Android kotlin] lambda return statement and anonymous function
Paper notes ACL 2020 improving event detection via open domain trigger knowledge
Apache服务器访问日志access.log设置
Is the main thread the same as the UI thread- Is main thread the same as UI thread?
eclipse链接数据库中测试SQL语句删除出现SQL语句语法错误