Maintainer: Ji-Ping Wang, <>

(Python package download)**

Reference: Xiong, B., Yang, Y., Fineis, F. Wang, J.-P., DegNorm: normalization of generalized transcript degradation improves accuracy in RNA-seq analysis, Genome Biology, 2019,20:75

What is DegNorm?

DegNorm, short for Degradation Normalization, is a bioinformatics pipeline designed to correct for bias due to the heterogeneous patterns of transcript degradation in RNA-seq data. DegNorm helps improve the accuracy of the differential expression analysis by accounting for this degradation.

In practice, RNA samples are often more-or-less degraded, and the degradation severity is not only sample-specific, but gene-specific as well. It is known that longer genes tend to degrade faster than shorter ones. As such, commonplace global degradation normalization approaches that impose a single normalization factor on all genes within a sample can be ineffective in correcting for RNA degradation bias.

DegNorm pipline available formats

We’ve developed an R package and an indepedent Python package (download), both of which allow to run the entire pipeline from the RNA-seq alignment (.bam) files.

Install DegNorm R package

DegNorm main features

DegNorm R package contains two major functions: (1) processing the RNA-seq alignment file (.bam) to calculate the coverage; and (2) using a core algorithm written in RcppArmadillo to perform rank-one over-approximation on converage matrices for each gene to estimate the degramation index (DI) score for each gene within each sample.

DegNorm outputs DI scores together with degradation-normalized read counts (based on DI scores). It also provides supplementary functions for visualization of degradation at both gene and sample level. The following diagram illustrates the flow of DegNorm pipeline.

 

A diagram of DegNorm.

A diagram of DegNorm.

 

The following vignette is intended to provide example codes for running DegNorm R package. It presumes that you have successfully installed DegNorm package. We illustrate below how to: 1) calculate the read coverage curves for all genes within all samples, and 2) perform degradation normalization on coverage curves. Either step is computing intensive. Dependent upon the number of samples and the sequencing depth, the total computing time may last a few hours. DegNorm utilizes the parallel computing functionality of R and automatically detects the number of cores on your computer to run jobs in parallel. Due to the large size of bam file and limited computing power of personal computer, we recommend users to run it in servers or computing clusters.

1. Compute coverage score based on alignment .bam files

Run main function to create read coverage matrix and read counts

cores argument specifies the number of cores to use. Users should try to use as many as possible cores to maximize the computing efficiency.

Function read_coverage_batch returns the coverage matrices as a list, one per gene, and a dataframe for read counts, each row for one gene and each column for one sample.

2. DegNorm core algorithm

Run degnorm core algorithm for degradation normalization. DegNorm purpose is for differential expression analysis. Thus genes with extremely low read counts from all samples are filtered out. The current filtering criterion is that if more than half of the samples have less than 5 read count, that gene will not be considered in the degnorm algorithm. In the following example, I am using downsamling to save time below (default). Alternatively you can set down_sampling = 0, which takes longer time. If down_samplin= 1, read coverage scores are binned with size by grid_size for baseline selection to achieve better efficiency. The default grid_size is 10 bp. We recommend to use a grid_size less than 50 bp. iteration specifies the big loop in DegNorm algorithm and 5 is usually sufficient. loop specifies the iteration number in the matrix factorization over-approximation.

If down_sampling= 0, then the argument grid_size is ignored.

Function degnorm returns a list of multiple objects. counts_normed is the one with degradation normalized read counts for you to input DeSeq or EdgeR for DE analysis.

The difference of number of genes between res_DegNorm and coverage_res is 207 (339-132). The 207 genes were filtered out from degnorm degradation normalization because less than half of the samples (3) have more than 5 read count.

3. Plot functions in DegNorm

DegNorm provides four plot functions for visualization of degradation and sample quality diagnosis.

  • plot_coverage
  • plot_corr
  • plot_heatmap
  • plot_boxplot

– Boxplot of the degradation index(DI) scores

– Heatmap plot of the degradation index(DI) scores

– Correlation matrix plot of degradation index(DI) scores

Session info

sessionInfo()
#> R version 4.2.0 (2022-04-22)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 20.04.4 LTS
#> 
#> Matrix products: default
#> BLAS:   /home/biocbuild/bbs-3.15-bioc/R/lib/libRblas.so
#> LAPACK: /home/biocbuild/bbs-3.15-bioc/R/lib/libRlapack.so
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_GB              LC_COLLATE=C              
#>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] knitr_1.39    DegNorm_1.6.1
#> 
#> loaded via a namespace (and not attached):
#>   [1] colorspace_2.0-3            rjson_0.2.21               
#>   [3] ellipsis_0.3.2              XVector_0.36.0             
#>   [5] GenomicRanges_1.48.0        farver_2.1.0               
#>   [7] bit64_4.0.5                 AnnotationDbi_1.58.0       
#>   [9] fansi_1.0.3                 xml2_1.3.3                 
#>  [11] codetools_0.2-18            doParallel_1.0.17          
#>  [13] cachem_1.0.6                jsonlite_1.8.0             
#>  [15] Rsamtools_2.12.0            dbplyr_2.2.0               
#>  [17] png_0.1-7                   compiler_4.2.0             
#>  [19] httr_1.4.3                  assertthat_0.2.1           
#>  [21] Matrix_1.4-1                fastmap_1.1.0              
#>  [23] lazyeval_0.2.2              cli_3.3.0                  
#>  [25] htmltools_0.5.2             prettyunits_1.1.1          
#>  [27] tools_4.2.0                 gtable_0.3.0               
#>  [29] glue_1.6.2                  GenomeInfoDbData_1.2.8     
#>  [31] reshape2_1.4.4              dplyr_1.0.9                
#>  [33] rappdirs_0.3.3              Rcpp_1.0.8.3               
#>  [35] Biobase_2.56.0              jquerylib_0.1.4            
#>  [37] vctrs_0.4.1                 Biostrings_2.64.0          
#>  [39] rtracklayer_1.56.1          iterators_1.0.14           
#>  [41] crosstalk_1.2.0             xfun_0.31                  
#>  [43] stringr_1.4.0               lifecycle_1.0.1            
#>  [45] restfulr_0.0.15             XML_3.99-0.10              
#>  [47] dendextend_1.15.2           zlibbioc_1.42.0            
#>  [49] scales_1.2.0                TSP_1.2-0                  
#>  [51] hms_1.1.1                   MatrixGenerics_1.8.1       
#>  [53] parallel_4.2.0              SummarizedExperiment_1.26.1
#>  [55] RColorBrewer_1.1-3          yaml_2.3.5                 
#>  [57] curl_4.3.2                  memoise_2.0.1              
#>  [59] heatmaply_1.3.0             gridExtra_2.3              
#>  [61] ggplot2_3.3.6               sass_0.4.1                 
#>  [63] biomaRt_2.52.0              stringi_1.7.6              
#>  [65] RSQLite_2.2.14              highr_0.9                  
#>  [67] S4Vectors_0.34.0            BiocIO_1.6.0               
#>  [69] foreach_1.5.2               seriation_1.3.5            
#>  [71] GenomicFeatures_1.48.3      BiocGenerics_0.42.0        
#>  [73] filelock_1.0.2              BiocParallel_1.30.3        
#>  [75] GenomeInfoDb_1.32.2         rlang_1.0.2                
#>  [77] pkgconfig_2.0.3             matrixStats_0.62.0         
#>  [79] bitops_1.0-7                evaluate_0.15              
#>  [81] lattice_0.20-45             purrr_0.3.4                
#>  [83] GenomicAlignments_1.32.0    htmlwidgets_1.5.4          
#>  [85] labeling_0.4.2              bit_4.0.4                  
#>  [87] tidyselect_1.1.2            plyr_1.8.7                 
#>  [89] magrittr_2.0.3              R6_2.5.1                   
#>  [91] IRanges_2.30.0              generics_0.1.2             
#>  [93] DelayedArray_0.22.0         DBI_1.1.3                  
#>  [95] pillar_1.7.0                KEGGREST_1.36.2            
#>  [97] RCurl_1.98-1.7              tibble_3.1.7               
#>  [99] crayon_1.5.1                utf8_1.2.2                 
#> [101] BiocFileCache_2.4.0         plotly_4.10.0              
#> [103] rmarkdown_2.14              viridis_0.6.2              
#> [105] progress_1.2.2              grid_4.2.0                 
#> [107] data.table_1.14.2           blob_1.2.3                 
#> [109] digest_0.6.29               webshot_0.5.3              
#> [111] tidyr_1.2.0                 stats4_4.2.0               
#> [113] munsell_0.5.0               registry_0.5-1             
#> [115] viridisLite_0.4.0           bslib_0.3.1