Learn R Programming

genomation (version 1.4.2)

plotMeta: Line plot(s) for meta-region profiles

Description

Function calculates meta-profile(s) from a ScoreMatrix or a ScoreMatrixList, then produces a line plot or a set of line plots for meta-region profiles

Usage

plotMeta(mat, centralTend = "mean", overlay = TRUE, winsorize = c(0, 100),
  profile.names = NULL, xcoords = NULL, meta.rescale = FALSE,
  smoothfun = NULL, line.col = NULL, dispersion = NULL,
  dispersion.col = NULL, ylim = NULL, ylab = "average score",
  xlab = "bases", ...)

Arguments

mat
ScoreMatrix or ScoreMatrixList object. If it is a ScoreMatrixList object, all matrices in the ScoreMatrixList should have the same number of columns.
centralTend
a character that determines central tendency of meta-profile(s). It takes "mean" (default) or "median".
overlay
If TRUE multiple profiles will be overlayed in the same plot (Default:TRUE). If FALSE, and mat is a ScoreMatrixList, consider using par(mfrow=c(1,length(mat))) to see the plots from all matrices at once.
winsorize
Numeric vector of two, defaults to c(0,100). This vector determines the upper and lower percentile values to limit the extreme values. For example, c(0,99) will limit the values to only 99th percentile, everything above the 99 percentile will be equalized to the value of 99th percentile.This is useful for visualization of matrices that have outliers.
profile.names
a character vector for names of the profiles. The order should be same as the as the order of ScoreMatrixList.
xcoords
a numeric vector which designates relative base positions of the meta-region profiles. For example, for a 2001 column ScoreMatrix, xcoord=-1000:1000 indicates relative positions of each column in the score matrix. If NULL (Default), xcoords equals to 1:ncol(mat)
meta.rescale
if TRUE meta-region profiles are scaled to 0 to 1 range by subtracting the min from profiles and dividing them by max-min. If dispersion is not NULL, then dispersion will be scaled as well.
smoothfun
a function to smooth central tendency and dispersion bands (Default: NULL), e.g. stats::lowess.
line.col
color of lines for centralTend of meta-region profiles. Defaults to colors from rainbow() function.
dispersion
shows dispersion interval bands around centralTend (default:NULL). It takes one of the character:
  • "se"
{shows standard error of the mean and 95 percent confidence interval for the mean} "sd"{shows standard deviation and 2*(standard deviation)} "IQR"{shows 1st and 3rd quartile and confidence interval around the median based on the median +/- 1.57 * IQR/sqrt(n) (notches)}

Value

  • returns the meta-region profiles invisibly as a matrix.

item

  • dispersion.col
  • ylim
  • ylab
  • xlab
  • ...

code

plot

Examples

Run this code
data(cage)
 data(promoters)
 scores1=ScoreMatrix(target=cage,windows=promoters,strand.aware=TRUE)

 data(cpgi)
 scores2=ScoreMatrix(target=cpgi,windows=promoters,strand.aware=TRUE)

 # create a new ScoreMatrixList
 x=new("ScoreMatrixList",list(scores1,scores2))
 plotMeta(mat=x,overlay=TRUE,main="my plotowski")

 # plot dispersion nd smooth central tendency and variation interval bands
 plotMeta(mat=x, centralTend="mean", dispersion="se", winsorize=c(0,99),
         main="Dispersion as interquartile band", lwd=4,
         smoothfun=function(x) stats::lowess(x, f = 1/5))

Run the code above in your browser using DataLab