jamesbang

V1

2022/10/13阅读：44主题：雁栖湖

# 🤩 scRNA-seq | 吐血整理的单细胞入门教程（初步Normalization）（十）

## 1写在前面

`scRNAseq`是一个高维度的数据，相对比较复杂，不同`细胞`，不同`平台`,相差较多，所以`library`大小差异较大，我们需要做一个`Normalization`，常用方法包括：👇
`UQ`, `SF`, `CPM`, `RPKM`, `FPKM`, `TPM`。🤒

`Note!` 如果你使用的是`Cufflinks`或者`RSEM`进行定量。

## 2用到的包

``rm(list = ls())library(tidyverse)library(SingleCellExperiment)library(scater)library(scran)library(scRNA.seq.funcs)``

## 3示例数据

``load("umi_umiqc.Rdata")umi.qc``

## 4PCA-rawdata

``umi.qc <- runPCA(umi.qc, exprs_values = "logcounts_raw")plotPCA(umi.qc, colour_by = "batch", size_by = "detected", shape_by = "individual")``

## 5PCA-CPM

``logcounts(umi.qc) <- log2(calculateCPM(umi.qc) + 1)umi.qc <- runPCA(umi.qc)plotPCA(umi.qc, colour_by = "batch", size_by = "detected", shape_by = "individual")``

## 6RLE-rawdata

``plotRLE(umi.qc, exprs_values = "logcounts_raw",colour_by = "batch") + ggtitle("RLE plot for logcounts_raw")``

## 7RLE-CPM

``plotRLE(umi.qc, exprs_values = "logcounts",colour_by = "batch") + ggtitle("RLE plot for log2(CPM) counts")``

## 8其他方法

### 8.1 聚类

``qclust <- quickCluster(umi.qc, min.size = 30)table(qclust)``

### 8.2 计算sizefactor

``umi.qc <- computeSumFactors(umi.qc, clusters = qclust)``

### 8.3 正式Normalization

``umi.qc <- logNormCounts(umi.qc)``

### 8.4 可视化-PCA

``umi.qc <- runPCA(umi.qc)plotPCA(umi.qc, colour_by = "batch",size_by = "detected", shape_by = "individual")``

### 8.5 RLE plot

``plotRLE(umi.qc, exprs_values = "logcounts",colour_by = "batch")``

### 8.6 补充一下

``summary(sizeFactors(umi.qc))``

## 9downsampled data

### 9.1 PCA

``logcounts(umi.qc) <- log2(Down_Sample_Matrix(counts(umi.qc)) + 1)umi.qc <- runPCA(umi.qc)plotPCA(umi.qc,colour_by = "batch",size_by = "detected", shape_by = "individual")``

### 9.2 RLE plot

``plotRLE(umi.qc, exprs_values = "logcounts",colour_by = "batch")``

##### jamesbang
V1

wx🔍: Grassssss 卷起来了