An introduction to the bambu package using NanoporeRNASeq data

Introduction

NanoporeRNASeq contains RNA-Seq data from the K562 and MCF7 cell lines that were generated by the SG-NEx project (https://github.com/GoekeLab/sg-nex-data). Each of these cell line has three replicates, with 1 direct RNA sequencing data and 2 cDNA sequencing data. The files contains reads aligned to the human genome (Grch38) chromosome 22 (1:25409234).

Accessing NanoporeRNASeq data

Load the NanoporeRNASeq package

List the samples

List the available BamFile

Get the annotation GRangesList

Visualizing gene of interest from a single bam file

We can visualize the one sample for a single gene ENST00000215832 (MAPK1)

library(ggbio)
range <- HsChr22BambuAnnotation$ENST00000215832
# plot mismatch track
library(BSgenome.Hsapiens.NCBI.GRCh38)
# plot annotation track
tx <- autoplot(range, aes(type = model, col = strand), group.selfish = TRUE)
# plot coverage track
coverage <- autoplot(bamFiles[[1]], aes(col = coverage), which = range)

# merge the tracks into one plot
tracks(annotation = tx, coverage = coverage, heights = c(1, 3)) + theme_minimal()

Running Bambu with NanoporeRNASeq data

Load the bambu package

Run bambu

Applying bambu to bamFiles

bambu returns a SummarizedExperiment object

Visualizing gene examples

We can visualize the annotated and novel isoforms identified in this gene example using plot functions from bambu

##> [[1]]
##> TableGrob (3 x 1) "arrange": 3 grobs
##>   z     cells    name                grob
##> 1 1 (2-2,1-1) arrange      gtable[layout]
##> 2 2 (3-3,1-1) arrange      gtable[layout]
##> 3 3 (1-1,1-1) arrange text[GRID.text.262]
sessionInfo()
##> R version 4.1.0 (2021-05-18)
##> Platform: x86_64-pc-linux-gnu (64-bit)
##> Running under: Ubuntu 20.04.2 LTS
##> 
##> Matrix products: default
##> BLAS:   /home/biocbuild/bbs-3.13-bioc/R/lib/libRblas.so
##> LAPACK: /home/biocbuild/bbs-3.13-bioc/R/lib/libRlapack.so
##> 
##> locale:
##>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##>  [3] LC_TIME=en_US.UTF-8        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] stats4    parallel  stats     graphics  grDevices utils     datasets 
##> [8] methods   base     
##> 
##> other attached packages:
##>  [1] bambu_1.2.0                           
##>  [2] SummarizedExperiment_1.22.0           
##>  [3] Biobase_2.52.0                        
##>  [4] MatrixGenerics_1.4.0                  
##>  [5] matrixStats_0.59.0                    
##>  [6] BSgenome.Hsapiens.NCBI.GRCh38_1.3.1000
##>  [7] BSgenome_1.60.0                       
##>  [8] rtracklayer_1.52.0                    
##>  [9] ggbio_1.40.0                          
##> [10] ggplot2_3.3.5                         
##> [11] Rsamtools_2.8.0                       
##> [12] Biostrings_2.60.1                     
##> [13] XVector_0.32.0                        
##> [14] GenomicRanges_1.44.0                  
##> [15] GenomeInfoDb_1.28.1                   
##> [16] IRanges_2.26.0                        
##> [17] S4Vectors_0.30.0                      
##> [18] NanoporeRNASeq_1.2.1                  
##> [19] ExperimentHub_2.0.0                   
##> [20] AnnotationHub_3.0.1                   
##> [21] BiocFileCache_2.0.0                   
##> [22] dbplyr_2.1.1                          
##> [23] BiocGenerics_0.38.0                   
##> 
##> loaded via a namespace (and not attached):
##>   [1] backports_1.2.1               Hmisc_4.5-0                  
##>   [3] plyr_1.8.6                    lazyeval_0.2.2               
##>   [5] splines_4.1.0                 BiocParallel_1.26.1          
##>   [7] digest_0.6.27                 foreach_1.5.1                
##>   [9] ensembldb_2.16.2              htmltools_0.5.1.1            
##>  [11] fansi_0.5.0                   magrittr_2.0.1               
##>  [13] checkmate_2.0.0               memoise_2.0.0                
##>  [15] cluster_2.1.2                 prettyunits_1.1.1            
##>  [17] jpeg_0.1-8.1                  colorspace_2.0-2             
##>  [19] blob_1.2.1                    rappdirs_0.3.3               
##>  [21] xfun_0.24                     dplyr_1.0.7                  
##>  [23] crayon_1.4.1                  RCurl_1.98-1.3               
##>  [25] jsonlite_1.7.2                graph_1.70.0                 
##>  [27] iterators_1.0.13              survival_3.2-11              
##>  [29] VariantAnnotation_1.38.0      glue_1.4.2                   
##>  [31] gtable_0.3.0                  zlibbioc_1.38.0              
##>  [33] DelayedArray_0.18.0           shape_1.4.6                  
##>  [35] scales_1.1.1                  DBI_1.1.1                    
##>  [37] GGally_2.1.2                  Rcpp_1.0.6                   
##>  [39] xtable_1.8-4                  progress_1.2.2               
##>  [41] htmlTable_2.2.1               foreign_0.8-81               
##>  [43] bit_4.0.4                     OrganismDbi_1.34.0           
##>  [45] Formula_1.2-4                 glmnet_4.1-2                 
##>  [47] htmlwidgets_1.5.3             httr_1.4.2                   
##>  [49] RColorBrewer_1.1-2            ellipsis_0.3.2               
##>  [51] farver_2.1.0                  pkgconfig_2.0.3              
##>  [53] reshape_0.8.8                 XML_3.99-0.6                 
##>  [55] nnet_7.3-16                   sass_0.4.0                   
##>  [57] utf8_1.2.1                    labeling_0.4.2               
##>  [59] tidyselect_1.1.1              rlang_0.4.11                 
##>  [61] reshape2_1.4.4                later_1.2.0                  
##>  [63] AnnotationDbi_1.54.1          munsell_0.5.0                
##>  [65] BiocVersion_3.13.1            tools_4.1.0                  
##>  [67] cachem_1.0.5                  generics_0.1.0               
##>  [69] RSQLite_2.2.7                 evaluate_0.14                
##>  [71] stringr_1.4.0                 fastmap_1.1.0                
##>  [73] yaml_2.2.1                    knitr_1.33                   
##>  [75] bit64_4.0.5                   purrr_0.3.4                  
##>  [77] KEGGREST_1.32.0               AnnotationFilter_1.16.0      
##>  [79] RBGL_1.68.0                   mime_0.11                    
##>  [81] formatR_1.11                  xml2_1.3.2                   
##>  [83] biomaRt_2.48.2                compiler_4.1.0               
##>  [85] rstudioapi_0.13               filelock_1.0.2               
##>  [87] curl_4.3.2                    png_0.1-7                    
##>  [89] interactiveDisplayBase_1.30.0 tibble_3.1.2                 
##>  [91] bslib_0.2.5.1                 stringi_1.6.2                
##>  [93] highr_0.9                     GenomicFeatures_1.44.0       
##>  [95] lattice_0.20-44               ProtGenerics_1.24.0          
##>  [97] Matrix_1.3-4                  vctrs_0.3.8                  
##>  [99] pillar_1.6.1                  lifecycle_1.0.0              
##> [101] BiocManager_1.30.16           jquerylib_0.1.4              
##> [103] data.table_1.14.0             bitops_1.0-7                 
##> [105] httpuv_1.6.1                  R6_2.5.0                     
##> [107] BiocIO_1.2.0                  latticeExtra_0.6-29          
##> [109] promises_1.2.0.1              gridExtra_2.3                
##> [111] codetools_0.2-18              dichromat_2.0-0              
##> [113] assertthat_0.2.1              rjson_0.2.20                 
##> [115] withr_2.4.2                   GenomicAlignments_1.28.0     
##> [117] GenomeInfoDbData_1.2.6        hms_1.1.0                    
##> [119] grid_4.1.0                    rpart_4.1-15                 
##> [121] rmarkdown_2.9                 biovizBase_1.40.0            
##> [123] shiny_1.6.0                   base64enc_0.1-3              
##> [125] restfulr_0.0.13