metaWindow {ORFik} | R Documentation

## Calculate meta-coverage of reads around input GRanges/List object.

### Description

Sums up coverage over set of GRanges objects as a meta representation.

### Usage

    metaWindow(x, windows, scoring = "sum", withFrames = FALSE,
      zeroPosition = NULL, scaleTo = 100, returnAs = "data.frame",
      fraction = NULL, feature = NULL,
      forceUniqueEven = !is.null(scoring))

### Arguments

`x` | GRangesList/GRanges object of your reads. Remember to resize them beforehand to width of 1 to focus on 5' ends of footprints, if that is wanted.
`windows` | GRangesList or GRanges of your ranges
`scoring` | a character, one of (zscore, transcriptNormalized, mean, median, sum, sumLength, NULL), see ?coverageScorings
`withFrames` | a logical (TRUE), return positions with the 3 frames, relative to zeroPosition. zeroPosition is frame 0.
`zeroPosition` | an integer DEFAULT (NULL), the point if all windows are equal size, that should be set to position 0. Like leaders and cds combination, then 0 is the TIS and -1 is last base in leader. NOTE!: if windows have different widths, this will be ignored.
`scaleTo` | an integer (100), if windows have different size, a meta window can not directly be created, since a meta window must have equal size for all windows. Rescale all windows to scaleTo. i.e c(1,2,3) -> size 2 -> c(1, sum(2,3)) etc.
`returnAs` | a character (data.frame), do data.table for speed.
`fraction` | a character/integer (NULL), the fraction i.e (27) for read length 27, or ("LSU") for large sub-unit TCP-seq.
`feature` | a character string, info on region. Usually either gene name, transcript part like cds, leader, or CpG motifs etc.
`forceUniqueEven,` | a logical (TRUE), require that all windows are of same width and even. To avoid bugs.

### Value

A data.frame or data.table with scored counts (score) of reads mapped to positions (position) specified in windows along with frame (frame).

### See Also

Other coverage: `coverageScorings`, `scaledWindowPositions`, `windowPerReadLength`

### Examples

    library(GenomicRanges)
    windows <- GRangesList(GRanges("chr1", IRanges(c(50, 100), c(80, 200)),
                                   "-"))
    x <- GenomicRanges::GRanges(
      seqnames = "chr1",
      ranges =  IRanges::IRanges(c(100, 180), c(200, 300)),
      strand = "-")
    metaWindow(x, windows, withFrames = FALSE)

[Package ORFik version 1.4.1 Index]