{"items":["5f7007605f9fcc0017abe9e4","5f7007605f9fcc0017abe9e5","5f7007605f9fcc0017abe9e6"],"styles":{"galleryType":"Columns","groupSize":1,"showArrows":true,"cubeImages":true,"cubeType":"max","cubeRatio":1.7777777777777777,"isVertical":true,"gallerySize":30,"collageAmount":0,"collageDensity":0,"groupTypes":"1","oneRow":false,"imageMargin":30,"galleryMargin":0,"scatter":0,"rotatingScatter":"","chooseBestGroup":true,"smartCrop":false,"hasThumbnails":false,"enableScroll":true,"isGrid":true,"isSlider":false,"isColumns":false,"isSlideshow":false,"cropOnlyFill":false,"fixedColumns":0,"enableInfiniteScroll":true,"isRTL":false,"minItemSize":50,"rotatingGroupTypes":"","rotatingCropRatios":"","columnWidths":"","gallerySliderImageRatio":1.7777777777777777,"numberOfImagesPerRow":3,"numberOfImagesPerCol":1,"groupsPerStrip":0,"borderRadius":0,"boxShadow":0,"gridStyle":0,"mobilePanorama":false,"placeGroupsLtr":true,"viewMode":"preview","thumbnailSpacings":4,"galleryThumbnailsAlignment":"bottom","isMasonry":false,"isAutoSlideshow":false,"slideshowLoop":false,"autoSlideshowInterval":4,"bottomInfoHeight":0,"titlePlacement":["SHOW_ON_THE_RIGHT","SHOW_BELOW"],"galleryTextAlign":"center","scrollSnap":false,"itemClick":"nothing","fullscreen":true,"videoPlay":"hover","scrollAnimation":"NO_EFFECT","slideAnimation":"SCROLL","scrollDirection":0,"scrollDuration":400,"overlayAnimation":"FADE_IN","arrowsPosition":0,"arrowsSize":23,"watermarkOpacity":40,"watermarkSize":40,"useWatermark":true,"watermarkDock":{"top":"auto","left":"auto","right":0,"bottom":0,"transform":"translate3d(0,0,0)"},"loadMoreAmount":"all","defaultShowInfoExpand":1,"allowLinkExpand":true,"expandInfoPosition":0,"allowFullscreenExpand":true,"fullscreenLoop":false,"galleryAlignExpand":"left","addToCartBorderWidth":1,"addToCartButtonText":"","slideshowInfoSize":200,"playButtonForAutoSlideShow":false,"allowSlideshowCounter":false,"hoveringBehaviour":"NEVER_SHOW","thumbnailSize":120,"magicLayoutSeed":1,"imageHoverAnimation":"NO_EFFECT","imagePlacementAnimation":"NO_EFFECT","calculateTextBoxWidthMode":"PERCENT","textBoxHeight":60,"textBoxWidth":200,"textBoxWidthPercent":75,"textImageSpace":10,"textBoxBorderRadius":0,"textBoxBorderWidth":0,"loadMoreButtonText":"","loadMoreButtonBorderWidth":1,"loadMoreButtonBorderRadius":0,"imageInfoType":"ATTACHED_BACKGROUND","itemBorderWidth":0,"itemBorderRadius":0,"itemEnableShadow":false,"itemShadowBlur":20,"itemShadowDirection":135,"itemShadowSize":10,"imageLoadingMode":"BLUR","expandAnimation":"NO_EFFECT","imageQuality":90,"usmToggle":false,"usm_a":0,"usm_r":0,"usm_t":0,"videoSound":false,"videoSpeed":"1","videoLoop":true,"jsonStyleParams":"","gallerySizeType":"px","gallerySizePx":1000,"allowTitle":true,"allowContextMenu":true,"textsHorizontalPadding":-30,"itemBorderColor":{"themeName":"color_12","value":"rgba(230,230,230,0)"},"showVideoPlayButton":true,"galleryLayout":2,"calculateTextBoxHeightMode":"MANUAL","targetItemSize":1000,"selectedLayout":"2|bottom|1|max|true|0|true","layoutsVersion":2,"selectedLayoutV2":2,"isSlideshowFont":true,"externalInfoHeight":60,"externalInfoWidth":0.75},"container":{"width":300,"galleryWidth":330,"galleryHeight":0,"scrollBase":0,"height":null}}

# Normalization methods in RNA-Seq analysis

In previous POST, we discussed several possible bias sources and how to correct them. Here Ghost wanna talk about two other bias that must be normalized in every RNA-Seq analysis.

**Heteroscedasticity issue **

For genes that are highly expressed, their high expression count usually yield large variation from sample to sample within the same group. Besides, the small amount of highly expressed gene usually skew the expression distribution and make the analysis / visualization harder. These issues can be mitigated by proper normalization:

Log: Log2(n+1). For low expressed gene, the +1 may introduce dramatic change in transformed value. However, we probably don't care those.

VST (DESeq): Take square root.

Voom (Limma): Transforms the normalized counts to logarithmic (base 2) scale and estimates their mean–variance relationship to determine a weight (log-counts per million with associated precision weights)

We can see, after the transformation, we get rid of some extreme value. Thus, migrate the heteroscedasticity problem.

**Library / lane size issue**

Since the total number of reads generated on each library / lane is different, genes in different sample may be assigned to different number of reads although these genes are expressed at the same level. We need to normalize this by:

**Total count (TC):**Gene counts are divided by the total number of mapped reads (or library size) associated with their lane and multiplied by the mean total count across all the samples of the dataset.**Upper Quartile (UQ):**Very similar in principle to TC, the total counts are replaced by the upper quartile of counts different from 0 in the computation of the normalization factors.**Median (Med):**Also similar to TC, the total counts are replaced by the median counts different from 0 in the computation of the normalization factors.**Relative Log Expression (DESeq):**This is based on the hypothesis that most genes are not DE. It normalizes the library size (mapped reads) of each lane (sample) (normalize between samples by scaling raw read counts in each lane according to a single, lane-specific factor), then divides each gene count of each sample by this size factor.**Trimmed Mean of M-values (EdgeR / Limma):**It is also based on the hypothesis that most genes are not DE.**Quantile (Q):**First proposed in the context of microarray data, this normalization method consists in matching distributions of gene counts across lanes.**Reads Per Kilobase of exon per Million mapped reads (RPKM):**normalizing by exonic length and library size.**TPM**may be a better choose than RPKM/ FPKM since it produce the same qualitative entity between sample after normalization.

**Normalization in DESeq**

DESeq internally normalizes for library size (Relative Log Expression). **Note** that neither rlog transformation nor the VST are used by the differential expression estimation in DESeq, which always operates on the raw count data, through generalized linear modeling which incorporates knowledge of the variance-mean dependence. The rlog transformation and VST are offered as separate functionality which can be used for visualization, clustering or other machine learning tasks.

**Dispersion shrinkage in DESeq2**

Gene count dispersion tends to be large for dataset 1) with small number of biological replicates 2) for genes lowly expressed. An empirical Bayes (prior derived from data itself) dispersion shrinkage is implemented on DESeq2 to handle this

Gene-wide dispersion estimation using MLE.

Fit a curve which is used as prior probability.

Obtain MAP based on the prior

The strength of shrinkage depends on the **fisher information**, not mean count. the shrinkage is intense when the gene counts widely spread across samples (large dispersion).

This method can be viewed as bias-variance trade-off, reducing variance at the expense of accepting bias towards zero.

**Normalization in Limma**

Limma was initially build to handle microarray data. It is based on linear model and use TMM library / lane normalization of the edgeR package. Then:

If library size across samples consistent (within 3-fold):

Choose limma-trend (convert count to logCPM in advance)

Else:

Choose voom (apply quantile normalization if data is noisy) in which (counts is taken logarithm)

Start standard limma DE analysis using linear model