get_codon_occs: Estimate per codon occupancies

get_codon_occsR Documentation

Estimate per codon occupancies

Description

Uses sampled RPF coverage gr object, offsets data frame, and an annotation object to get estimates of per-codon occupancy (which are proportional to dwell times)

Usage

get_codon_occs(
  psites,
  offsets_df,
  anno,
  n_genes = 1000,
  covthresh = 10,
  method = "linear"
)

Arguments

psites
  • a data frame of inferred RPF p-sites

offsets_df
  • a data frame with numeric columns readlen,phase,offset

anno
  • an annotation object

n_genes
  • how many genes to use for the model - most highly expressed used first

covthresh
  • how many reads to require in an ORF for it to be used defaults to RUST

method
  • which method to use to estimate the codon occupancies,

Value

a data frame with columns codon,position,estimate,upper,lower, p.value

Author(s)

Dermot Harnett, dermot.p.harnett@gmail.com

Examples

data(chr22_anno)
data(rpfs)
data(offsets_df)
fafile <- here::here('chr22.fa')
library(BSgenome.Hsapiens.UCSC.hg38)
if(!file.exists(fafile)){
    seq <- Biostrings::DNAStringSet(BSgenome.Hsapiens.UCSC.hg38[['chr22']])
    names(seq) <- 'chr22'
    Biostrings::writeXStringSet(
    seq, fafile)}
Rsamtools::indexFa(fafile)
psites <- get_psite_gr(rpfs, offsets_df, chr22_anno)
rust_codon_occ_df <- get_codon_occs(psites, offsets_df, chr22_anno,
  n_genes = 200, method = "RUST"
)

zslastman/RiboStan documentation built on June 12, 2024, 1:59 a.m.