An object of type chromLocation for the species being
represented.
xlim
A pair of values - either character or integer, which will
denote the range of genes to display (based on base pair: either directly
in the case of integers, or using the locations of the named genes if
character). If not supplied, the entire chromosome is used.
whichGenes
If supplied, will limit the displayed genes to the ones
provided in this vector.
xloc
Determines whether the X axis points (gene names) will be
displayed according to their relative position on the chromosome
(physical), or spaced evenly (equispaced). Default is equispaced.
plotFormat
Determines the method which to plot the data.
scale
Determines what method of scaling will be applied to the
data. Default is none.
geneSymbols
Notes whether to use Affy IDs or Gene Symbols,
default is Affy IDs
byStrand
Determines whether to show the entire plot at once, or
a split plot by strands. Default is a singular plot
lty
A vector of line types, which will be cycled.
type
Plot type, from par. Defaults to "S".
colors
A vector of colors for the plots, which will be cycled.
...
Any remaining graphics commands may be passed along as per plot()
Details
The genes on the chromosome of interest are extracted from the
chromLocation object passed in, which are then intersected with the
genes listed in the ExpressionSet. These remaining genes will then be
plotted according to the plotFormat argument. If image is
specified, an image plot is created showing the expression levels of
the samples by gene, using a colour map to denote the levels. If
cumulative is chosen, the cumulative expression level is plotted
against the genes for each sample. Likewise, if local is used, the
raw data is plotted for each sample against the genes using a boxplot format.
Not all parameters are honored for all plotformats. xloc,
lty, and type are only used with the cumulative
plotformat.
Author(s)
Jeff Gentry
Examples
data(sample.ExpressionSet)
## A bit of a hack to not have a package dependency on hgu95av2
## but need to fiddle w/ the warn level to not fail the example anyways.
curWarn <- options(warn=0)
on.exit(options(curWarn), add=TRUE)
if (require("hgu95av2.db")) {
z <- buildChromLocation("hgu95av2")
lty <- c(1, 2, 3, 4, 5)
cols <- c("red", "green", "blue", "orange", "magenta", "black")
cols <- cols[sample.ExpressionSet$type]
if (interactive()) {
par(ask=TRUE)
}
## Here we're using xlim to denote a physical region to display
xlim <- c(87511280,127717880)
for (xl in c("equispaced", "physical"))
for (sc in c("none","rangescale"))
{
alongChrom(sample.ExpressionSet, "1", z, xlim=xlim, xloc=xl,
plotFormat="cumulative", scale=sc,lty=lty, colors=cols)
}
## Here we're looking for specific genes
which <- c("31540_at","31583_at", "31508_at", "31529_at", "31439_f_at",
"31729_at")
## Gene "31529_at" does not exist in the current set of genes,
## here it demonstrates how genes not available are dropped.
for (xl in c("equispaced", "physical"))
for (sc in c("none","rangescale"))
{
alongChrom(sample.ExpressionSet, "1", z, which=which, xloc=xl,
plotFormat="cumulative", scale=sc,lty=lty, col=cols)
}
## Do an image plot
for (bs in c(TRUE,FALSE))
alongChrom(sample.ExpressionSet, "1",z, xlim=xlim, plotFormat="image",
scale="zscale", byStrand=bs)
## A boxplot
for (st in c(TRUE,FALSE))
alongChrom(sample.ExpressionSet, "1", z, plotFormat="local",
colors=cols, byStrand=st)
} else print("Example can not be run without the hgu95av2 data package")
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(geneplotter)
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: lattice
Loading required package: annotate
Loading required package: AnnotationDbi
Loading required package: stats4
Loading required package: IRanges
Loading required package: S4Vectors
Attaching package: 'S4Vectors'
The following objects are masked from 'package:base':
colMeans, colSums, expand.grid, rowMeans, rowSums
Loading required package: XML
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/geneplotter/alongChrom.Rd_%03d_medium.png", width=480, height=480)
> ### Name: alongChrom
> ### Title: A function for plotting expression data from an ExpressionSet
> ### for a given chromosome.
> ### Aliases: alongChrom buildACMainLabel doACImagePlot fixACPhysPoints
> ### getACGeneSyms limitACXRange cullACXPoints doACLocalPlot
> ### getACClosestPos getACPlotLabs scaleACData dispACXaxis doACMatPlot
> ### getACDataEnv getACStrandVals doACCumPlot emptyACPlot getACExprs
> ### highlightACDups
> ### Keywords: utilities
>
> ### ** Examples
>
> data(sample.ExpressionSet)
> ## A bit of a hack to not have a package dependency on hgu95av2
> ## but need to fiddle w/ the warn level to not fail the example anyways.
> curWarn <- options(warn=0)
> on.exit(options(curWarn), add=TRUE)
> if (require("hgu95av2.db")) {
+ z <- buildChromLocation("hgu95av2")
+ lty <- c(1, 2, 3, 4, 5)
+ cols <- c("red", "green", "blue", "orange", "magenta", "black")
+ cols <- cols[sample.ExpressionSet$type]
+ # if (interactive()) {
+ par(ask=TRUE)
+ # }
+
+ ## Here we're using xlim to denote a physical region to display
+ xlim <- c(87511280,127717880)
+ for (xl in c("equispaced", "physical"))
+ for (sc in c("none","rangescale"))
+ {
+ alongChrom(sample.ExpressionSet, "1", z, xlim=xlim, xloc=xl,
+ plotFormat="cumulative", scale=sc,lty=lty, colors=cols)
+ }
+
+ ## Here we're looking for specific genes
+ which <- c("31540_at","31583_at", "31508_at", "31529_at", "31439_f_at",
+ "31729_at")
+ ## Gene "31529_at" does not exist in the current set of genes,
+ ## here it demonstrates how genes not available are dropped.
+ for (xl in c("equispaced", "physical"))
+ for (sc in c("none","rangescale"))
+ {
+ alongChrom(sample.ExpressionSet, "1", z, which=which, xloc=xl,
+ plotFormat="cumulative", scale=sc,lty=lty, col=cols)
+ }
+
+ ## Do an image plot
+ for (bs in c(TRUE,FALSE))
+ alongChrom(sample.ExpressionSet, "1",z, xlim=xlim, plotFormat="image",
+ scale="zscale", byStrand=bs)
+
+ ## A boxplot
+ for (st in c(TRUE,FALSE))
+ alongChrom(sample.ExpressionSet, "1", z, plotFormat="local",
+ colors=cols, byStrand=st)
+ } else print("Example can not be run without the hgu95av2 data package")
Loading required package: hgu95av2.db
Loading required package: org.Hs.eg.db
[1] "Warning: Not all requested genes are displayed."
[1] "Warning: Not all requested genes are displayed."
[1] "Warning: Not all requested genes are displayed."
[1] "Warning: Not all requested genes are displayed."
>
>
>
>
>
> dev.off()
null device
1
>