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 map : t -> f:(description:string -> sequence:string -> string * string) -> (t, [> `Unequal_sequence_lengths ]) 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 show_parsing_error : parsing_error -> Ppx_deriving_runtime.string
val of_assoc_list : (string * string) list -> (t, [> error ]) result
val from_fasta : string -> (t, [> parsing_error ]) result
val from_fasta_exn : string -> t

Same as from_fasta but raises Failure if some error happens

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 -> (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.