get_length_distribution: Retrieves the length distribution of a given region

Description Usage Arguments Details Value See Also Examples

View source: R/region_count_functions.R

Description

The function get_length_distribution retrieves the raw or normalized counts at each read length from 'range.lower' to 'range.upper'.

Usage

1
2
3
4
5
6
7
8
get_length_distribution(
  ribo.object,
  region,
  range.lower = length_min(ribo.object),
  range.upper = length_max(ribo.object),
  compact = TRUE,
  experiment = experiments(ribo.object)
)

Arguments

ribo.object

A 'Ribo' object

region

Specific region of interest

range.lower

Lower bound of the read length, inclusive

range.upper

Upper bound of the read length, inclusive

compact

Option to return a DataFrame with Rle and factor as opposed to a raw data.frame

experiment

List of experiment names

Details

This function is a wrapper function of get_region_counts, and the returned DataFrame is valid input for plot_length_distribution.

Value

An annotated DataFrame or data.frame (if the compact parameter is set to FALSE) of the read-length specific region count information for a single region specified in the 'region' parameter. The returned data frame will have a length column, and it will not contain a transcript column.

See Also

plot_length_distribution to plot the output of this function

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#generate the ribo object
file.path <- system.file("extdata", "sample.ribo", package = "ribor")
sample <- Ribo(file.path)

#specify the experiments of interest
experiments <- c("Hela_1", "Hela_2", "WT_1")

#gets the normalized length distribution from read length 2 to 5
length.dist <- get_length_distribution(ribo.object = sample,
                                       region = "CDS",
                                       range.lower = 2,
                                       range.upper = 5)

ribosomeprofiling/ribor documentation built on May 21, 2021, 8:02 a.m.