Description Usage Arguments Value Examples
Plots the results of the calculations from calculatePosteriors
for a single gene. Allows for the selection of custom plotting bounds as
well as the recalculation of the posterior distribution within those bounds.
Recalculation of the posterior is useful for obtaining better resolution for
plots that are significantly 'zoomed in' compared to the original posterior calculation. This also allows you to avoid having to call calculatePosteriors
if you are only interested in looking at one gene at a time.
Note: calculatePosteriors
must be run before calling this method unless recalculate = T
in which case it does not need to be run.
1 2 | plotPosteriors(object, geneIdx, alphaRange=NULL,
betaRange=NULL, relative=T, recalculate=F, ...)
|
object |
A basicKineticModel object |
geneIdx |
The gene for which to plot the posterior distribution |
... |
Additional arguments needed for recalculating the posterior distribution. Only used if |
alphaRange |
Determines the range of alpha values to plot over. Must be specified as |
betaRange |
Determines the range of beta values to plot over. Must be specified as |
relative |
Boolean used to determine whether parameter ranges are specified as relative or absolute. If |
recalculate |
Boolean used to determine if the posterior distribution should be recalculated for the selected gene and parameter boundaries. |
A ggplot2 plot
object containing the posterior plot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ##setup
bkm=basicKineticModel(times=0:30,synthRate=1:10,degRate = rep(0.5,10))
bkm=simulateData(bkm)
bkm=simulateReads(bkm,expectedLibSize=10^6,replicates=3,spikeInSizes = 200,dispersionModel=function(x){rep(10^3,length(x))}) #CLUGE
bkm=inferParameters(bkm)
bkm=calculatePosteriors(bkm,alphaRange=c(.25,2))
##plot entire distribution
plotPosteriors(bkm,geneIdx=3)
##plot absolute subset of distribution
plotPosteriors(object=bkm,geneIdx=3,alphaRange=c(3000,4500),betaRange=c(.45,.55),relative=F)
##plot relative subset of distribution
plotPosteriors(object=bkm,geneIdx=3,alphaRange=c(.9,1.1))
##plot subset and recalculate posterior distribution (to obtain higher resolution)
#note: calculatePosteriors does NOT need to be run prior to plotting if recalculate=T
plotPosteriors(object=bkm,geneIdx=3,alphaRange=c(3000,4500),betaRange=c(.45,.55),relative=F,recalculate=T,paramSpaceSize=10^5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.