bambu is a R package for multi-sample transcript discovery and quantification using long read RNA-Seq data. You can use bambu after read alignment to obtain expression estimates for known and novel transcripts and genes. The output from bambu can directly be used for visualisation and downstream analysis such as differential gene expression or transcript usage.
You can install bambu from github:
if (!requireNamespace("devtools", quietly = TRUE))
install.packages("devtools")
devtools::install_github("GoekeLab/bambu")
The default mode to run bambu is using a set of aligned reads (bam files), reference genome annotations (gtf file, TxDb object, or bambuAnnotation object), and reference genome sequence (fasta file or BSgenome). bambu* will return a summarizedExperiment object with the genomic coordinates for annotated and new transcripts and transcript expression estimates:
```rscript library(bambu)
test.bam <- system.file(“extdata”, “SGNex_A549_directRNA_replicate5_run1_chr9_1_1000000.bam”, package = “bambu”)
se <- bambu(reads = test.bam, annotations = “TxDb.Hsapiens.UCSC.hg38.knownGene”, genomeSequence = “BSgenome.Hsapiens.NCBI.GRCh38”)
```
We highly recommend to use the same annotations that were used for genome alignment. If you have a gtf file and fasta file you can run bambu with the following options:
test.bam <- system.file("extdata", "SGNex_A549_directRNA_replicate5_run1_chr9_1_1000000.bam", package = "bambu")
fa.file <- system.file("extdata", "Homo_sapiens.GRCh38.dna_sm.primary_assembly_chr9_1_1000000.fa", package = "bambu")
gtf.file <- system.file("extdata", "Homo_sapiens.GRCh38.91_chr9_1_1000000.gtf", package = "bambu")
bambuAnnotations <- prepareAnnotationsFromGTF(gtf.file)
se <- bambu(reads = test.bam, annotations = bambuAnnotations, genomeSequence = fa.file)
Quantification of annotated transcripts and genes only (no transcript/gene discovery)
bambu(reads = test.bam, annotations = txdb, genomeSequence = fa.file, extendAnnotations = FALSE)
Large sample number/ limited memory
For larger sample numbers we recommend to write the processed data to a file:
bambu(reads = test.bam, readClass.outputDir = "./bambu/", annotations = bambuAnnotations, genomeSequence = fa.file)
You can also use precalculated annotations.
If you plan to run bambu more frequently, we recommend to save the bambuAnnotations object.
The bambuAnnotation object can be calculated from a .gtf file:
annotations <- prepareAnnotationFromGTF(gtf.file)
From TxDb object
annotations <- prepareAnnotations(txdb)
More stringent filtering thresholds imposed on potential novel transcripts
bambu(reads, annotations, genomeSequence, isoreParameters = list(min.readCount = 5))
bambu(reads, annotations, genomeSequence, isoreParameters = list(min.sampleNumber = 5))
bambu(reads, annotations, genomeSequence, isoreParameters = list(min.readFractionByGene = 0.1))
Quantification without bias correction
The default estimation automatically does bias correction for expression estimates. However, you can choose to perform the quantification without bias correction.
bambu(reads, annotations, genomeSequence, emParameters = list(bias = FALSE))
Parallel computation
bambu allows parallel computation.
bambu(reads, annotations, genomeSequence, ncore = 8)
See manual for details to customize other conditions.
Transcript expression to gene expression
transcriptToGeneExpression(se)
Visualization
You can visualize the novel genes/transcripts using plot.bambu function
plot.bambu(se, type = "annotation", gene_id)
plot.bambu(se, type = "annotation", transcript_id)
plot.bambu(se, type = "heatmap") # heatmap
plot.bambu(se, type = "pca") # PCA visualization
plot.bambu(se, type = "heatmap", group.var) # heatmap
plot.bambu(se, type = "pca", group.var) # PCA visualization
Write bambu outputs to files
writeBambuOutput(se, path = "./bambu/")
This package is developed and maintained by Ying Chen, Yuk Kei Wan, and Jonathan Goeke at the Genome Institute of Singapore. If you want to contribute, please leave an issue. Thank you.