plotBedpe: plots data stored in bed file format

Description Usage Arguments Examples

View source: R/plotBedpe.R

Description

plots data stored in bed file format

Usage

1
2
3
4
5
plotBedpe(bedpedata, chrom, chromstart, chromend, heights, color = "black",
  colorby = NULL, colorbycol = NULL, colorbyrange = NULL, border = NULL,
  lwdby = NULL, lwdrange = c(1, 5), offset = 0, flip = FALSE, lwd = 1,
  xaxt = "n", yaxt = "n", bty = "n", plottype = "loops",
  maxrows = 10000, height = 0.3, ymax = 1.04, ...)

Arguments

bedpedata

bed paired end data to be plotted

chrom

chromosome of region to be plotted

chromstart

start position

chromend

end position

heights

single value or vector specifying the height of the arches to be plotted (only valid when plottype is set to "loops" )

color

single value or vector specifying colors of bedpe elements

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.

lwdby

vector to scale line widths by

lwdrange

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

offset

offset of bedpe elements from the x-axis

flip

TRUE/FALSE whether the plot should be flipped over the x-axis

lwd

linewidth for bedpe elements (only valid when colorby is not NULL)

xaxt

A character which specifies the x axis type. See par

yaxt

A character which specifies the y axis type. See par

bty

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

plottype

type of plot (acceptable values are 'loops', 'ribbons', or 'lines')

maxrows

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

height

the height of the boxes at either end of a bedpe element if plottype is set to 'lines'. Typical vaues range form 0 to 1. (only valid when plottype is set to 'lines')

ymax

fraction of max y value to set as height of plot. Only applies when plottype is set to 'loops' or 'ribbons'

...

values to be passed to plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(Sushi_5C.bedpe)

chrom            = "chr11"
chromstart       = 1650000
chromend         = 2350000
pbpe = plotBedpe(Sushi_5C.bedpe,chrom,chromstart,chromend,heights = Sushi_5C.bedpe$score,offset=0,flip=FALSE,bty='n',
lwd=1,plottype="ribbons",colorby=Sushi_5C.bedpe$samplenumber,colorbycol=topo.colors,border="black")
labelgenome(chrom, chromstart,chromend,side=1,scipen=20,n=3,scale="Mb",line=.18,chromline=.5,scaleline=0.5)
legend("topright",inset =0.01,legend=c("K562","HeLa","GM12878"),col=c(topo.colors(3)),pch=19,bty='n',text.font=2)
axis(side=2,las=2,tcl=.2)
mtext("Z-score",side=2,line=1.75,cex=.75,font=2)

PhanstielLab/Sushi documentation built on Dec. 18, 2021, 7:40 a.m.