package phylogenetics

  1. Overview
  2. Docs

A representation for sequence alignments

The following invariants are maintained:

  • the alignment is non-empty
  • all sequences have the same length
type t
val nrows : t -> int
val ncols : t -> int
val description : t -> int -> string
val sequence : t -> int -> string
type error = [
  1. | `Empty_alignment
  2. | `Unequal_sequence_lengths
]
val pp_error : Ppx_deriving_runtime.Format.formatter -> error -> Ppx_deriving_runtime.unit
val show_error : error -> Ppx_deriving_runtime.string
val map : t -> f:(description:string -> sequence:string -> string * string) -> (t, [> `Unequal_sequence_lengths ]) Stdlib.result
val array_mapi : t -> f:(int -> description:string -> sequence:string -> 'a) -> 'a array
val fold : t -> init:'a -> f:('a -> description:string -> sequence:string -> 'a) -> 'a
val find_sequence : t -> string -> string option
type parsing_error = [
  1. | `Fasta_parser_error of string
  2. | error
]
val pp_parsing_error : Ppx_deriving_runtime.Format.formatter -> parsing_error -> Ppx_deriving_runtime.unit
val show_parsing_error : parsing_error -> Ppx_deriving_runtime.string
val of_assoc_list : (string * string) list -> (t, [> error ]) Stdlib.result
val from_fasta : string -> (t, [> parsing_error ]) Stdlib.result
val to_fasta : t -> string -> unit
val indel_free_columns : t -> bool array
val residues : t -> column:int -> Core_kernel.Char.Set.t
val number_of_residues_per_column_stats : t -> (int * int) list
val composition : t -> (Stdlib.Char.t * float) list
val constant_site : t -> int -> bool
module Make (S : Seq.S) : Sigs.ALIGNMENT with type base = S.base and type sequence = S.t

Legacy code: provides a functor to build from SEQUENCE modules.

OCaml

Innovation. Community. Security.