Module Biocaml.SolexaScore

module SolexaScore: Biocaml_solexaScore

exception Error of string
type t = int 
val of_ascii : char -> t
of_ascii x returns the PHRED score encoded by ASCII character x.
Raises Error if x's ASCII code is not between 33 - 126.
val to_ascii : t -> char
to_ascii t encodes t as an ASCII character.
Raises Error if t cannot be encoded as a visible ASCII character (codes 33 - 126).
val of_probability : ?f:(float -> int) -> float -> t
of_probability ~f x returns -10 * log_10(x/(1-x)), which is the definition of Solexa scores.

Solexa scores are integral, and it is unclear what convention is used to convert the resulting float value to an integer. Thus, the optional f is provided to dictate this. The default is to round the computed score to the closest integer.
Raises Error if x is not between 0.0 - 1.0.

val to_probability : t -> float
to_probablity x converts x to a probablity score. Note this is not the inverse of of_probability due to the rounding done by the latter.