Files
ecopcr/src/ecoisundertaxon.c

37 lines
857 B
C

#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_1);
if (eco_isundertaxon(son, taxid_2))
printf("taxid_1 (%d) is son of taxid_2 (%d)\n",taxid_1, taxid_2);
else
printf("taxid_1 (%d) is NOT son of taxid_2 (%d)\n",taxid_1, taxid_2);
return 0;
}