frame_psite | R Documentation |
This function computes, for each transcript region (5' UTR, coding sequence and 3' UTR), the percentage of P-sites falling in the three possible translation reading frames. It takes into account only transcripts with annotated regions of length > 0 and the resulting values are visualized as bar plots. Multiple samples and replicates can be handled.
frame_psite(
data,
annotation,
sample,
multisamples = "average",
plot_style = "split",
transcripts = NULL,
region = "all",
length_range = NULL,
cl = 100,
colour = NULL
)
data |
Either list of data tables or GRangesList object from
|
annotation |
Data table as generated by |
sample |
Either character string, character string vector or named list
of character string(s)/character string vector(s) specifying the name of
the sample(s) and replicate(s) of interest. If a list is provided, each
element of the list is considered as an independent sample associated with
one ore multiple replicates. Multiple samples and replicates are handled
and visualised according to |
multisamples |
Either "average" or "independent". It specifies how to
handle multiple samples and replicates stored in
|
plot_style |
Either "split", "facet", "dodge" or "mirror". It specifies how to organize and display multiple bar plots:
|
transcripts |
Character string vector listing the name of transcripts to be included in the analysis. Default is NULL, i.e. all transcripts are used. |
region |
Character string specifying the region(s) of the transcripts to be analysed. It can be either "5utr", "cds", "3utr", respectively for 5' UTRs, CDSs and 3' UTRs, or "all", i.e. all regions are considered. Note: according to this parameter the bar plots are differently arranged to optimise the organization and the visualization of the data. |
length_range |
Integer or integer vector for restricting the analysis to a chosen range of read lengths. Default is NULL, i.e. all read lengths are used. |
cl |
Integer value in 1,100 specifying a confidence level for restricting the analysis to an automatically-defined range of read lengths. The new range is computed according to the most frequent read lengths, which accounts for the cl% of the sample and is defined by discarding the (100-cl)% of read lengths falling in the tails of the read lengths distribution. If multiple sample names are provided, one range of read lengths is computed, such that at least the cl% of all samples is represented. Default is 100. |
colour |
Character string or character string vector specifying the
colour of the bar plot(s). If |
List containing: one or more ggplot object(s) and the data table with the corresponding x- and y-axis values ("plot_dt"); an additional data table with raw and scaled number of P-sites per frame for each sample ("count_dt").
frame_psite_length
for a similar plot stratified by
read length.
## data(reads_list)
## data(mm81cdna)
##
## ## Generate fake samples and replicates
## for(i in 2:6){
## samp_name <- paste0("Samp", i)
## set.seed(i)
## reads_list[[samp_name]] <- reads_list[["Samp1"]][sample(.N, 5000)]
## }
##
## ## Compute and add p-site details
## psite_offset <- psite(reads_list, flanking = 6, extremity = "auto")
## reads_psite_list <- psite_info(reads_list, psite_offset)
##
## ## Define the list of samples and replicate to use as input
## input_samples <- list("S1" = c("Samp1", "Samp2"),
## "S2" = c("Samp3", "Samp4", "Samp5"),
## "S3" = c("Samp6"))
##
## Generate bar plots
## example_frames <- frame_psite(reads_psite_list, mm81cdna,
## sample = input_samples,
## multisamples = "average",
## plot_style = "facet",
## region = "all",
## colour = c("#333f50", "#39827c", "gray70"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.