Skip to contents

Creates a ggplot2 style volcano plot for exploring the results from a DESeq2 DGE analysis with parameters for easy styling

Usage

geom_deseq2_volcano(
  deseq2_diff_expr_output,
  log2_fc_threshold = 2,
  p_adj_threshold = 0.05,
  n_positive_labels = 25,
  n_negative_labels = 25,
  label_vector = NULL,
  point_label_nudge_x = 0,
  point_label_nudge_y = 0,
  condition_label_x = 5
)

Arguments

deseq2_diff_expr_output

DESeq2 object, works directly from get_deseq2_diff_expr() output

log2_fc_threshold

Numeric cutoff for coloring points based on log fold change, default: 2

p_adj_threshold

Numeric cutoff for coloring points based on adjust P-value significance, default: 0.05

n_positive_labels

Number of top genes to label on positive side of log fold change, default: 25

n_negative_labels

Number of top genes to label on negative side of log fold change, default: 25

label_vector

Set of a priori genes to label, cannot be used in tandem with top N genes

point_label_nudge_x

Distance on x-axis to adjust the gene labels, can be positive or negative value, default: 0

point_label_nudge_y

Distance on y-axis to adjust the gene labels, can be positive or negative value, default: 0

condition_label_x

Location on x-axis to put condition labels, default: 5

Value

ggplot object

Examples

# Run the DESeq2 DGE workflow
# dge_demo <- get_deseq2_diff_expr(
# counts_file_path = fs::path_package("extdata", "hmcl_counts.hg38.txt.gz", package = "devgru"),
# condition_file_path = fs::path_package("extdata", "hmcl_conditions.hg38.txt", package = "devgru"),
# gene_universe = gene_body_hg38,
# gene_symbol_column = "#GENE",
# ensembl_id_column = NULL,
# formula_string = "U266 ~ RPMI8226",
# min_transcripts = 10)

# Exploratory plot with top 25 genes labeled on both ends of spectrum
# geom_deseq2_volcano(deseq2_diff_expr_output = dge_demo)

# Targeted assessment with labels for genes of interest
# geom_deseq2_volcano(deseq2_diff_expr_output = dge_demo, label_vector = c("CCND1","MYC","MYCL"))