View source: R/plot_read_counts.R
plot_read_counts | R Documentation |
Output plots of read counts by library, at coarse and fine scales. Libraries areordered by the total
number of reads. These plots can optionally be output to pdfs by specifing file_prefix
. The first
plot shows all libraries, with a line at threshold_line
million reads. The second plot zooms in
on the n_lowcount
libraries with the lowest counts.
plot_read_counts(
metrics,
file_prefix = NULL,
plotdims = c(9, 6),
threshold_line = 5,
n_lowcount = 20,
color_by_var = NULL,
color_by_var_levels = NULL,
color_var_lab = NULL,
my_cols = c("red", "blue"),
na_col = "grey50",
id_col = "lib.id",
total_reads_col = "fastq_total_reads"
)
metrics |
matrix or data frame containing values of metrics. Should have metrics in columns and libraries in rows. |
file_prefix |
a character string. If provided, the function outputs pdfs of the plots, named "file_prefix_plot_name.pdf". If not provided, the function prints to a plotting window. |
plotdims |
a numeric vector, the size (in inches) of the plotting object. Either the size of the pdfs, or the size of the plotting windows. |
threshold_line |
numeric, the values (in millions of reads) at which to plot a horizontal line. |
n_lowcount |
numeric, the number of libraries to include in the plot of low-count libraries |
color_by_var |
(optional) character string or integer identifying the column in |
color_by_var_levels |
(optional) character vector defining the order of elements in the variable used for coloring bars; this order is used for the plot legend and to match the order of colors (if provided). If not provided, levels are taken from the factor levels (if color_by_var is a factor), or else are ordered by order of appearance in |
color_var_lab |
(optional) string to be used as the title for the color legend. |
my_cols |
(optional) vector of colors to use for plotting. If color_by_var is not numeric, should be a vector with one color for each level of |
na_col |
color to use for NA values of |
id_col |
numeric or character, the number or name of the column containing the library identifiers. Used to plot identifiers of low-count libraries. Defaults to "lib.id". |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.