View source: R/bioinfo_sequences.R
barplotReadCounts | R Documentation |
Make a stacked barplot, for instance from the output of formatReadCountsPerLane
. Default graphical parameters are optimized for few categories (e.g. lanes) but many individuals.
barplotReadCounts(
counts,
xlab = paste0("Individuals (", ncol(counts), ")"),
ylab = "Number of read pairs",
main = "Read pairs per individual",
legend.text = rownames(counts),
col = 1:nrow(counts),
lines.h = c(10^5, 10^6, 5 * 10^6),
mar = c(5, 4.5, 4, 0),
xlab.line = 3,
font.lab = 2,
cex.xtxt = 0.7,
perc = FALSE,
inset.x = -0.2
)
counts |
matrix, with categories (e.g. lanes) in rows and individuals in columns; if colnames is not NULL, they will be used as labels of the x-axis |
xlab |
a title for the x axis |
ylab |
a title for the y axis |
main |
an overall title for the plot |
legend.text |
see |
col |
see |
lines.h |
the y-value(s) for horizontal line(s) |
mar |
see |
xlab.line |
see |
font.lab |
see |
cex.xtxt |
see |
perc |
if TRUE, plot data from "counts" as percentages (using |
inset.x |
inset distance along the x axis from the margins as a fraction of the plot region |
invisible output of barplot
Timothee Flutre
## Not run: ## make fake data
(x <- matrix(data=c(10,3, 20,0, 21,17, 35,19), nrow=2, ncol=4,
dimnames=list(c("lane1", "lane2"),
c("ind1", "ind2", "ind3", "ind4"))))
## plot them
barplotReadCounts(counts=x)
barplotReadCounts(counts=x, perc=TRUE, ylab="Percentage of read pairs",
mar=c(5, 4.5, 4, 6))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.