-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathfeature_plot.Rd
More file actions
58 lines (51 loc) · 1.9 KB
/
Copy pathfeature_plot.Rd
File metadata and controls
58 lines (51 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/visualization-QC.R
\name{feature_plot}
\alias{feature_plot}
\alias{feature_plot,ribotrans-method}
\title{Plot Read Distribution Across RNA Features}
\usage{
feature_plot(object, ...)
\S4method{feature_plot}{ribotrans}(
object,
merge_rep = FALSE,
facet = ggplot2::facet_wrap(~sample, scales = "free_y"),
return_data = FALSE
)
}
\arguments{
\item{object}{A \code{ribotrans} object that contains summary read information.}
\item{...}{Additional arguments (currently unused).}
\item{merge_rep}{Logical. Whether to merge replicate samples by \code{sample_group}. Default is \code{FALSE}.}
\item{facet}{A ggplot2 faceting specification, e.g.
\code{ggplot2::facet_wrap(~sample, scales = "free")}.
Default is \code{ggplot2::facet_wrap(~sample, scales = "free")}.}
\item{return_data}{A logical value indicating whether to return the processed
summary data instead of the plot. Default is \code{FALSE} (returns a \code{ggplot} object).}
}
\value{
If \code{return_data = FALSE}, a \code{ggplot2} object visualizing the \strong{read counts}
in different regions (\emph{5' UTR, CDS, 3' UTR}) is returned.
If \code{return_data = TRUE}, a \code{data.frame} summarizing the read counts by region
and sample is returned.
}
\description{
This function generates a bar plot showing the distribution of ribosome profiling reads
across different RNA features (5' UTR, CDS, 3' UTR).
}
\details{
\itemize{
\item Reads are assigned to \strong{5' UTR, CDS, or 3' UTR} based on the midpoint of the read position.
\item The function uses \code{dplyr} and \code{fastplyr} for efficient data manipulation.
\item The resulting bar plot groups reads by \code{sample} and scales axes using a log-10 transformation.
}
}
\examples{
\dontrun{
# Example: Generate a feature plot
feature_plot(obj)
# Example: Retrieve summarized data
res <- feature_plot(obj, return_data = TRUE)
head(res)
}
}