annotationBlocksLookup {Repitools} | R Documentation

## Forms a mapping between probe locations and chromosomal blocks (regions).

### Description

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

### Usage

      ## S4 method for signature 'data.frame,data.frame'
    annotationBlocksLookup(x, anno, ...)
      ## S4 method for signature 'data.frame,GRanges'
    annotationBlocksLookup(x, anno, verbose = TRUE)

### 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`.
`verbose` | Whether to print progress to screen.
`...` | Represents the `verbose` parameter, when the `data.frame,data.frame` method is called.

### Details

Strandedness of probes is ignored, even if it is given.

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.

### 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 start of the block.

### Author(s)

Aaron Statham, Mark Robinson

### See Also

`annotationLookup` which simplifies annotation lookups for constant sized regions

### Examples

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

    # Call annotationLookup() and look at output
    annotationBlocksLookup(probeTab, genes)

[Package Repitools version 1.33.3 Index]