do_VolcanoPlot: Compute a Volcano plot out of DE genes.

View source: R/do_VolcanoPlot.R

do_VolcanoPlotR Documentation

Compute a Volcano plot out of DE genes.

Description

Compute a Volcano plot out of DE genes.

Usage

do_VolcanoPlot(
  sample,
  de_genes,
  pval_cutoff = 0.05,
  FC_cutoff = 2,
  pt.size = 2,
  border.size = 1.5,
  border.color = "black",
  font.size = 14,
  font.type = "sans",
  plot.title = NULL,
  plot.subtitle = NULL,
  plot.caption = NULL,
  plot_lines = TRUE,
  line_color = "grey75",
  line_size = 0.5,
  add_gene_tags = TRUE,
  add_tag_side = "both",
  order_tags_by = "both",
  tag_size = 6,
  n_genes = 5,
  use_labels = FALSE,
  colors.use = "steelblue",
  plot.title.face = "bold",
  plot.subtitle.face = "plain",
  plot.caption.face = "italic",
  axis.title.face = "bold",
  axis.text.face = "plain",
  legend.title.face = "bold",
  legend.text.face = "plain"
)

Arguments

sample

Seurat | A Seurat object, generated by CreateSeuratObject.

de_genes

tibble | Output of Seurat::FindMarkers().

pval_cutoff

numeric | Cutoff for the p-value.

FC_cutoff

numeric | Cutoff for the avg_log2FC.

pt.size

numeric | Size of the dots.

border.size

numeric | Width of the border of the cells.

border.color

character | Color for the border of the heatmap body.

font.size

numeric | Overall font size of the plot. All plot elements will have a size relationship with this font size.

font.type

character | Base font family for the plot. One of:

  • mono: Mono spaced font.

  • serif: Serif font family.

  • sans: Default font family.

plot.title, plot.subtitle, plot.caption

character | Title, subtitle or caption to use in the plot.

plot_lines

logical | Whether to plot the division lines.

line_color

character | Color for the lines.

line_size

numeric | Size of the lines in the plot.

add_gene_tags

logical | Whether to plot the top genes.

add_tag_side

logical | Either "both", "positive" or "negative" to indicate which side of genes to tag

order_tags_by

character | Either "both", "pvalue" or "logfc".

tag_size

numeric | Size of the text/label for the tags.

n_genes

numeric | Number of top genes to plot.

use_labels

logical | Whether to use labels instead of text for the tags.

colors.use

character | Color to generate a tetradic color scale with.

plot.title.face, plot.subtitle.face, plot.caption.face, axis.title.face, axis.text.face, legend.title.face, legend.text.face

character | Controls the style of the font for the corresponding theme element. One of:

  • plain: For normal text.

  • italic: For text in itallic.

  • bold: For text in bold.

  • bold.italic: For text both in itallic and bold.

Value

A volcano plot as a ggplot2 object.

Examples


  # Check Suggests.
  value <- SCpubr:::check_suggests(function_name = "do_VolcanoPlot", passive = TRUE)

  if (isTRUE(value)){
    # Consult the full documentation in https://enblacar.github.io/SCpubr-book/

    # Define your Seurat object.
    sample <- readRDS(system.file("extdata/seurat_dataset_example.rds", package = "SCpubr"))

    # Retrieve DE genes.
    de_genes <- readRDS(system.file("extdata/de_genes_example.rds", package = "SCpubr"))

    # Generate a volcano plot.
    p <- SCpubr::do_VolcanoPlot(sample = sample,
                                de_genes = de_genes)
    p

  } else if (base::isFALSE(value)){
    message("This function can not be used without its suggested packages.")
    message("Check out which ones are needed using `SCpubr::state_dependencies()`.")
  }


enblacar/SCpubr documentation built on Aug. 25, 2024, 9:45 p.m.