annotationLookup | R Documentation |
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.
The data.frame,data.frame method:
annotationLookup(x, anno, ...)
The data.frame,GRanges method:
annotationLookup(x, anno, up, down, ...)
Probe genomic locations, a data.frame
with required elements
chr
, position
, and optionally index
a data.frame
with required elements chr
, start
,
end
, strand
and optional element name
.
Also may be a GRanges
with optional elementMetadata column
name
.
The number of bases upstream to look.
The number of bases downstream to look.
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.
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.
A list with elements
a list for each gene in y
, giving a vector
of indices to the probe data.
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.
Aaron Statham, Mark Robinson
annotationBlocksLookup
, makeWindowLookupTable
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.