package biocaml

  1. Overview
  2. Docs
The OCaml Bioinformatics Library

Install

Dune Dependency

Authors

Maintainers

Sources

biocaml-0.11.2.tbz
sha256=fae219e66db06f81f3fd7d9e44717ccf2d6d85701adb12004ab4ae6d3359dd2d
sha512=f6abd60dac2e02777be81ce3b5acdc0db23b3fa06731f5b2d0b32e6ecc9305fe64f407bbd95a3a9488b14d0a7ac7c41c73a7e18c329a8f18febfc8fd50eccbc6

doc/biocaml.unix/Biocaml_unix/Accu/index.html

Module Biocaml_unix.AccuSource

A datastructure (based on Hashtbl) to accumulate values.

An Accu.t can be seen as a generalized histogram: samples are mapped to bins, and each bin has a corresponding value which may be its size or its contents depending on the need.

Generic API
Sourcetype ('sample, 'bin, 'increment, 'accu) t

General type for accumulators: 'samples are mapped to 'bins, and the 'accumulated value for a 'bin is updated with an 'increment

Sourceval create : ?n:int -> bin:('a -> 'b) -> zero:'d -> add:('c -> 'd -> 'd) -> unit -> ('a, 'b, 'c, 'd) t

create ~n ~zero ~bin ~add creates an accumulator, which maps instances to bins with bin, uses zero as a neutral element (that is the value associated to a bin before any value has been added to it) and updates the value of a bin with add. n is an estimation of the maximum number of bins.

Sourceval add : ('a, 'b, 'c, 'd) t -> 'a -> 'c -> unit

add accu x y updates the value in accu for the bin of x by an increment y

Sourceval stream : ('a, 'b, 'c, 'd) t -> ('b * 'd) Stream.t
Sourceval to_alist : ('a, 'b, 'c, 'd) t -> ('b * 'd) list
Sourceval get : ('a, 'b, 'c, 'd) t -> 'b -> 'd option

get accu x returns the value associated to b in accu.

Counters and histograms
Sourcemodule Counter : sig ... end
Sourceval counts : 'a Stream.t -> ('a * int) Stream.t
Sourceval product : ?filter:('a -> 'b -> bool) -> ('a -> 'b -> 'c) -> 'a list -> 'b list -> ('c * int) Stream.t

product filter f l1 l2 computes an histogram of values returned by f when it is applied for all combinations of elements in l1 and l2 such that the predicate filter is true

Relation
Sourcemodule Relation : sig ... end
Sourceval relation : ('a * 'b) Stream.t -> ('a * 'b list) Stream.t
Sourcemodule Bins : sig ... end
OCaml

Innovation. Community. Security.