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, selected_lengths, selected_shifts)

### Arguments

`footprints` | (GAlignments) object of RiboSeq reads
`selected_lengths` | Numeric vector of lengths of footprints you select for shifting.
`selected_shifts` | 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.

### 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.

### Examples

    ## Not run:
    gtf_file <- system.file("extdata", "annotations.gtf", package = "ORFik")
    txdb <- GenomicFeatures::makeTxDbFromGFF(gtf_file, format = "gtf")
    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, txdb)
    # shift the RiboSeq footprints
    shiftedReads <- shiftFootprints(footprints, shifts$fragment_length,
                                    shifts$offsets_start)

    ## End(Not run)

[Package ORFik version 1.0.0 Index]