From 5094a9a9ce41ba5acd79b6552b3acfaf198bd1e2 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Mon, 4 Jun 2007 15:33:49 +0000 Subject: [PATCH] git-svn-id: https://www.grenoble.prabi.fr/svn/LECASofts/ecoPCR/branches/refactoring@26 60f365c0-8329-0410-b2a4-ec073aeeaa1d --- src/ecoisundertaxon.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/ecoisundertaxon.c diff --git a/src/ecoisundertaxon.c b/src/ecoisundertaxon.c new file mode 100644 index 0000000..f850efc --- /dev/null +++ b/src/ecoisundertaxon.c @@ -0,0 +1,41 @@ +#include "libecoPCR/ecoPCR.h" +#include +#include +#include +#include + + +int main(int argc, char **argv){ + int32_t carg = 0; + int32_t taxid_1 = 0; + int32_t taxid_2 = 0; + ecotaxonomy_t *taxonomy = NULL; + ecotx_t *son = NULL; + + while ((carg = getopt(argc, argv, "1:2:")) != -1) { + switch (carg) { + case '1': + sscanf(optarg,"%d",&taxid_1); + break; + + case '2': + sscanf(optarg,"%d",&taxid_2); + break; + } + } + + taxonomy = read_taxonomy(argv[optind]); + + son = eco_findtaxonbytaxid(taxonomy, taxid_2); + + //printf("# %s\n",son->parent->name); + + /* + if (eco_isundertaxon(son, tax_id_2)) + printf("tax_id_1 is son of tax_id_2"); + else + printf("tax_id_1 is NOT son of tax_id_2"); + */ + + return 0; +} \ No newline at end of file