Learn R Programming

girafe (version 1.24.0)

perWindow: 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

Value

  • a data.frame with the following information for each sliding window on the chromosome
  • chrstring; which chromosome the interval is on
  • startinteger; start coordinate of the windows on the chromosome
  • endinteger; end coordinate of the windows on the chromosome
  • n.overlapinteger; 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.readsnumeric; number of reads which match positions inside this window; can be floating-point numbers if argument normaliseByMatches=TRUE
  • n.uniqueinteger; number of reads which each only have one match position in the genome and for which this position is contained inside this window
  • max.readsinteger; the maximal number of reads at any single one match position contained inside this window
  • firstinteger; coordinate of the first read alignment found inside the window
  • lastinteger; 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.

Details

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

See Also

AlignedGenomeIntervals-class

Examples

Run this code
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),])

Run the code above in your browser using DataLab