orfFrameDistributions: Find shifted Ribo-seq frame distributions

View source: R/report_helpers.R

orfFrameDistributionsR Documentation

Find shifted Ribo-seq frame distributions

Description

Per library: get coverage over CDS per frame per readlength Return as data.datable with information and best frame found. Can be used to automize re-shifting of read lengths (find read lengths where frame 0 is not the best frame over the entire cds)

Usage

orfFrameDistributions(
  df,
  type = "pshifted",
  weight = "score",
  orfs = loadRegion(df, part = "cds"),
  BPPARAM = BiocParallel::bpparam()
)

Arguments

df

an ORFik experiment

type

type of library loaded, default pshifted, warning if not pshifted might crash if too many read lengths!

weight

which column in reads describe duplicates, default "score".

orfs

GRangesList, default loadRegion(df, part = "cds")

BPPARAM

how many cores/threads to use? default: bpparam(). To see number of threads used, do bpparam()$workers. You can also add a time remaining bar, for a more detailed pipeline.

Value

data.table with columns: fraction (library) frame (0, 1, 2) score (coverage) length (read length) percent (coverage percentage of library) percent_length (coverage percentage of library and length) best_frame (TRUE/FALSE, is this the best frame per length)

Examples

df <- ORFik.template.experiment()[3,]
dt <- orfFrameDistributions(df, BPPARAM = BiocParallel::SerialParam())
## Check that frame 0 is best frame for all
all(dt[frame == 0,]$best_frame)

Roleren/ORFik documentation built on April 25, 2024, 8:41 p.m.