Learn R Programming

bakR (version 1.0.1)

NSSHeat: Construct heatmap for non-steady state (NSS) analysis

Description

This uses the output of bakR and a differential expression analysis software to construct a dataframe that can be passed to pheatmap::pheatmap(). This heatmap will display the result of a steady-state quasi-independent analysis of NR-seq data.

Usage

NSSHeat(
  bakRFit,
  DE_df,
  bakRModel = c("MLE", "Hybrid", "MCMC"),
  DE_cutoff = 0.05,
  bakR_cutoff = 0.05,
  Exp_ID = 2,
  lid = 4
)

Value

returns data frame that can be passed to pheatmap::pheatmap()

Arguments

bakRFit

bakRFit object

DE_df

dataframe of required format with differential expression analysis results. See Further-Analyses vignette for details on what this dataframe should look like

bakRModel

Model fit from which bakR implementation should be used? Options are MLE, Hybrid, or MCMC

DE_cutoff

padj cutoff for calling a gene differentially expressed

bakR_cutoff

padj cutoff for calling a fraction new significantly changed

Exp_ID

Exp_ID of experimental sample whose comparison to the reference sample you want to use. Only one reference vs. experimental sample comparison can be used at a time

lid

Maximum absolute value for standardized score present in output. This is for improving aesthetics of any heatmap generated with the output.

Examples

Run this code
# \donttest{
# Simulate small dataset
sim <- Simulate_bakRData(100, nreps = 2)

# Analyze data with bakRFit
Fit <- bakRFit(sim$bakRData)

# Number of features that made it past filtering
NF <- nrow(Fit$Fast_Fit$Effects_df)

# Simulate mock differential expression data frame
DE_df <- data.frame(XF = as.character(1:NF),
                       L2FC_RNA = stats::rnorm(NF, 0, 2))

DE_df$DE_score <- DE_df$L2FC_RNA/0.5
DE_df$DE_se <- 0.5

DE_df$DE_pval <- 2*stats::dnorm(-abs(DE_df$DE_score))
DE_df$DE_padj <- 2*stats::p.adjust(DE_df$DE_pval, method = "BH")

# perform NSS analysis
NSS_analysis <- DissectMechanism(bakRFit = Fit,
               DE_df = DE_df,
               bakRModel = "MLE")

# }

Run the code above in your browser using DataLab