This commit is contained in:
2007-06-04 15:33:49 +00:00
parent 4fd532e05c
commit 5094a9a9ce

41
src/ecoisundertaxon.c Normal file
View File

@ -0,0 +1,41 @@
#include "libecoPCR/ecoPCR.h"
#include <string.h>
#include <stdlib.h>
#include <getopt.h>
#include <stdio.h>
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;
}