Given two objects,
to, compute the distance in bases of each
to the nearest
The distance between a base and the next inter-bases on either side values 0.5. Thus,
base - base and inter-base - inter-base intervals distances are integer,
whereas base - inter-base intervals distances are half-integers.
1 2 3 4 5
A wrapper calling
seqnames and by
Thus, if both are stranded, distances are computed over each strand separately.
One object must be coerced to
Genome_intervals if this is not wished.
A numeric vector of distances with one element for each row of
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
## load toy examples data(gen_ints) ## i in close_intervals notation close_intervals(i) ## j in close_intervals notation close_intervals(j) ## distances from i to j dn = distance_to_nearest(i,j) dn ## distance == 0 if and only if the interval overlaps another one: io = interval_overlap(i,j) if( any( ( sapply(io, length) >0 ) != (!is.na(dn) & dn ==0) ) ) stop("The property 'distance == 0 if and only if the interval overlaps another one' is not followed for at least one instance.") ## distances without strand-specificity distance_to_nearest( as(i,"Genome_intervals"), as(j,"Genome_intervals") )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.