Description Value Methods Note Author(s) See Also Examples
For each genome interval in one set, finds the nearest interval in a second set of genome intervals.
a data.frame
with a number of rows equal to the number of
intervals in argument from
. The elements of the data.frame are:
distance_to_nearest |
numeric; distance to nearest interval from
object |
which_nearest |
list; each list element are the indices or the
intervals in object |
which_overlap |
list; each list element are the indices or the
intervals in object |
Currently, the package girafe contains method implementations
for the first object (Argument: from
) being of any of the
classes “AlignedGenomeIntervals”,“Genome_intervals” or
“Genome_intervals_stranded”. The second object (Argument:
to
) has be of class “Genome_intervals_stranded” or
“Genome_intervals”.
If the supplied objects are stranded, as it is the case with objects of classes ‘AlignedGenomeIntervals’ and ‘Genome_intervals_stranded’, then the overlap and distance is solely computed between intervals on the same strand.
For objects of class ‘Genome_intervals’, overlap and distances are computed regardless of strand information.
Joern Toedling
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ### process aligned reads
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")
## load annotated genome features
load(file.path(exDir, "mgi_gi.RData"))
## subset for sake of speed:
A <- exAI[is.element(seqnames(exAI), c("chrX","chrY"))]
G <- mgi.gi[is.element(seqnames(mgi.gi), c("chrX","chrY"))]
## find nearest annotated feature for each AlignedGenomeInterval
WN <- which_nearest(A, G)
dim(WN); tail(WN)
## notice the difference to:
tail(which_nearest(as(A, "Genome_intervals"), G))
# the last interval in A is located antisense to a gene,
# but not overlapping anything on the same strand
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.