% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/visualization.R
\name{plot_proportion_barplot}
\alias{plot_proportion_barplot}
\title{Visualize as barplot}
\usage{
plot_proportion_barplot(
  dturtle,
  genes = NULL,
  meta_gene_id = NULL,
  group_colors = NULL,
  fit_line_color = "red",
  text_size = 11,
  label_angle = c(25, 1, 1),
  savepath = NULL,
  filename_ext = "_barplot.png",
  add_to_table = FALSE,
  BPPARAM = BiocParallel::SerialParam(),
  ...
)
}
\arguments{
\item{dturtle}{\code{dturtle} result object of \code{posthoc_and_stager()}.}

\item{genes}{Character vector of genes to plot. If \code{NULL}, defaults to all found significant genes (\code{sig_genes}).}

\item{meta_gene_id}{Optionally specify the column name in \code{meta_table_gene}, which contains real gene identifiers or gene names.}

\item{group_colors}{Optionally specify the colours for the two sample groups in the plot. Must be a named vector, with the group names as names.}

\item{fit_line_color}{Optionally specify the colour to use for the mean fit line.}

\item{text_size}{Specify basic text size (in pt) to use in plot.}

\item{label_angle}{Specify the angle of the x-axis labels, the vjust and hjust value (in that order).}

\item{savepath}{If you want your files to be saved to disk, specify a save path here. The directories will be created if necessary.}

\item{filename_ext}{Optionally specify a file name extension here, which also defines the save image format. The file name will be 'gene_name+extension'.}

\item{add_to_table}{If a \code{savepath} is provided, add the filepaths of the created plots to the corresponding entries in \code{dtu_table}. The name of the column that shall be created can be specified here.}

\item{BPPARAM}{If multicore processing should be used, specify a \code{BiocParallelParam} object here. Among others, can be \code{SerialParam()} (default) for non-multicore processing or \code{MulticoreParam('number_cores')} for multicore processing. See \code{\link[BiocParallel:BiocParallel-package]{BiocParallel}} for more information.}

\item{...}{
  Arguments passed on to \code{\link[ggplot2:ggsave]{ggplot2::ggsave}}
  \describe{
    \item{\code{filename}}{File name to create on disk.}
    \item{\code{plot}}{Plot to save, defaults to last plot displayed.}
    \item{\code{device}}{Device to use. Can either be a device function
(e.g. \code{\link[=png]{png()}}), or one of "eps", "ps", "tex" (pictex),
"pdf", "jpeg", "tiff", "png", "bmp", "svg" or "wmf" (windows only).}
    \item{\code{path}}{Path of the directory to save plot to: \code{path} and \code{filename}
are combined to create the fully qualified file name. Defaults to the
working directory.}
    \item{\code{scale}}{Multiplicative scaling factor.}
    \item{\code{width}}{Plot size in \code{units} ("in", "cm", or "mm").
If not supplied, uses the size of current graphics device.}
    \item{\code{height}}{Plot size in \code{units} ("in", "cm", or "mm").
If not supplied, uses the size of current graphics device.}
    \item{\code{units}}{Plot size in \code{units} ("in", "cm", or "mm").
If not supplied, uses the size of current graphics device.}
    \item{\code{dpi}}{Plot resolution. Also accepts a string input: "retina" (320),
"print" (300), or "screen" (72). Applies only to raster output types.}
    \item{\code{limitsize}}{When \code{TRUE} (the default), \code{ggsave} will not
save images larger than 50x50 inches, to prevent the common error of
specifying dimensions in pixels.}
  }}
}
\value{
Returns list of saved plots, for adding to the DTU table. If no \code{savepath} is provided, returns a list of the created plots for further processing. If \code{add_to_table} is provided, return the altered \code{dturtle} object, if at least one of the plots could be added to the DTU summary table.
}
\description{
Visualize genes and it's transcript proportions in a barplot.
}
\details{
Shows the transcripts proportional change per analysis group, together with the mean fit value via a horizontal line. Significant transcript's names are marked in red.
}
\seealso{
\code{\link[=run_drimseq]{run_drimseq()}} and \code{\link[=posthoc_and_stager]{posthoc_and_stager()}} for DTU object creation. \code{\link[=create_dtu_table]{create_dtu_table()}} and \code{\link[=plot_dtu_table]{plot_dtu_table()}} for table visualization.

Other DTUrtle visualization: 
\code{\link{create_dtu_table}()},
\code{\link{plot_dimensional_reduction}()},
\code{\link{plot_proportion_pheatmap}()},
\code{\link{plot_transcripts_view}()}
}
\concept{DTUrtle visualization}
