annotationCounts {Repitools} | R Documentation

## Counts the number of sequencing reads surrounding supplied annotations

### Description

Counts are made in windows with boundaries fixed distances either side of a reference point.

### Usage

# ANY,data.frame method
`annotationCounts(x, anno, ...)`
# ANY,GRanges method
`annotationCounts(x, anno, up, down, ...)`

### Arguments

x:

  A character vector of BAM paths, `GRangesList`, or `GRanges` object.

anno:

  A set of genomic features to make windows around a reference point of theirs. Either a `data.frame` with (at least) colums `chr`, `start`, and `end`, or a `GRanges` object.

up:

  The number of bases upstream to look.

down:

  The number of bases downstream to look.

seq.len:

  If sequencing reads need to be extended, the fragment size to be used. Default: NULL (no extension).

verbose:

  Whether to print progress. Default: TRUE.

...:

  Parameters described above, that are not used in the function called, but are passed into annotationBlocksCounts, that uses them in its processing.

### Details

If the genomic features annotation contains all unstranded features, the `up` and `down` distances refer to how far towards the start of a chromosome, and how far towards the end to make the counting window boundaries. If the annotation is all stranded, then the `up` and `down` distances are relative to the TSS of the features.

### Value

A `matrix` of counts is returned, one column per sample and one row per row of genomic features supplied.

### Author(s)

Aaron Statham

### See Also

`annotationBlocksCounts`, `genomeBlocks`

### Examples

      require(GenomicRanges)
      reads <- GRanges(seqnames = rep("chr1", 5),
                       IRanges(c(3309, 4756, 4801, 4804, 5392), width = 36),
                       strand = c('+', '-', '-', '+', '+'))
      genes <- GRanges("chr1", IRanges(5000, 7000), strand = '+')

      annotationCounts(reads, genes, 500, 500, 300)

[Package Repitools version 1.34.0 Index]