package biocaml
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=fae219e66db06f81f3fd7d9e44717ccf2d6d85701adb12004ab4ae6d3359dd2d
sha512=f6abd60dac2e02777be81ce3b5acdc0db23b3fa06731f5b2d0b32e6ecc9305fe64f407bbd95a3a9488b14d0a7ac7c41c73a7e18c329a8f18febfc8fd50eccbc6
doc/biocaml.ez/Biocaml_ez/Range/index.html
Module Biocaml_ez.Range
Source
include module type of struct include Biocaml_unix.Range end
Type of a range.
String representation of an range, intended only for human legibility.
to_list v
returns the set of integers contained in v
, in ascending order.
overlap u v
returns amount of overlap between two ranges. A positive value indicates number of integers common to u
and v
. A negative value indicates the number of integers in between non-overlapping ranges. A zero value means the ranges are exactly adjacent to each other. The relation is symmetric.
gap u v
returns the size of the gap between u
and v
. It is equivalent to the negative of overlap
.
Set Operations
union u v
returns the range(s) representing the union of u
and v
. If u
and v
overlap, their union can be represented as a single range. If not, their union is a disjoint combination of two ranges.
intersect u v
returns the range representing the intersection of u
and v
. Return None if intersection is empty.
Positional Range
Positional means an range is viewed as coming either before or after another.
compare_positional u v
returns -1 if u
is strictly before v
, 0 if u
is equal to v
, +1 if u
is strictly after v
, and returns None otherwise.
Containment Range
Containment means a range is viewed as being inside, or a subset of, another.
strict_superset u v
is true if u
is a strict superset of v
.
compare_containment u v
returns -1 if u
is a strict subset of v
, 0 if u
is equal to v
, +1 if u
is a strict superset of v
, and returns None otherwise.
Range Lists
Return true if all pairs of given ranges are positionally comparable.
Return maximum gap between adjacent pairs of given ranges. Raise Failure
if any pairs of given ranges not positionally comparable, or if given less than two ranges.
More Specialized Operations
find_min_range v pred i
finds the minimum sized range within v
centered around i
that satisfies pred
. Successively larger ranges are created starting from [i, i] and the first one to satisfy pred
is returned. None is returned if the given range v
itself is reached and pred
still fails. Raise Failure
if i
not within v
.
The first range tried is [i, i], by default the second is [i, i+1], the third [i-1, i+1], the fourth [i-1, i+2], and so on. The optional init_direction
must be either "fwd" or "rev". If "fwd", which is the default, the range size is initially increased in the forward direction. If "rev", the second range tried will be [i-1, i]. If the range boundary is reached on either side, the size continues to be increased by incrementing on the opposing side.
exp_assoc_list dat
returns a list associating each integer i
with the list of values associated with all ranges overlapping i
in dat
. The set of integers considered is the union of all in given dat
.
TO DO: fill in this documentation. For now see Math.find_regions
.