aboutsummaryrefslogtreecommitdiff
path: root/include/libbio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libbio.h')
-rw-r--r--include/libbio.h16
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]);