segmentAnnotate | R Documentation |
Simple sweeping algorithm to find overlapping intervals. Both
intervals must be in continuous index (coor2index) and start<end,
with strand information implied in the continuous index position.
See bedtools
intersects
, the Binary Interval
Search (BITS) algorithm, and the NClist
algorithm (implemented
in packages IRanges and GenomicRanges) for similar tools.
It loops over targets and collects all queries that match, and
optionally adds NA lines for non-matched targets.
segmentAnnotate(
query,
target,
details = FALSE,
distance,
add.na = FALSE,
untie = FALSE,
collapse = FALSE,
sort = FALSE,
msgfile = stdout()
)
query |
the query set of segments (genomic intervals) |
target |
the target set of segments (genomic intervals) |
details |
add details on the relative positions of the query wrt the target (covers,left,inside,right); note, that keywords 'left' and 'right' will be converted to 'upstream' or 'downstream' by index2coor, accounting for strand info. |
distance |
not yet implemented: maximal distance for neighbor count |
add.na |
add an empty overlap line for targets without overlaps |
untie |
if several queries have equal top rank of 1, the rank can be replaced by simple order, such that only the first query will have rank 1 |
collapse |
if |
sort |
sort query hits by their |
msgfile |
file pointer for progress messages and warnings, defaults to stdout, useful when using in context of command line pipes |
If details==TRUE
, a column qpos
will indicate the
relative position of the query to the target (e.g. ‘inside’ means
that the query is ‘inside’ the target, ‘left’ means at lower
coordinates then the target). The positions ‘right’ and ‘left’
can later can be converted to ‘upstream/downstream/etc.’ by
index2coor
which re-introduces strand information.
To analyze relative positions between features on distinct
strands, the target or query has to be mapped to the opposite
strand by switchStrand
before passing it to
segmentAnnotate
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.