select_read_lengths: Select Relevant Read Lengths for the Profiling Library

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Filters out reads that are too long or too short for meaningful biological analysis. For example is cycloheximide is used in the experiment read length 27-29 are usually the predominant read lengths and provide the most biologically meaningful data.

Usage

1
select_read_lengths(data, ribo_length = c(27:29))

Arguments

data

list returned by read_profiling_data

ribo_length

integer or vector, read lengths that are selected. defaults to c(27:29)

Details

selects desired read lengths. This is often necessary before further analysis.

Value

returns a list similar to read_profiling_data except the [[ribo]] portion only contains read lengths selected. The [[rna]] portion remains untouched.

Author(s)

Alper Celik

See Also

read_profiling_data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (data, ribo_length = c(27:29))
{
    ribo <- data[["ribo"]]
    rna <- data[["rna"]]
    features <- data[["features"]]
    selector <- function(gene, lengths) {
        gene <- ribo[[gene]]
        gene <- gene[gene$width >= min(lengths) & gene$width <=
            max(lengths), ]
        gene
    }
    ribo_selected <- lapply(names(ribo), selector, lengths = ribo_length)
    names(ribo_selected) <- names(ribo)
    data$ribo <- ribo_selected
    data
  }

celalp/ribofootprintR documentation built on May 12, 2019, 12:04 p.m.