From 4b2ea2ca00eea7feea036b7642c0c1443b8f77a1 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Sun, 3 May 2020 20:20:22 -0700 Subject: removed buggy qsort header and implemented myself --- include/libbio.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'include/libbio.h') 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]); -- cgit v1.2.1