一百万细胞或更多细胞的单细胞转录组分析在数据整合方面非常消耗电脑内存,我在单位32G 内存的iMac上跑,经常会出现R session abortion。然后发现Seurat官方给出了v5,即更新版的。
根据官网的说明,一步步安装,在安装到BPCells这个package的时候,开始出问题,前后折腾了差不多快5天。现在这里做一个分享:
代码语言:txt复制1. install BPCells package
remotes::install_github("bnprks/BPCells")
#error: unable to locate libhdf5.
代码语言:txt复制2. 通过查阅官网发现需要先安装hdf5:
“..., before installing BPCells, we must have the HDF5 library installed and accessible on the system.”
代码语言:txt复制3. Two solutions: homebrew install hdf5 or conda install hdf5. For MacOS, installing hdf5 through homebrew seems to be most reliable: brew install hdf5.
代码语言:txt复制4. So, we need to install homebrew first before installing hdf5. I ran the below code in the Mac terminal, not Rstudio console.
mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
eval "$(homebrew/bin/brew shellenv)"
brew update --force --quiet
chmod -R go-w "$(brew --prefix)/share/zsh"
代码语言:txt复制5. Then, I start to install hdf5 using brew command in the terminal, where the brew locates at /homebrew/bin/.
brew install hdf5
代码语言:txt复制6. Sometimes, it will end with error:
#Error: Your Command Line Tools are too outdated.
#how to figure this out???
#The output of this run will give you below suggestion to figure it out. So, I run the below code in the Mac terminal with sudo access.
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
代码语言:txt复制7. Create .R directory in your $home (/Users/jiajia) and touch a Makevars file in it. It looks like:
/Users/jiajia/.R/Makevars.
代码语言:txt复制8. edit the Makevars file with below information:
{
CC=/Users/jiajia/homebrew/Cellar/llvm/17.0.4/bin/clang-17
CXX=/Users/jiajia/homebrew/Cellar/llvm/17.0.4/bin/clang
CFLAGS=-I/Users/jiajia/homebrew/Cellar/hdf5/1.14.3/include
CXXFLAGS=-I/Users/jiajia/homebrew/Cellar/hdf5/1.14.3/include
LDFLAGS=-L/Users/jiajia/homebrew/Cellar/hdf5/1.14.3/lib
}
每个人保存的文件夹位置可能不同,只需要能找到对应的目录即可。
代码语言:txt复制Finally, I successfully installed the BPCells package in the Rstuido.