knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.dim = c(6, 4) )
Make sure you have version 1.0.0 of bakR installed.
library(bakR) set.seed(123)
The 1st step to using bakR with fraction new estimates as input is to create a bakRFnData object. A bakRFnData object consists of two components: a fns data frame and a metadf data frame.
fns stands for "fraction new estimates" and contains information regarding the estimates for the fraction of sequencing reads from a given feature that were new in a given sample. metadf stands
for metadata data frame and contains important information about the
experimental details of each sample (i.e., how long the metabolic label
feed was, which samples are reference samples, and which are experimental
samples). Examples of what these data structures are available via calls to
data("fns")
and data("metadf")
, for the fns data frame and metadf respectively.
A fns data frame consists of rows corresponding to fraction new estimate information for a given feature. In particular, there are 4 required (and one optional) columns in the fns data frame:
The metadf data frame is described in both the "bakR for people in a hurry" and "Differential kinetic analysis with bakR" vignettes.
One route by which to obtain the fns data frame is via GRAND-SLAM, an efficient and user friendly tool developed by the Erhard lab which implements a binomial mixture model originally described by our lab. GRAND-SLAM outputs a table named run_name.tsv (where run_name is whatever you specified when running GRAND-SLAM), which can be quickly converted to a fns data frame. You can then create a bakRFnData object as follows:
# Load GRAND-SLAM table and metadf data("GS_table") data("metadf") # Create fns data frame from GRAND-SLAM output fns <- GSprocessing(GS_table) # Create bakRFnData object bfndo <- bakRFnData(fns, metadf)
After creating the bakRFnData object, you must first run bakR's most efficient implementation (the MLE implementation from the bakR manuscript).:
# Run the efficient model Fit <- bakRFit(bfndo)
bakRFit() is used here as a wrapper for two functions in bakR: fn_process() and fast_analysis(). For
more details on what these functions do, run ?fn_process
or fast_analysis
.
When using fraction new estimates as input, only one of the two more highly powered implementations may be used (the Hybrid implementation from the bakR manuscript). You can run this as follows:
# Run Hybrid model (This might take several minutes to run) Fit <- bakRFit(Fit, HybridFit = TRUE)
The Fit objects contain lists pertaining to the fits of each of the models. The possible contents include:
bakR provides a variety of easy to use functions for beginning to investigate your data. The visualizations are particularly aimed at revealing trends in RNA stabilization or destabilization. These include MA plots:
## MA Plot with Fast Fit bakR::plotMA(Fit, Model = "MLE")
Volcano plots:
## Volcano Plot with Fast Fit; significance assessed relative to an FDR control of 0.05 plotVolcano(Fit$Fast_Fit)
and PCA plots:
## 2D PCA plot with replicate fraction news FnPCA2(Fit, Model = "MLE")
This vignette provides the minimal amount of information to get up and running with bakR using fraction new estimates as input. If you would like a more thorough discussion of each step of this process, check out the long form version of the intro to bakR vignette ("Differential kinetic analysis with bakR"). In addition, there are a number of other vignettes that cover various topics not discussed in these intro vignettes:
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.