perWindow {girafe} | R Documentation

## Investigate aligned reads in genome intervals with sliding windows

### Description

Investigate aligned reads in genome intervals with sliding windows.

### Usage

    perWindow(object, chr, winsize, step, normaliseByMatches = TRUE,
              mem.friendly = FALSE)

### Arguments

`object` | object of class `AlignedGenomeIntervals`
`chr` | string; which chromosome to investigate with sliding windows
`winsize` | integer; size of the sliding window in base-pairs
`step` | integer; offset between the start positions of two sliding windows
`normaliseByMatches` | logical; should the number of reads per `AlignedGenomeInterval` be normalised by the number of genomic matches of the read sequence before summing them up in each window? (i.e. derivation a weighted sum of read counts)
`mem.friendly` | logical; argument passed on to function `interval_overlap`; if `TRUE` the less RAM and, if the `parallel` package is attached, multiple processors are used for computing the overlap, on the expense of time

### Details

The windows are constructed from the first base position onto which a read has been mapped until the end of the chromosome.

### Value

a `data.frame` with the following information for each sliding window on the chromosome

`chr` | string; which chromosome the interval is on
`start` | integer; start coordinate of the windows on the chromosome
`end` | integer; end coordinate of the windows on the chromosome
`n.overlap` | integer; number of read match positions inside the window. Per match position there can be one or more reads mapped, so this number always is smaller than `n.reads`
`n.reads` | numeric; number of reads which match positions inside this window; can be floating-point numbers if argument `normaliseByMatches=TRUE`
`n.unique` | integer; number of reads which each only have one match position in the genome and for which this position is contained inside this window
`max.reads` | integer; the maximal number of reads at any single one match position contained inside this window
`first` | integer; coordinate of the first read alignment found inside the window
`last` | integer; coordinate of the last read alignment found inside the window

The result is of class `data.frame` and in addition of the (S3) class `slidingWindowSummary`, which may be utilized by follow-up functions.

### Author(s)

Joern Toedling

### See Also

`AlignedGenomeIntervals-class`

### Examples

      exDir <- system.file("extdata", package="girafe")
      exA   <- readAligned(dirPath=exDir, type="Bowtie",
        pattern="aravinSRNA_23_no_adapter_excerpt_mm9_unmasked.bwtmap")
      exAI  <- as(exA, "AlignedGenomeIntervals")
      exPX  <- perWindow(exAI, chr="chrX", winsize=1e5, step=0.5e5)
      head(exPX[order(exPX$n.overlap, decreasing=TRUE),])

[Package girafe version 1.32.0 Index]