Description Usage Arguments Value Note Author(s) Examples
View source: R/viRome_functions.R View source: R/stacked.barplot.R
The function produces a barplot for each read length showing the number of mapped reads of that read length at each position of the reference genome. One barplot will be plotted for each read length. The current graphical device will be used, and the function split.screen
is used to produce the graphic
1 |
dm |
The output of |
minlen |
The minimum length of aligned read to consider |
maxlen |
The maximum length of aligned read to consider |
start |
The minimum start position to consider |
end |
The maximum start position to consider |
internal.margins |
The margins for each plot. See |
skip.x |
Only plot an x-axis every skip.x plots |
bicol |
Set this equal to a vector of two colours e.g. bicol=c("red","blue") and alterate graphs will take on the alternate colours. Unless this is NULL (the default), col.fun is ignored. |
col.fun |
A colour function to produce colours for the barplots. Defaults to |
axis.col |
A colour for the x-axis |
main.col |
A colour for the title of each plot (which will be the read length) |
main.adj |
Whether to plot the title left-justified (main.adj=0), centre-justified (main.adj=0.5) or right-justified (main.adj=1) |
samey |
Whether or not all barplots should have the same y-axis. If set to TRUE, all barplots will have ylim=c(min(dm),max(dm)). If set to FALSE, each barplot will have its y-axis set individually |
... |
Further graphical paramters to be passed to the plot() function |
A plot is drawn on the current graphical device
When one draws multiple plots stacked one on top of another, one rapidly runs out of space vertically. Warnings are issued to this effect. If you run out of space, or receive errors to that effect, please use a plotting device such as png
, jpeg
, or pdf
, and be sure to provide enough height to the device
Mick Watson <mick.watson@roslin.ed.ac.uk>
1 2 3 4 5 6 7 8 9 10 11 | ## Not run: infile <- system.file("data/SRR389184_vs_SINV_sorted.bam", package="viRome")
## Not run: bam <- read.bam(bamfile=infile, chr="SINV", start=1, end=11703, removeN=TRUE)
## Not run: bamc <- clip.bam(bam)
## Not run: dm <- summarise.by.length(bamc)
## Not run: stacked.barplot(dm)
## Not run: stacked.barplot(dm, internal.margins=c(0,2,0,1))
## Not run: stacked.barplot(dm, internal.margins=c(0,2,0,1), skip.x=4, main.adj=0.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.