shiftReads: Shift the 5'-end of reads of towards downstream direction

View source: R/bam_ops.R

shiftReadsR Documentation

Shift the 5'-end of reads of towards downstream direction

Description

Shift the 5'-end of reads of towards downstream direction. Ribosome profiling reads are known to have P-site offset. Reads on the positive strand will be shifted to the right, and reads on the negative strand will be shifted to the left.

Usage

shiftReads(bam, readLens = NULL, shiftLens = NULL, fiveEndOnly = TRUE)

Arguments

bam

A GAlignments object of aligned reads. (Required).

readLens

A vector of read lengths to use (positive). If NULL, all lengths will be kept. (Default: NULL).

shiftLens

A vector of shift size (non-negative) for each read length. If NULL, reads will not be shifted. If both shiftLens and readLens are not NULL, they must have the same length. If readlens is NULL and shiftLens is a single value, all reads will be shifted by this length. (Default: NULL).

fiveEndOnly

A logical variable indicating if only keeping the shifted 5'-end. (Default: TRUE).

Value

If fiveEndOnly is TRUE, return a GRanges object of shifted reads. Otherwise, return a GAlignments object of shifted reads.


nzhang89/RiboSeeker documentation built on April 15, 2022, 10:18 a.m.