segmentOverlaps: Jaccard-Index overlap test for classes of segments (genomic...

segmentOverlapsR Documentation

Jaccard-Index overlap test for classes of segments (genomic intervals)

Description

calculates the Jaccard index, including a simple permutation test, between different classes in a query and a target set of segments (genomic intervals), where coordinates have been converted to a continuous index over all chromosomes with coor2index. Note, that this ignores chromosome borders!

Usage

segmentOverlaps(
  query,
  target,
  qclass,
  tclass,
  total,
  perm = 0,
  symmetric = FALSE,
  verb = 1
)

Arguments

query

query set of segments

target

target set of segments

qclass

column name which holds a sub-classification (clustering) of the query segments, omit or pass empty string ("") to use all

tclass

column name which holds a sub-classification (clustering) of the target segments, omit or pass empty string ("") to use all

total

total length of the query range (genome length), if missing the start of the first segment is also used as end

perm

number of permutations to perform

symmetric

treat test as symmetric. This is only useful for the case where overlaps all segments from the forward strand and the reverse strand are tested, to find antisense overlaps within a segment classification.

verb

integer level of verbosity, 0: no messages, 1: show messages

Details

Reports the Jaccard index (J=intersect/union)) between two distinct sets of segments (matrix "jaccard" in the results object), and the relative intersect lengths, i.e., intersect divided by the total target length (matrix "intersect.target") or the total query length (matrix "intersect.query"). If argument perm>0, a simple permutation is performed, sampling randomly from all inter-segment distances and segment lengths, and ignoring optional query sub-classifications (argument qclass). Note, that chromosome ends are ignored. The total length of the query range (genome length, for both strands, if both are used) can be passed in argument total, and if missing the start of the first segment is also used as the distance of the final segment to the query range end. The results of the permutation test (argument perm>0) can be plotted directly with plotOverlaps, where option text allows to plot either the jaccard index or the relative intersect sizes.


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