
Creating a L2FC(kdeg) matrix that can be passed to heatmap functions
Source:R/Visualizations.R
      Heatmap_kdeg.RdHeatmap_kdeg creates a matrix where each column represents a pair of samples (reference and experimental) and each
row represents a feature. The entry in the ith row and jth column is the L2FC(kdeg) for feature i when comparing sample with
experimental ID j+1 to the reference sample
Arguments
- obj
- Object outputted by - bakRFit
- zscore
- Logical; if TRUE, then each matrix entry is log-odds fold change in the fraction new (a.k.a the effect size) divided by the uncertainty in the effect size 
- filter_sig
- Logical; if TRUE, then only features which have a statistically significant L2FC(kdeg) in at least one comparison are kept 
- FDR
- Numeric; False discovery to control at if filter_sig is TRUE. 
Value
A matrix. Rows represent transcripts which were differentially expressed and columns represent (from left to right) differential kinetics z-score, differential expression z-score, and a mechanism score where positive represents synthesis driven and negative degradation driven changes in expression.
Examples
# \donttest{
# Simulate data
sim <- Simulate_bakRData(1000)
# Fit data with fast implementation
Fit <- bakRFit(sim$bakRData)
#> Finding reliable Features
#> Filtering out unwanted or unreliable features
#> Processing data...
#> Estimating pnew with likelihood maximization
#> Estimating unlabeled mutation rate with -s4U data
#> Estimated pnews and polds for each sample are:
#> # A tibble: 6 × 4
#> # Groups:   mut [2]
#>     mut  reps   pnew    pold
#>   <int> <dbl>  <dbl>   <dbl>
#> 1     1     1 0.0501 0.00100
#> 2     1     2 0.0499 0.00100
#> 3     1     3 0.0500 0.00100
#> 4     2     1 0.0501 0.00100
#> 5     2     2 0.0499 0.00100
#> 6     2     3 0.0498 0.00100
#> Estimating fraction labeled
#> Estimating per replicate uncertainties
#> Estimating read count-variance relationship
#> Averaging replicate data and regularizing estimates
#> Assessing statistical significance
#> All done! Run QC_checks() on your bakRFit object to assess the 
#>             quality of your data and get recommendations for next steps.
# L2FC(kdeg) heatmap matrix
L2FC_kdeg_heat <- Heatmap_kdeg(Fit$Fast_Fit)
# }