plotMA_hPTM: Plot the histone PTMs fold changes as an MA plot.

View source: R/epiprofile_plot.R

plotMA_hPTMR Documentation

Plot the histone PTMs fold changes as an MA plot.

Description

Plot the histone PTMs fold changes as an MA plot.

Usage

plotMA_hPTM(
  data,
  sample_name,
  RT_min_sd_thrshld = 2,
  fc_thrshld = 2,
  area_max_thrshld = 2e+12,
  label_txt_size = 2,
  Pseudocount_value = 1
)

Arguments

data

A tibble processed with get_hPTM_FC().

sample_name

Character. Name of the sample to plot.

RT_min_sd_thrshld

Numeric. A minimum threshold for the retention time standard deviation across all samples in the tibble for an individual PTM. Defatult 2 min.

fc_thrshld

Numeric. Label histone PTMs in the plot with absolute log2 fold change higher than fc_thrshld. Default 2.

area_max_thrshld

Numeric. Label histone PTMs in the plot with with average area across samples higher higher than area_max_thrshld. Default 2e12.

label_txt_size

Numeric. Size of the labels in the plot.

Pseudocount_value

Numeric. Pseudo count value used in get_hPTM_FC(), used only for plotting info, not actually added. Default 1.

Details

This plotting function is inspired by bulk mRNA-seq MA plots as in DESeq2 analysis. Histone PTMs are coloured following Karolin Luger's histone proteins palette.

Value

A nice ggplot.

Examples

read_EpiProfile_histone_ratio("path/to/histone_ratio.xls") |>
    tidy_hPTMs() |>
    get_hPTM_FC(Reference_Sample_Name = 'WT_1_DIA') |>
    plotMA_hPTM(data = subset(RT_sd <= 2 & Ratio > 0.000004 & Area != 1),
                sample_name = "KO_2_DIA")

Ni-Ar/niar documentation built on Feb. 3, 2025, 9:25 a.m.