Last data update: 2014.03.03

R: plots data stored in bed file format
plotBedgraphR Documentation

plots data stored in bed file format

Description

plots data stored in bed file format

Usage

plotBedgraph(signal, chrom, chromstart, chromend, range = NULL,
  color = SushiColors(2)(2)[1], lwd = 1, linecolor = NA,
  addscale = FALSE, overlay = FALSE, rescaleoverlay = FALSE,
  transparency = 1, flip = FALSE, xaxt = "none", yaxt = "none",
  xlab = "", ylab = "", xaxs = "i", yaxs = "i", bty = "n",
  ymax = 1.04, colorbycol = NULL, ...)

Arguments

signal

signal track data to be plotted (in bedgraph format)

chrom

chromosome of region to be plotted

chromstart

start position

chromend

end position

range

y-range to plpt ( c(min,max) )

color

color of signal track

lwd

color of line outlining signal track. (only valid if linecol is not NA)

linecolor

color of line outlining signal track. use NA for no outline

addscale

TRUE/FALSE whether to add a y-axis

overlay

TRUE / FALSE whether this data should be plotted on top of an existing plot

rescaleoverlay

TRUE/FALSE whether the new plot shold be rescaled based on the maximum value to match the existing plot (only valid when overlay is set to 'TRUE')

transparency

Value between 0 and 1 indication the degree of transparency of the plot

flip

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

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 plottype

bty

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

ymax

fraction of max y value to set as height of plot.

colorbycol

palette to use to shade the signal track plot. Only applicable when overlay is set to FALSE.

...

values to be passed to plot

Examples

data(Sushi_ChIPSeq_CTCF.bedgraph)
data(Sushi_DNaseI.bedgraph)

chrom            = "chr11"
chromstart       = 1955000
chromend         = 1965000

plotBedgraph(Sushi_ChIPSeq_CTCF.bedgraph,chrom,chromstart,chromend,transparency=.50,flip=FALSE,color="blue",linecol="blue")
plotBedgraph(Sushi_DNaseI.bedgraph,chrom,chromstart,chromend,transparency=.50,flip=FALSE,color="#E5001B",linecol="#E5001B",overlay=TRUE,rescaleoverlay=TRUE)
labelgenome(chrom,chromstart,chromend,side=1,scipen=20,n=3,line=.18,chromline=.5,scaleline=0.5,scale="Mb")

transparency = 0.5
col1 = col2rgb("blue")
finalcolor1 = rgb(col1[1],col1[2],col1[3],alpha=transparency * 255,maxColorValue = 255)
col2 = col2rgb("#E5001B")
finalcolor2 = rgb(col2[1],col2[2],col2[3],alpha=transparency * 255,maxColorValue = 255)

legend("topright",inset=0.025,legend=c("DnaseI","ChIP-seq (CTCF)"),fill=c(finalcolor1,finalcolor2),border=c("blue","#E5001B"),text.font=2,cex=0.75)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(Sushi)
Loading required package: zoo

Attaching package: 'zoo'

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

    as.Date, as.Date.numeric

Loading required package: biomaRt
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/Sushi/plotBedgraph.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plotBedgraph
> ### Title: plots data stored in bed file format
> ### Aliases: plotBedgraph
> 
> ### ** Examples
> 
> data(Sushi_ChIPSeq_CTCF.bedgraph)
> data(Sushi_DNaseI.bedgraph)
> 
> chrom            = "chr11"
> chromstart       = 1955000
> chromend         = 1965000
> 
> plotBedgraph(Sushi_ChIPSeq_CTCF.bedgraph,chrom,chromstart,chromend,transparency=.50,flip=FALSE,color="blue",linecol="blue")
> plotBedgraph(Sushi_DNaseI.bedgraph,chrom,chromstart,chromend,transparency=.50,flip=FALSE,color="#E5001B",linecol="#E5001B",overlay=TRUE,rescaleoverlay=TRUE)
> labelgenome(chrom,chromstart,chromend,side=1,scipen=20,n=3,line=.18,chromline=.5,scaleline=0.5,scale="Mb")
> 
> transparency = 0.5
> col1 = col2rgb("blue")
> finalcolor1 = rgb(col1[1],col1[2],col1[3],alpha=transparency * 255,maxColorValue = 255)
> col2 = col2rgb("#E5001B")
> finalcolor2 = rgb(col2[1],col2[2],col2[3],alpha=transparency * 255,maxColorValue = 255)
> 
> legend("topright",inset=0.025,legend=c("DnaseI","ChIP-seq (CTCF)"),fill=c(finalcolor1,finalcolor2),border=c("blue","#E5001B"),text.font=2,cex=0.75)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>