示例#1
0
文件: reroot.c 项目: gatoravi/MFAST
void try_ingroup(struct rooted_tree *tree, struct parameters params)
{
	/* we will try to insert the root above the ingroup - for this we'll
	 * need all leaves that are NOT in the outgroup. */
	// TODO: why just leaves?
	struct llist *ingroup_leaves;
	ingroup_leaves = get_ingroup_leaves(tree, params.labels);
	enum reroot_status result = reroot(tree, ingroup_leaves);
	switch (result) {
		case REROOT_OK:
			dump_newick(tree->root);
			break;
		case LCA_IS_TREE_ROOT:
			fprintf (stderr, "LCA is still tree's root "
				"- be sure to include ALL outgroup "
				"leaves with -l");
			break;
	}
	destroy_llist(ingroup_leaves);
}
示例#2
0
void try_ingroup(struct rooted_tree *tree, struct parameters params)
{
	/* we will try to insert the root above the ingroup - for this we'll
	 * need all leaves that are NOT in the outgroup. We don't need the
	 * inner nodes, though, since tha leaves are sufficient for determining
	 * the ingroup's LCA. This also works if some leaf labels are empty
	 * (see test case 'nolbl_ingrp' in test_nw_reroot_args) */
	struct llist *ingroup_leaves;
	ingroup_leaves = get_ingroup_leaves(tree, params.labels);
	enum reroot_status result = reroot(tree, ingroup_leaves,
			params.i_node_lbl_as_support);
	switch (result) {
		case REROOT_OK:
			dump_newick(tree->root);
			break;
		case LCA_IS_TREE_ROOT:
			fprintf (stderr, "LCA is still tree's root "
				"- be sure to include ALL outgroup "
				"leaves with -l");
			break;
	}
	destroy_llist(ingroup_leaves);
}