单细胞分析环境搭建(三)

本文聚焦于单细胞分析环境的搭建实战。涵盖语言安装,需在命令行运行特定命令;介绍了安装相关软件的步骤,包括下载安装包、更换下载镜像;还提及包安装,要修改源并安装指定包,同时给出安装过程中的注意事项。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

导读

本文将介绍并实战搭建分析单细胞的环境。

1. R

  • R语言安装( Ubuntu

在命令行运行下面的命令,如果是root帐号,请去除sudo,其他系统参考 > Install R[1]

# update indices
sudo apt update -qq

# install two helper packages we need
sudo apt install --no-install-recommends software-properties-common dirmngr

# add the signing key (by Michael Rutter) for these repos
# To verify key, run gpg --show-keys /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc 
# Fingerprint: E298A3A825C0D65DFD57CBB651716619E084DAB9
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc

# add the R 4.0 repo from CRAN -- adjust 'focal' to 'groovy' or 'bionic' as needed
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"

# 安装
sudo apt install --no-install-recommends r-base

2. RStudio

  • RStudio安装
  1. 下载安装包 > Download [2]
  2. 安装
# 根据自己下载的版本,修改文件名
sudo apt install ./rstudio-*-amd64.deb
  1. 打开 RStudio
alt
  1. 更换下载镜像

参考 > RStudio换源[3]

3. Rpackages

  • R包安装
  1. 按照 BiocManager
# 在 RStudio 中的 Console 中输入下面命令
install.packages("BiocManager")
  1. 修改 Bioconductor
# 在 RStudio 中的 Console 中输入下面命令
chooseBioCmirror()

# 选择 China
chooseBioCmirror
chooseBioCmirror
  1. Bioconductor中安装以下 包

注意1:当 (”R may ask you if you want to update any old packages by asking Update all/some/none? [a/s/n]”)请输入a, 并回车。

注意2:当(“Do you want to install from sources the package which needs compilation? y/n”)请输入n, 并回车。

# 在 RStudio 中的 Console 中输入下面命令
# 建议复制,因为大小写敏感
BiocManager::install("SingleCellExperiment")
BiocManager::install("AnnotationHub")
BiocManager::install("ensembldb")
BiocManager::install("multtest")
BiocManager::install("glmGamPoi")
  1. CRAN中安装以下 包
# 在 RStudio 中的 Console 中输入下面命令
# 建议复制,因为大小写敏感
install.packages("tidyverse")
install.packages("Matrix")
install.packages("RCurl")
install.packages("scales")
install.packages("cowplot")
install.packages("Seurat")
install.packages("metap")
  1. 加载 包
# 加载前,请确保上面包安装过程是成功的
library(Seurat)
library(tidyverse)
library(Matrix)
library(RCurl)
library(scales)
library(cowplot)
library(SingleCellExperiment)
library(AnnotationHub)
library(ensembldb)
  1. 加载完毕后,运行 sessionInfo()
sessionInfo()

参考资料

[1]

R: https://cran.r-project.org/index.html

[2]

Rstudio: https://www.rstudio.com/products/rstudio/download/#download

[3]

RStudio换源: https://blog.youkuaiyun.com/zdx1996/article/details/86630385

本文由 mdnice 多平台发布

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值