diff --git a/src/ecoprimer.c b/src/ecoprimer.c index c55dda3..4f1724d 100644 --- a/src/ecoprimer.c +++ b/src/ecoprimer.c @@ -125,6 +125,7 @@ void initoptions(poptions_t options) options->primer_length=18; //**< minimal length of the primers options->restricted_taxid=NULL; //**< limit amplification below these taxid options->ignored_taxid=NULL; //**< no amplification below these taxid + options->exception_taxid=NULL; //**< no amplification below these taxid options->prefix=NULL; options->reference=NULL; options->refseq=NULL; @@ -137,6 +138,7 @@ void initoptions(poptions_t options) options->strict_three_prime=0; options->r=0; options->g=0; + options->e=0; options->no_multi_match=FALSE; options->pnparm = NULL; strcpy(options->taxonrank, DEFAULTTAXONRANK); /*taxon level for results, species by default*/ @@ -525,7 +527,7 @@ int main(int argc, char **argv) initoptions(&options); - while ((carg = getopt(argc, argv, "hAfvcUDSd:l:L:e:i:r:R:q:3:s:x:t:O:m:a:")) != -1) { + while ((carg = getopt(argc, argv, "hAfvcUDSE:d:l:L:e:i:r:R:q:3:s:x:t:O:m:a:")) != -1) { switch (carg) { /* ---------------------------- */ @@ -638,6 +640,15 @@ int main(int argc, char **argv) options.r++; break; + /* ------------------------------------------ */ + case 'E': /* stores the restricting search taxonomic id */ + /* ------------------------------------------ */ + options.exception_taxid = ECOREALLOC(options.exception_taxid,sizeof(int32_t)*(options.e+1), + "Error on exception_taxid reallocation"); + sscanf(optarg,"%d",&(options.exception_taxid[options.e])); + options.e++; + break; + /* -------------------- */ case 'R': /* reference sequence */ /* -------------------- */ diff --git a/src/libecoprimer/ecoprimer.h b/src/libecoprimer/ecoprimer.h index 195ae57..0a9989a 100644 --- a/src/libecoprimer/ecoprimer.h +++ b/src/libecoprimer/ecoprimer.h @@ -256,6 +256,7 @@ typedef struct { uint32_t primer_length; //**< minimal length of the primers int32_t *restricted_taxid; //**< limit amplification below these taxid int32_t *ignored_taxid; //**< no amplification below these taxid + int32_t *exception_taxid; char *prefix; char *reference; pecoseq_t refseq; @@ -269,6 +270,7 @@ typedef struct { uint32_t strict_three_prime; int32_t r; //**< count of restrited taxa (restricted_taxid array size) int32_t g; //**< count of ignored taxa (ignored_taxid array size) + int32_t e; //**< count of ignored taxa (ignored_taxid array size) bool_t no_multi_match; char taxonrank[20]; //TR to count ranks against a pair int32_t taxonrankidx; //TR to count ranks against a pair diff --git a/src/libecoprimer/goodtaxon.c b/src/libecoprimer/goodtaxon.c index 09b47ce..898b533 100644 --- a/src/libecoprimer/goodtaxon.c +++ b/src/libecoprimer/goodtaxon.c @@ -17,9 +17,9 @@ int isGoodTaxon(ecotaxonomy_t *taxonomy,int32_t taxon,poptions_t options) options->r, taxonomy->taxons->taxon[taxon].taxid) )) && - ((options->g == 0) || !(eco_is_taxid_included(taxonomy, - options->ignored_taxid, - options->g, + ((options->e == 0) || !(eco_is_taxid_included(taxonomy, + options->exception_taxid, + options->e, taxonomy->taxons->taxon[taxon].taxid) ));