plot_volcano {baldur} | R Documentation |
plot_volcano
returns a ggplot
with a graphical representation between the
-log10(err) and LFC.
plot_volcano(results, alpha = 0.05, lfc = NULL)
results |
Output generated by
|
alpha |
Significance cut-off; used to draw a line indicating where significance starts |
lfc |
LFC cut-off; used to draw lines for |
plot_volcano
returns a ggplot
object
# Setup model matrix
design <- model.matrix(~ 0 + factor(rep(1:2, each = 3)))
colnames(design) <- paste0("ng", c(50, 100))
yeast_norm <- yeast %>%
# Remove missing data
tidyr::drop_na() %>%
# Normalize data
psrn('identifier') %>%
# Add mean-variance trends
calculate_mean_sd_trends(design)
# Fit the gamma regression
gam <- fit_gamma_regression(yeast_norm, sd ~ mean)
# Estimate each data point's uncertainty
unc <- estimate_uncertainty(gam, yeast_norm, 'identifier', design)
yeast_norm <- gam %>%
# Add hyper-priors for sigma
estimate_gamma_hyperparameters(yeast_norm)
# Setup contrast matrix
contrast <- matrix(c(-1, 1), 2)
results <- yeast_norm %>%
head() %>% # Just run a few for the example
infer_data_and_decision_model(
'identifier',
design,
contrast,
unc,
clusters = 1 # I highly recommend increasing the number of parallel workers/clusters
# this will greatly reduce the speed of running baldur
)
# Plot indicating where alpha = 0.05
plot_volcano(results, alpha = 0.05)
# Plot indicating where alpha = 0.01 and where LFC = 1
plot_volcano(results, alpha = 0.01, 1)