diff options
author | Nicholas Noll <nbnoll@eml.cc> | 2020-05-03 20:20:22 -0700 |
---|---|---|
committer | Nicholas Noll <nbnoll@eml.cc> | 2020-05-03 20:20:22 -0700 |
commit | 4b2ea2ca00eea7feea036b7642c0c1443b8f77a1 (patch) | |
tree | 5cdd635bd8240a6857258a056e3932e00966bfff /include/libbio.h | |
parent | 6b739739968a0cc9b4d9909d8f4ffec30f4461dd (diff) |
removed buggy qsort header and implemented myself
Diffstat (limited to 'include/libbio.h')
-rw-r--r-- | include/libbio.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/libbio.h b/include/libbio.h index 9eebb0b..f802e22 100644 --- a/include/libbio.h +++ b/include/libbio.h @@ -25,14 +25,24 @@ typedef struct bio·Tree void *h; } bio·Tree; -// clade functions +/* clade manipulation */ error phylo·addchild(bio·Node* parent, bio·Node* child); error phylo·rmchild(bio·Node* parent, bio·Node* child); +/* clade statistics */ error phylo·countnodes(bio·Node *node, int *n); error phylo·countleafs(bio·Node *node, int *n); -error phylo·ladderize(bio·Node *root); +/* topological sorting */ +error phylo·ladderize(bio·Node *root); +double phylo·diameter(bio·Tree tree, int *len, bio·Node **path); + +/* generic computation on tree */ +void *phylo·postorder(bio·Node *clade, void *(*op)(bio·Node*, void*), void *ctx); +void *phylo·preorder(bio·Node *clade, void *(*op)(bio·Node*, void*), void *ctx); + +/* simple helpers */ +void phylo·getleafs(bio·Tree tree, bio·Node **leafs); /* newick i/o */ error bio·readnewick(io·Peeker stream, void*, bio·Tree* tree); @@ -66,7 +76,7 @@ enum { aln·K = 20, // kmer size (k <= 32) aln·L = 3, // number of kmers / hash - aln·N = 1000, // number of hashes + aln·N = 10, // number of hashes }; error aln·sketch(byte *seq, int l, uint64 *phi[aln·N], int *locs[aln·N]); |