expr.plot
, normCounts.plot
, rExpr.plot
, and rawCounts.plot
determine
which plot types are to be generated, and the parameters with.TX
and without.TX
determines whether these plots should include or not include the full transcript information, or if separate plots should
be generated with and without the full transcript information.
Note that this function has MANY parameters, allowing the user to tweak the behavior and appearance of the plots to suit their particular needs and preferences. Don't be daunted: the default parameters are probably fine for most purposes.
buildAllPlotsForGene(geneID, jscs, outfile.prefix = "./", use.plotting.device = c("png","CairoPNG","svg", "tiff","cairo_ps","custom"), sequencing.type = c("paired-end","single-end"), use.vst=FALSE, use.log = TRUE, exon.rescale.factor = 0.3, with.TX=TRUE,without.TX=TRUE, expr.plot=TRUE,normCounts.plot=TRUE, rExpr.plot=TRUE,rawCounts.plot=FALSE, colorRed.FDR.threshold = 0.01, colorList=list(), plot.gene.level.expression = TRUE, plot.exon.results, plot.junction.results, plot.novel.junction.results, plot.untestable.results = FALSE, plot.lwd=3, axes.lwd = plot.lwd, anno.lwd = plot.lwd, gene.lwd = plot.lwd / 2, par.cex = 1, name.files.with.geneID = TRUE, anno.cex.text = 1, anno.cex.axis = anno.cex.text, anno.cex.main = anno.cex.text * 1.2, drawCoordinates = TRUE, yAxisLabels.inExponentialForm = FALSE, show.strand.arrows = 1, graph.margins = c(2, 3, 3, 3), base.plot.height = 12, base.plot.width = 12, base.plot.units = "in", GENE.annotation.relative.height = 0.15, TX.annotation.relative.height = 0.05, CONNECTIONS.relative.height = 0.1, SPLICE.annotation.relative.height = 0.1, TX.margins = c(0,0.5), autoscale.height.to.fit.TX.annotation = TRUE, autoscale.width.to.fit.bins = 35, plotting.device.params = list(), condition.legend.text, include.TX.names = TRUE, draw.start.end.sites = TRUE, draw.nested.SJ = TRUE, openPlottingDeviceFunc = NULL, closePlottingDeviceFunc = NULL, minimalImageFilenames = FALSE, verbose=TRUE, debug.mode = FALSE, INTERNAL.VARS=list(), ...)
JunctionSeqCountSet
. Usually created by runJunctionSeqAnalyses
.
Alternatively, this can be created manually by readJunctionSeqCounts
.
However in this case a number of additional steps will be necessary:
Dispersions and size factors must then be
set, usually using functions estimateSizeFactors
and
estimateJunctionSeqDispersions
. Hypothesis tests must
be performed by testForDiffUsage
. Effect sizes and parameter
estimates must be created via estimateEffectSizes
.
TRUE
, all plots will be scaled via a variance stabilizing transform.TRUE
, all plots will be log-scaled.TRUE
, save expression plots with the full transcripts printedTRUE
, save expression plots with only the compiled exons printed. Note that if this and with.TX.plot are both TRUE, both versions will be saved seperately.TRUE
, save an expression plot of the expression parameter estimates for each splice site, for each condition.TRUE
, save an expression plot of the normalized mean counts for each splice site, for each sample.TRUE
, save an expression plot of the expression parameter estimates, relative to gene-wide expression, for each splice site, for each condition.TRUE
, save an expression plot of the raw counts for each splice site, for each sample. Note that these will never be VST-transformed, even when use.vst == TRUE.plotJunctionSeqResultsForGene
TRUE
, gene-level expression (when applicable) will be plotted beside the sub-element-specific expression in a small seperate plotting box.
For the "relative expression" plots the simple mean normalized expression will be plotted (since it doesn't make sense to plot something relative to itself).
TRUE
, plot results for exons. By default everything that was tested will be plotted.TRUE
, plot results for splice junctions. By default everything that was tested will be plotted.TRUE
, plot results for novel splice junctions. If false, novel splice junctions will be ignored. By default everything that was tested will be plotted.TRUE
, plots splice junctions that had coverage that was too low to be tested.par
.
par
.
par
.
par
.
TRUE
, then the y-axis will be labelled in exponential form.1
(the default) then the arrow will extend from the end of the gene drawing, if it is greater than 1
then arrows will be drawn
along the gene length. If it is 0
or NA
then arrows will not be drawn.
autoscale.width.to.fit.bins
).with.TX
parameter is TRUE
), this sets the height of each transcript, as a fraction of the height of the main graph. By default it is 2.5 percent.
TRUE
, the base.plot.height
will be used
as the height of the plot, regardless of how many transcripts are included.
NA
.
factor(condition)
. Each element
should be named with one of the values from factor(condition)
, and should contain the label. They will be listed in this order in the figure legend.
TRUE
, then for the plots that include the annotated transcript, the transcript names will be listed. The labels will be drawn at half the size of anno.cex.text
.
TRUE
, then transcript start/end sites will be marked on the main gene annotation.
TRUE
, overlapping splice junctions will be drawn layered under one another.
This can vastly improve readability when there are a large number of overlapping splice junctions.
Default is TRUE
.
TRUE
, then the image files will not include the gene names.
By default this is FALSE
, but may be set to TRUE
when this function is called internally by buildAllPlots
using the default
options. This option is sometimes needed so that the image files are compatible
with certain web hosts that have file name length restrictions.
TRUE
, send debugging and progress messages to the console / stdout.plotJunctionSeqResultsForGene
, or graphical parameters passed to plotting functions.data(exampleDataSet,package="JctSeqData");
buildAllPlotsForGene(geneID = "ENSRNOG00000009281", jscs);
## Not run:
# ########################################
# #Set up example data:
# decoder.file <- system.file(
# "extdata/annoFiles/decoder.bySample.txt",
# package="JctSeqData");
# decoder <- read.table(decoder.file,
# header=TRUE,
# stringsAsFactors=FALSE);
# gff.file <- system.file(
# "extdata/cts/withNovel.forJunctionSeq.gff.gz",
# package="JctSeqData");
# countFiles <- system.file(paste0("extdata/cts/",
# decoder$sample.ID,
# "/QC.spliceJunctionAndExonCounts.withNovel.forJunctionSeq.txt.gz"),
# package="JctSeqData");
# ########################################
# #Run example analysis:
# jscs <- runJunctionSeqAnalyses(sample.files = countFiles,
# sample.names = decoder$sample.ID,
# condition=factor(decoder$group.ID),
# flat.gff.file = gff.file,
# analysis.type = "junctionsAndExons"
# );
# ########################################
#
# #Generate several related plots for the selected gene:
# buildAllPlotsForGene(geneID = "ENSRNOG00000009281", jscs);
#
# ## End(Not run)
Run the code above in your browser using DataLab