You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#' @param object A `ribotrans` object that contains summary read count information.
320
-
#' @param read_length A numeric vector of length 2 (default: `c(20, 35)`). Defines the range of read lengths to visualize.
321
-
#' @param merge_rep Logical. Whether to merge replicate samples by \code{sample_group}. Default is \code{FALSE}.
322
-
#' @param text_size Numeric (default: `4`). Specifies the font size for periodicity labels, applicable when `type = "frame_length"`.
323
-
#' @param add_periodicity_label Logical (default: `TRUE`). If `TRUE`, adds periodicity percentage labels to the plot (only for `type = "frame_length"`).
324
-
#' @param labely_extend A numeric proportion to extend the y-position of periodicity labels above bars
325
-
#' (default: 0.05).
326
-
#' @param return_data Logical (default: `FALSE`). If `TRUE`, returns the processed data frame instead of a plot.
327
-
#' @param type Character string, either `"length"` (default) or `"frame_length"`.
328
-
#' - `"length"`: Displays a bar plot showing the distribution of read lengths.
329
-
#' - `"frame_length"`: Displays a bar plot with frame-periodicity information, highlighting the reading frame (0, 1, 2).
330
333
#'
331
-
#' @return A `ggplot2` object showing the read length distribution or a processed data frame if `return_data = TRUE`.
334
+
#' @return If \code{return_data = FALSE}, a \code{ggplot} object. If
335
+
#' \code{return_data = TRUE}, a data.frame with columns corresponding to
336
+
#' the selected \code{type} and grouping variables.
332
337
#'
333
-
#' @details
334
-
#' - If `type = "length"`, the function summarizes read counts by length.
335
-
#' - If `type = "frame_length"`, the function calculates frame-periodicity and shows the proportion of reads mapped to each frame.
336
-
#' - Frame-periodicity is computed as: ***percentage of reads in frame-0 relative to all frames***.
337
-
#' - Reads outside annotated coding regions (`mstart !=0` or `mstop !=0`) are analyzed for periodicity.
0 commit comments