R: Visualize ChIP intensities along the chromosome
chipAlongChrom1
R Documentation
Visualize ChIP intensities along the chromosome
Description
This function can visualize the array intensities from a ChIP chip
experiment for a chromosomal region or the whole chromosome. It's
loosely based on the plotAlongChrom function from the package
tilingArray, but provides a different visualization.
An expression set containing the (normalized) ChIP
intensities. Can be generated by using the function
asExprSet.
chrom
character; the chromosome to visualize
probeAnno
Environment holding genomic position, index and gene
association of probes on array. See scripts/makeProbeAnno.R
for how to generate such an environment.
xlim
start and end genomic coordinates on the chromosome to
visualize
ylim
minimum and maximum probe intensities for the plot, if
NULL(default) set as range(exprs(eSet))
samples
numeric; which samples from the eSet are to be
shown. Default is to show all samples in the eSet,
paletteName
character; Name of the RColorBrewer palette to use
for sample colors. If the number of samples is greater than the palette
size, random colors are taken.
colPal
vector of colors to use for the sample intensities.
This is alternative to the argument paletteName
for specifying which colors to use.
byStrand
logical; not implemented yet.
ylabel
character; label for the y-axis, passed on to the
plotting function as ylab
rugCol
color to use for marking the probe positions on the
x-axis (genomic coordinate)
itype
character; type of plot type to use for the sample
intensities. Can be "r","u", or any of the type
specifications used in plot.default.
Defaults to "r". Please refer to the details section below.
ipch
plot character to use with itype="p"
icex
character expansion to use for plotting symbol
ilwd
line width of plotted lines if itype="l"
ilty
line type of plotted lines if itype="l"; passed on
to par(lty).
useGFF
use further annotation
gff
Data frame containing annotation for genomic feature to be
used to further annotate the plot.
featCol
color to use for genomic features.
zero.line
logical; should a dashed horizontal line at y=0 be
put into the plot?
putLegend
logical; should a legend be put into the plot?
add
logical; should expression set intensities be plotted onto
current device instead of a new one?
maxInterDistance
numeric; only used when itype is either
"r" or "u"; specifies the maximal distance up to which
adjacent probe positions should be connected by a line.
coord
optional integer of length 2; can be used instead of
xlim to specify the start and end coordinates of the genomic
region to plot
verbose
logical; progress output to STDOUT.
...
further parameters passed on to plot.default, see
details
Details
The following plot.default arguments are already defined by
arguments of this function and thus may not be included in ...:
xlim, ylim, col, pch, cex, lwd, lty, frame.plot
The itype argument specifies the desired type of plot. It can
be any valid specification of the type argument in
plot.default or one of two special types:
"r"
restricted drawing of position-connecting
lines. adjacent probe connections will be connected by a line
only if less or equal to argument maxInterDistance apart
from each other; each probe position will be marked by an
individual point anyway (whose shape is determined by the argument
ipch).
"u"
similar as "r" but the lines and the points will be
unconnected; reminiscent of plot.default's
type "b".
Value
invisible matrix of probe intensities in the selected
genomic regions
Note
Use the function alongChrom from
package geneplotter fo an alternative way to display probe
intensities in genomic regions.
Author(s)
Joern Toedling
See Also
plot.default;
plotAlongChrom in package tilingArray
Examples
# load data
ringoExampleDir <- system.file("exData",package="Ringo")
load(file.path(ringoExampleDir,"exampleProbeAnno.rda"))
load(file.path(ringoExampleDir,"exampleX.rda"))
# show a gene that is well represented on this microarray
chipAlongChrom1(exampleX, chrom="9", xlim=c(34318000,34321000),
ylim=c(-2,4), probeAnno=exProbeAnno, gff=exGFF)
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(Ringo)
Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: 'BiocGenerics'
The following objects are masked from 'package:parallel':
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from 'package:stats':
IQR, mad, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
rbind, rownames, sapply, setdiff, sort, table, tapply, union,
unique, unsplit
Welcome to Bioconductor
Vignettes contain introductory material; view with
'browseVignettes()'. To cite Bioconductor, see
'citation("Biobase")', and for packages 'citation("pkgname")'.
Loading required package: RColorBrewer
Loading required package: limma
Attaching package: 'limma'
The following object is masked from 'package:BiocGenerics':
plotMA
Loading required package: Matrix
Loading required package: grid
Loading required package: lattice
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/Ringo/chipAlongChromOld.Rd_%03d_medium.png", width=480, height=480)
> ### Name: chipAlongChrom1
> ### Title: Visualize ChIP intensities along the chromosome
> ### Aliases: chipAlongChrom1 chipAlongChromOld
> ### Keywords: internal hplot
>
> ### ** Examples
>
> # load data
> ringoExampleDir <- system.file("exData",package="Ringo")
> load(file.path(ringoExampleDir,"exampleProbeAnno.rda"))
> load(file.path(ringoExampleDir,"exampleX.rda"))
>
> # show a gene that is well represented on this microarray
> chipAlongChrom1(exampleX, chrom="9", xlim=c(34318000,34321000),
+ ylim=c(-2,4), probeAnno=exProbeAnno, gff=exGFF)
Getting probe intensities in selected regions..,
Preparing color scheme...
Plotting intensities...
Obtain genomic features...
>
>
>
>
>
> dev.off()
null device
1
>