package phylogenetics

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Nucleotide IUPAC symbol

IUPAC symbols are characters that can be used to represent a subset of nucleotides, for instance when the nucleotide at a given position is not precisely known. A IUPAC symbol is said ambiguous if it corresponds to a set of size at least 2.

Valid IUPAC symbols for nucleotides can be found here.

include Alphabet.S_int
include Alphabet.S with type t = private int and type vector = private Linear_algebra.vec and type matrix = private Linear_algebra.mat and type 'a table = private 'a array
type t = private int
type vector = private Linear_algebra.vec
type matrix = private Linear_algebra.mat
type 'a table = private 'a array
val equal : t -> t -> bool
val compare : t -> t -> int
val all : t list
val card : int
val to_int : t -> int
val counts : t Core.Sequence.t -> int table
module Table : sig ... end
module Vector : sig ... end
val flat_profile : unit -> vector
val random_profile : Gsl.Rng.t -> float -> vector
module Matrix : sig ... end
val (.%()) : vector -> t -> float
val (.%()<-) : vector -> t -> float -> unit
val (.%{}) : matrix -> (t * t) -> float
val (.%{}<-) : matrix -> (t * t) -> float -> unit
val of_int : int -> t option
val of_int_exn : int -> t
val of_char : char -> t option

of_char c returns the IUPAC symbol corresponding to the given character c. It returns None if the character is not a valid IUPAC nucleotide symbol.

Example:

let symbol = Iupac_nucleotide.of_char 'A' in
(* symbol = Some 0 *)
val is_ambiguous : t -> bool

is_ambiguous sym checks if the given IUPAC symbol sym represents an ambiguous nucleotide. It returns true if the symbol is ambiguous, and false otherwise.

Example:

let ambiguous = Iupac_nucleotide.is_ambiguous 4 in
(* ambiguous = true *)
OCaml

Innovation. Community. Security.