From 38030f22985742dd810f14e6c313f7e9aff92e23 Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Tue, 5 Jun 2007 13:38:21 +0000 Subject: [PATCH] git-svn-id: https://www.grenoble.prabi.fr/svn/LECASofts/ecoPCR/branches/refactoring@33 60f365c0-8329-0410-b2a4-ec073aeeaa1d --- src/libecoPCR/ecofilter.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/libecoPCR/ecofilter.c diff --git a/src/libecoPCR/ecofilter.c b/src/libecoPCR/ecofilter.c new file mode 100644 index 0000000..d2a547f --- /dev/null +++ b/src/libecoPCR/ecofilter.c @@ -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; +} \ No newline at end of file