libak
0.4.0
|
Data Structures | |
struct | akSegment |
Alignment. More... | |
Functions | |
void | ak_aligner_free (akAligner *aligner) |
Frees memory. | |
akAligner * | ak_aligner_new (akCModel *cmodel, const akSeqs *seqs, const akBool statealign, char **err) |
Gets an akAligner. | |
int | ak_align (akAligner *aligner, const akFea *fea, const size_t seq, akSegment **alignment, size_t *size, akFloat *prob) |
Aligns a sample with a character sequence. |
int ak_align | ( | akAligner * | aligner, |
const akFea * | fea, | ||
const size_t | seq, | ||
akSegment ** | alignment, | ||
size_t * | size, | ||
akFloat * | prob | ||
) |
Aligns a sample with a character sequence.
This function finds the maximum probability path of a given sample, feature vector sequence, for a provided character sequence, and gets the alignment. The sequence is specified as integer code according to the sequence manager used during the creation of the aligner. The resulting alignment is returned into the variable alignment. The alignment is terminated with a akSegment with length -1. If alignment points to NULL the needed memory is allocated and the number of allocated segments is stored in the variable size. If alignment doesn't point to NULL then alignment will be reallocated if needed, according to the value stored in size, and the variable size will be updated.
aligner | The aligner. |
fea | A feature vector manager, which must contain a sequence of feature vectors of an adequate type for the cmodel. |
seq | The code of the character sequence which will be aligned. |
alignment | Pointer to the address where the alignment will be stored. It can be point to NULL. |
size | Memory address where the number of allocated segments of alignment is stored. |
prob | The probability of the sample. |
void ak_aligner_free | ( | akAligner * | aligner | ) |
Frees memory.
Frees the memory allocated for the aligner.
aligner | The aligner |
akAligner* ak_aligner_new | ( | akCModel * | cmodel, |
const akSeqs * | seqs, | ||
const akBool | statealign, | ||
char ** | err | ||
) |
Gets an akAligner.
This function creates an aligner used to align samples with character sequences. This data only can be used to align samples, using the provided character models, with the character sequences stored in seqs during the creation of the aligner. Alignment can be done at character level or state level. This structure stores a reference to the provided character models and sequence manager, thus, the character models and sequence manager must not be freed. Currently supported types are: Bernoulli, DGaussian, Mixture and TiedStates.
cmodel | The character models. |
seqs | A character sequence manager containing the character sequences which can be used to align samples. |
statealign | If TRUE alignment is performed at state level, else at character level. |
err | Pointer to string variable. If not NULL an error message is allocated in the variable in case of error. |