windowPerTranscript: Get a binned coverage window per transcript

Description Usage Arguments Details Value

View source: R/coverage_helpers.R

Description

Per transcript (or other regions), bin them all to windowSize (default 100), and make a data.table, rows are positions, useful for plotting with ORFik and ggplot2.

Usage

1
2
3
4
5
6
7
8
9
windowPerTranscript(
  txdb,
  reads,
  splitIn3 = TRUE,
  windowSize = 100,
  fraction = "1",
  weight = "score",
  BPPARAM = bpparam()
)

Arguments

txdb

a TxDb object or a path to gtf/gff/db file.

reads

GRanges or GAlignment of reads

splitIn3

a logical(TRUE), split window in 3 (leader, cds, trailer)

windowSize

an integer (100), size of windows (columns)

fraction

a character (1), info on reads (which read length, or which type (RNA seq)) (row names)

weight

(default: 'score'), if defined a character name of valid meta column in subject. GRanges("chr1", 1, "+", score = 5), would mean score column tells that this alignment region was found 5 times. ORFik .bedo files, contains a score column like this. As do CAGEr CAGE files and many other package formats. You can also assign a score column manually.

BPPARAM

how many cores/threads to use? default: bpparam()

Details

NOTE: All ranges with smaller width than windowSize, will of course be removed. What is the 100th position on a 1 width object ?

Value

a data.table with columns position, score


ORFik documentation built on March 27, 2021, 6 p.m.