This commit is contained in:
2007-06-05 13:38:21 +00:00
parent 1a768aa97e
commit 38030f2298

32
src/libecoPCR/ecofilter.c Normal file
View File

@ -0,0 +1,32 @@
#include "ecoPCR.h"
int eco_is_taxid_ignored( int *ignored_taxid,
int tab_len,
int taxid)
{
int i;
for (i=0; i < tab_len; i++){
if(taxid == ignored_taxid[i])
return 1;
}
return 0;
}
int eco_is_taxid_included( ecotaxonomy_t *taxonomy,
int *restricted_taxid,
int32_t tab_len,
int32_t taxid)
{
int i;
ecotx_t *taxon;
taxon = eco_findtaxonbytaxid(taxonomy, taxid);
for (i=0; i < tab_len; i++)
if ( (taxon->taxid == restricted_taxid[i]) ||
(eco_isundertaxon(taxon, restricted_taxid[i])) )
return 1;
return 0;
}