plotBed: plots data stored in bed file format

Description Usage Arguments Examples

View source: R/plotBed.R

Description

plots data stored in bed file format

Usage

1
2
3
4
5
6
7
8
plotBed(beddata, chrom, chromstart, chromend, type = "region",
  colorby = NULL, colorbycol = NULL, colorbyrange = NULL,
  rownumber = NULL, row = "auto", height = 0.4, plotbg = "white",
  wiggle = 0.02, splitstrand = FALSE, numbins = 200, binsmoothing = 10,
  palettes = topo.colors, rowlabels = NULL, rowlabelcol = "dodgerblue2",
  rowlabelfont = 2, rowlabelcex = 1, maxrows = 1e+06,
  color = "dodgerblue4", xaxt = "none", yaxt = "none", xlab = "",
  ylab = "", xaxs = "i", yaxs = "i", bty = "n", border = NA, ...)

Arguments

beddata

genomic data to be plotted (in bed format)

chrom

chromosome of region to be plotted

chromstart

start position

chromend

end position

type

type of plot ('region','circles','density')

colorby

vector to scale colors by

colorbycol

palette to apply color scale to (only valid when colorby is not NULL)

colorbyrange

the range of values to apply the color scale to. Values outside that range will be set to the limits of the range.

rownumber

vector giving the row numbers of each bed element to be plotted.

row

How row number should be determined. Appropriate values are 'auto' or 'supplied'

height

Value, typically between 0 and 1, that sets the height of each bed element

plotbg

The background color of the plot

wiggle

the fraction of the plot to leave blank on either side of each element to avoid overcrowding.

splitstrand

TRUE/FALSE indicating whether reverse strnad bed elements shold be plotted below the x axis. (only valid when row is set to 'auto')

numbins

The number of bins to divide the region into when type is set to density (only valid when type is set to 'density')

binsmoothing

umber of bins to sum together when type is set to density (only valid when type is set to 'density')

palettes

list of color palettes used for density plots. Each row can have a unique palette. number of palettes is less than the number of rows then only the first palette is used (only valid when type is set to 'density')

rowlabels

labels for the y-axis

rowlabelcol

color of the y-axis labels

rowlabelfont

font of the y-axis labels

rowlabelcex

font size of the y-axis labels

maxrows

The maximum number of rows to plot on the y-axis

color

single color or vector of colors to use to plot the points or regions (not valid when type is set to 'density')

xaxt

A character which specifies the x axis type. See par

yaxt

A character which specifies the y axis type. See par

xlab

Label for the x-axis

ylab

Label for the y-axis

xaxs

Must be set to 'i' for appropriate integration into Sushi plots. See par

yaxs

Must be set to 'i' for appropriate integration into Sushi plots. See par

bty

A character string which determined the type of box which is drawn about plots. See par

border

border color drawn around each bed element or density bin. Set to 'n' for none.

...

values to be passed to other functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
data(Sushi_ChIPSeq_severalfactors.bed)
chrom            = "chr15"
chromstart      = 72800000
chromend         = 73100000
Sushi_ChIPSeq_severalfactors.bed$color = heat.colors(max(Sushi_ChIPSeq_severalfactors.bed$row))[Sushi_ChIPSeq_severalfactors.bed$row]
plotBed(beddata    = Sushi_ChIPSeq_severalfactors.bed,chrom = chrom,chromstart = chromstart,chromend =chromend,
        rownumber  = Sushi_ChIPSeq_severalfactors.bed$row, type = "circles",color=Sushi_ChIPSeq_severalfactors.bed$color,row="given",plotbg="grey95",
        rowlabels=unique(Sushi_ChIPSeq_severalfactors.bed$name),rowlabelcol=unique(Sushi_ChIPSeq_severalfactors.bed$color),rowlabelcex=0.75)

Sushi_ChIPSeq_severalfactors.bed$color = heat.colors(max(Sushi_ChIPSeq_severalfactors.bed$row))[Sushi_ChIPSeq_severalfactors.bed$row]

plotBed(beddata    = Sushi_ChIPSeq_severalfactors.bed,chrom = chrom,chromstart = chromstart,chromend =chromend,
        rownumber  = Sushi_ChIPSeq_severalfactors.bed$row, type = "region",color=Sushi_ChIPSeq_severalfactors.bed$color,row="given",plotbg="grey95",
        rowlabels=unique(Sushi_ChIPSeq_severalfactors.bed$name),rowlabelcol=unique(Sushi_ChIPSeq_severalfactors.bed$color),rowlabelcex=0.75)

colors = c("dodgerblue1","firebrick2","violet","yellow",
        "dodgerblue1","firebrick2","violet","yellow",
        "dodgerblue1","firebrick2","violet")
plotBed(beddata    = Sushi_ChIPSeq_severalfactors.bed,chrom = chrom,chromstart = chromstart,chromend =chromend,
         rownumber  = Sushi_ChIPSeq_severalfactors.bed$row, type = "density",row="supplied",
         rowlabels=unique(Sushi_ChIPSeq_severalfactors.bed$name),rowlabelcol=colors,rowlabelcex=0.75,
         palettes=list(
         colorRampPalette(c("black",colors[1])),
         colorRampPalette(c("black",colors[2])),
         colorRampPalette(c("black",colors[3])),
         colorRampPalette(c("black",colors[4])),
         colorRampPalette(c("black",colors[5])),
         colorRampPalette(c("black",colors[6])),
         colorRampPalette(c("black",colors[7])),
         colorRampPalette(c("black",colors[8])),
         colorRampPalette(c("black",colors[9])),
         colorRampPalette(c("black",colors[10])),
         colorRampPalette(c("black",colors[11]))))

Example output

Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

Loading required package: biomaRt

Sushi documentation built on April 29, 2020, 5:21 a.m.