gpatterns.global_meth_trend: Plot global methylation stratified on other tracks

View source: R/avg_meth.R

gpatterns.global_meth_trendR Documentation

Plot global methylation stratified on other tracks

Description

calculates the average methylation (m / m + um) in each bin of strat_track and plots it. By default, plots the average methylation in different bins of CpG content. This can be used as a sanity check for methylation data - in general, methylation is high for regions with low CpG density, and low for CpG dense regions (e.g. CpG islands).

Usage

gpatterns.global_meth_trend(
  tracks,
  strat_track = .gpatterns.cg_cont_500_track,
  strat_breaks = seq(0, 0.08, by = 0.002),
  intervals = .gpatterns.genome_cpgs_intervals,
  iterator = .gpatterns.genome_cpgs_intervals,
  min_cov = NULL,
  min_cgs = NULL,
  names = NULL,
  groups = NULL,
  group_name = NULL,
  include.lowest = TRUE,
  ncol = 2,
  nrow = 2,
  width = 600,
  height = 560,
  fig_fn = NULL,
  xlab = strat_track,
  ylim = c(0, 1),
  title = "",
  legend = TRUE,
  colors = NULL,
  parallel = getOption("gpatterns.parallel")
)

Arguments

tracks

tracks to plot

strat_track

track to stratify average methylation by. default is CG content

strat_breaks

breaks to determine the bins of strat_track

intervals

genomic scope for which the function is applied

iterator

track expression iterator (of both tracks and strat_track)

min_cov

minimal coverage of each track

min_cgs

minimal number of CpGs per bin

names

alternative names for the track

groups

a vector the same length of tracks with group for each track. Each group will on a different facet.

group_name

name of the grouping variable (e.g. tumor, sample, patient, experiment)

include.lowest

if 'TRUE', the lowest value of the range determined by breaks is included

ncol

number of columns

nrow

number of rows

width

plot width (if fig_fn is not NULL)

height

plot height (if fig_fn is not NULL)

fig_fn

output filename for the figure (if NULL, figure would be returned)

xlab

label for the x axis

ylim

ylim of the plot

title

title for the plot

legend

add legend

colors

custom colors

parallel

get trends parallely

Value

list with trend data frame (under 'trend') and the plot (under 'p')


tanaylab/gpatterns documentation built on May 15, 2023, 6:23 p.m.