shiftFootprints {ORFik}R Documentation

Shift footprints by selected offsets

Description

Function shifts footprints (GRanges) using specified offsets for every of the specified lengths. Reads that do not conform to the specified lengths are filtered out and rejected. Reads are resized to single base in 5' end fashion, treated as p site. This function takes account for junctions in cigars of the reads. Length of the footprint is saved in size' parameter of GRanges output. Footprints are also sorted according to their genomic position, ready to be saved as a bed file.

Usage

shiftFootprints(footprints, shifts)

Arguments

footprints

(GAlignments) object of RiboSeq reads

shifts

a data.frame with minimum 2 columns, selected_lengths and selected_shifts. Output from detectRibosomeShifts

Details

The two columns in shift are: - fraction Numeric vector of lengths of footprints you select for shifting. - offsets_start Numeric vector of shifts for coresponding selected_lengths. eg. c(10, -10) with selected_lengths of c(31, 32) means length of 31 will be shifted left by 10. Footprints of length 32 will be shifted right by 10.

NOTE: It will remove softclips from valid width, the CIGAR 3S30M is qwidth 33, but will remove 3S so final read width is 30 in ORFik.

Value

A GRanges object of shifted footprints, sorted and resized to 1bp of p-site, with metacolumn "size" indicating footprint size before shifting and resizing, sorted in increasing order.

See Also

Other pshifting: changePointAnalysis, detectRibosomeShifts

Examples

## Not run: 
# input path to gtf, or load it as TxDb.
gtf_file <- system.file("extdata", "annotations.gtf", package = "ORFik")
# load reads
riboSeq_file <- system.file("extdata", "ribo-seq.bam", package = "ORFik")
footprints <- GenomicAlignments::readGAlignments(
  riboSeq_file, param = ScanBamParam(flag = scanBamFlag(
    isDuplicate = FALSE, isSecondaryAlignment = FALSE)))
# detect the shifts automagically
shifts <- detectRibosomeShifts(footprints, gtf_file)
# shift the RiboSeq footprints
shiftedReads <- shiftFootprints(footprints, shifts)

## End(Not run)

[Package ORFik version 1.4.0 Index]