Haplo Prediction
predict haplogroups
|
Provides a mapping between haplo groups and their sequential ordering. More...
#include <config.h>
#include <stdlib.h>
#include <inttypes.h>
#include <jwsc/base/error.h>
#include <jwsc/vector/vector.h>
Go to the source code of this file.
Enumerations | |
enum | Haplo_ancestor_type { HAPLO_ANCESTOR_NONE = 0, HAPLO_ANCESTOR_DIRECT, HAPLO_ANCESTOR_INDIRECT } |
Type of ancestry relating two haplo groups. More... | |
Functions | |
Error * | read_haplo_groups (const char *fname) |
Reads the haplo groups from a file. | |
Error * | lookup_haplo_group_index_from_label (uint32_t *index_out, const char *label) |
Looks up the index for a haplo group based on its label. | |
Error * | lookup_haplo_group_label_from_index (const char **label_out, uint32_t index) |
Looks up a haplo group label from its index. | |
Error * | lookup_haplo_group_ancestor_index_from_haplo_group_index (uint32_t *index_out, uint32_t index) |
Looks up the index of the immediate ancestor for the haplogroup specified by the index. | |
uint32_t | get_num_haplo_groups () |
Returns the number of haplo groups represented. | |
uint8_t | is_ancestor (uint32_t index_1, uint32_t index_2) |
Returns whether a haplo group label is an ancestor of another. | |
Haplo_ancestor_type | find_ancestor_index_of_pair (uint32_t *index_out, uint32_t index_1, uint32_t index_2) |
Finds the lowest common ancestor between two haplo group labels. | |
Haplo_ancestor_type | find_ancestor_index_of_set (uint32_t *index_out, const Vector_u32 *indices) |
Finds the lowest common ancestor between a set of haplo group labels. |
Provides a mapping between haplo groups and their sequential ordering.
Definition in file haplo_groups.h.
enum Haplo_ancestor_type |
Type of ancestry relating two haplo groups.
Definition at line 60 of file haplo_groups.h.
Error* read_haplo_groups | ( | const char * | fname | ) |
Reads the haplo groups from a file.
The file is expected to be a valid xml document according to haplo.dtd.
fname | File to read the haplo groups from. |
Definition at line 324 of file haplo_groups.c.
Error* lookup_haplo_group_index_from_label | ( | uint32_t * | index_out, |
const char * | label | ||
) |
Looks up the index for a haplo group based on its label.
index_out | Result parameter. |
label | Haplo group label to look-up the sequential index for. |
Definition at line 384 of file haplo_groups.c.
Error* lookup_haplo_group_label_from_index | ( | const char ** | label_out, |
uint32_t | index | ||
) |
Looks up a haplo group label from its index.
label_out | Result parameter. |
index | Index representing one of the haplo groups. |
Definition at line 414 of file haplo_groups.c.
Error* lookup_haplo_group_ancestor_index_from_haplo_group_index | ( | uint32_t * | index_out, |
uint32_t | index | ||
) |
Looks up the index of the immediate ancestor for the haplogroup specified by the index.
Definition at line 440 of file haplo_groups.c.
uint32_t get_num_haplo_groups | ( | ) |
Returns the number of haplo groups represented.
Definition at line 484 of file haplo_groups.c.
uint8_t is_ancestor | ( | uint32_t | index_1, |
uint32_t | index_2 | ||
) |
Returns whether a haplo group label is an ancestor of another.
index_1 | Index whose ancestors are to be searched. |
index_2 | Index to test if it is an ancestor of index_1. |
Definition at line 594 of file haplo_groups.c.
Haplo_ancestor_type find_ancestor_index_of_pair | ( | uint32_t * | index_out, |
uint32_t | index_1, | ||
uint32_t | index_2 | ||
) |
Finds the lowest common ancestor between two haplo group labels.
index_out | Result parameter. |
index_1 | Index of haplo label to find the common ancestor of. |
index_2 | Index of haplo label to find the common ancestor of. |
Definition at line 608 of file haplo_groups.c.
Haplo_ancestor_type find_ancestor_index_of_set | ( | uint32_t * | index_out, |
const Vector_u32 * | indices | ||
) |
Finds the lowest common ancestor between a set of haplo group labels.
index_out | Result parameter. |
indices | Set of indices to find the common ancestor of. |
Definition at line 639 of file haplo_groups.c.