Legend:
Library
Module
Module type
Parameter
Class
Class type
A representation for sequence alignments
An alignment is a non-empty collection of sequences where all sequences have the same length. Each sequence comes with a description. A sequence description provides additional textual information about a sequence in an alignment, such as its name or biological context. It helps identify and differentiate sequences without directly inspecting the sequence data.
map alignment ~f applies the function f to each sequence in the alignment and returns a new alignment with the modified descriptions and sequences. If the sequences have unequal lengths, an error of type `Unequal_sequence_lengths is returned.
val array_mapi :
t->f:(int ->description:string ->sequence:string ->'a)->'a array
array_mapi alignment ~f applies the function f to each sequence in the alignment, preserving the sequence indices, and returns an array of the resulting values.
val fold :
t->init:'a->f:('a->description:string ->sequence:string ->'a)->'a
fold alignment ~init ~f applies the function f to each sequence in the alignment using an initial accumulator init, and returns the final value of the accumulator.
find_sequence alignment id searches for a sequence in the alignment using its description as the search criterion. It returns the corresponding sequence as a string option, or None if the sequence is not found.
val of_assoc_list : (string * string) list->(t, [> error ])Stdlib.result
of_assoc_list l creates an alignment from a list of key-value associations, where the key represents the description of the sequence and the value represents the sequence itself. It returns the created alignment, or an error if the input data does not satisfy the alignment invariants.
indel_free_columns alignment checks each column of the alignment for the presence of indels ("-"). It returns a boolean array indicating whether each column is indel-free.
residues alignment ~column:j returns the set of residues present in the specified column j of the alignment.
val number_of_residues_per_column_stats : t->(int * int) list
number_of_residues_per_column_stats alignment calculates the number of unique residues per column in the alignment and returns the statistics as a list of pairs, where the first element of each pair represents the column index and the second element represents the number of unique residues.
composition alignment calculates the residue composition of the alignment and returns the results as a list of pairs, where each pair consists of a residue and its relative frequency in the alignment.
constant_site alignment j checks whether the specified column j of the alignment contains a constant site, i.e., all sequences have the same residue at that column.
Legacy code: provides a functor to build from SEQUENCE modules.