annotateTarget: annotate target segments by overlapping query segments

View source: R/segmenTools.R

annotateTargetR Documentation

annotate target segments by overlapping query segments

Description

wrapper around segmentAnnotate, used to annotate the target set by a column in the query set. See Details for required input formats.

Usage

annotateTarget(
  query,
  target,
  qcol = colnames(query),
  tcol,
  prefix,
  details = FALSE,
  only.best = TRUE,
  sort = TRUE,
  minJaccard,
  collapse = TRUE,
  msgfile = stdout()
)

Arguments

query

the query set of segments (genomic intervals)

target

the target set of segments (genomic intervals)

qcol

column names to copy from target to it's best match in query, defaults to all columns

tcol

column names of target to include in the returned table, defaults to none

prefix

column name prefix for the copied columns

details

set to TRUE to add details of the used match, i.e., union and intersect, and relative position of the query to the matching targets

only.best

only consider the top-ranking query hit

sort

sort hits by rank

minJaccard

minimal Jaccard index (intersect/union) threshold; overlaps below this value will NOT be reported; NOTE that this will set argument details to TRUE

collapse

if TRUE multiple query hits are collapsed into a single row, with ;-separated strings in the respective fields.

msgfile

file pointer for progress messages and warnings, defaults to stdout, useful when using in context of command line pipes

Details

Wrapper around segmentAnnotate, used to annotate the target set by a column in the query set. Note that coordinates must already be ‘indexed’, see ?segmentAnnotate and ?coor2index. The default options (only.best=TRUE, collapse=TRUE yield a result matrix with 1 row for each target (nrow(results)==nrow(target), annotated by only the best ranking overlapping query segment(s), ie. the the query segment(s) with the highest Jaccard index. If multiple query segments have the same Jaccard index, they are collapsed into ;-separated lists. If collapse=FALSE, each overlapping query segment will have its own row, and the result matrix is longer (nrow(results)>=nrow(target)). If only.best=FALSE, all overlapping query segments will be reported, and optionally sorted by rank (sort). Additionaly a minimal Jaccard filter can be applied (option minJaccard), and only query segments with a higher Jaccard index are reported.


raim/segmenTools documentation built on May 5, 2024, 11:30 a.m.