segmentOverlaps_bed: calculate segment overlap statistics using UCSC bedtools

segmentOverlaps_bedR Documentation

calculate segment overlap statistics using UCSC bedtools

Description

This function produces the same output as segmentOverlaps, but using a command-line call to UCSC bedtools, which must be installed, and starting from normal genome coordinates (w/o indexing; 0-based and inclusive start and end). It temporarily creates bed files, and can require quite a lot of disk space. However, it is faster than segmentOverlaps, and likely better tested.

Usage

segmentOverlaps_bed(
  query,
  target,
  qclass,
  tclass,
  prefix = "cl_",
  chrL,
  perm,
  tmpdir,
  runid,
  overlaps = FALSE,
  symmetric = FALSE,
  save.permutations = FALSE,
  verb = 1
)

Arguments

query

query segment table, will be permutated.

target

target segment table.

qclass

column name which holds a sub-classification (clustering) of the query segments, omit to use all.

tclass

column name which holds a sub-classification (clustering) of the target segments, omit to use all.

prefix

prefix to be added to the name and score columns of bed files (column 4,5), used to get unique names.

chrL

obligatory vector of chromosome length, in the order used as index in the chr column of query and target.

perm

number of permutations for calculating statistics.

tmpdir

temporary directory, useful to provide for debugging, or exploring detailed results.

runid

use this ID for the run, for more recognizable jobnames. This is potentially dangerous since each call MUST have a unique name.

overlaps

allow overlaps in the permutations of query segments.

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.

save.permutations

save permutated query bed files used in p-value calculation. If this is provided together with tmpdir, the randomized bed files can be re-used. However, this may be dangerous or cause errors when different queries and targets are used with the same tmpdir.

verb

verbosity level, 0: silent.


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