Legofit
infers population history from nucleotide site patterns.
|
#include "gene.h"
#include "misc.h"
#include "binary.h"
#include <string.h>
#include <stdlib.h>
Functions | |
Gene * | Gene_new (tipId_t tipId) |
Constructor for Gene. More... | |
void | Gene_tabulate (Gene *self, BranchTab *bt, int doSing) |
Tabulate branch lengths by tipId. More... | |
Gene * | Gene_join (Gene *lchild, Gene *rchild) |
Create a parental Gene by coalescing two children. More... | |
void | Gene_free (Gene *gene) |
Destroy a Gene. | |
Class Gene.
Defines the objects that are linked together to form a gene genealogy.
Create a parental Gene by coalescing two children.
The tipId of the parental gene is generated by "or"ing those of the two children. The parental gene has pointers to the children, and the children have pointers to the parent.
References Gene_new().
Gene * Gene_new | ( | tipId_t | tipId | ) |
Constructor for Gene.
[in] | tipId | the identifier of this gene |
Referenced by Gene_join(), and PopNode_newSample().
Tabulate branch lengths by tipId.
Ignore root (which has null parent) because mutations there don't contribute to genetic variation.
If doSing==0, then also ignore nodes with only one descendant. These are recognizable because their tipIds are powers of 2.
Tabulate everything else.
References BranchTab_add(), and Gene_tabulate().
Referenced by Gene_tabulate().