annotationLookup {Repitools} | R Documentation

## Forms a mapping between probes on a tiling array and windows surrounding the TSSs of genes.

### Description

Starting from genome locations for probes and a locations for a set of genes, this procedure forms a list structure that contains the indices to map from one to the other.

### Usage

The data.frame,data.frame method:
`annotationLookup(x, anno, ...)`
The data.frame,GRanges method:
`annotationLookup(x, anno, up, down, ...)`

### Arguments

x:

  Probe genomic locations, a `data.frame` with required elements `chr`, `position`, and optionally `index`

anno:

  a `data.frame` with required elements `chr`, `start`, `end`, `strand` and optional element `name`. Also may be a `GRanges` with optional elementMetadata column `name`.

up:

  The number of bases upstream to look.

down:

  The number of bases downstream to look.

verbose:

  Whether to print progress to screen. Default: TRUE

...:

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

### Details

This function is a wrapper for the generic function `annotationBlocksLookup` which can handle annotations of varying sizes. `annotationLookup` is appropriate where you wish to map probes that are within a fixed distance of points of annotation e.g gene transcription start sites. Even if strand information is given for probes, it is ignored.

If `x` has no index column, then the probes are given indices from 1 to the number of probes, in the order that they appear in the `data.frame` or `GRanges` object.

It is an error for the gene annotation to have unstranded features.

### Value

A list with elements

indexes

  a list for each gene in `y`, giving a vector of indices to the probe data.

offsets

  a list for each gebe in `y`, giving a vector (corresponding to `indexes`) of offsets relative to the genes' TSSs for each probe that mapped that that gene.

### Author(s)

Aaron Statham, Mark Robinson

### See Also

`annotationBlocksLookup`, `makeWindowLookupTable`

### Examples

    # create example set of probes and gene start sites
    probes <- data.frame(position=seq(1000, 3000, by = 200), chr = "chrX", strand = '-')
    genes <- data.frame(chr = "chrX", start=c(2100, 1000), end = c(3000, 2200),
                        strand=c("+","-"))
    rownames(genes) <- paste("gene", 1:2, sep = '')

    # Call annotationLookup() and look at output
    annotationLookup(probes, genes, 500, 500)

[Package Repitools version 1.26.0 Index]