Commit 2737cf06 by Eric Coissac

Add a new option -E to considere some example sequences as counterexamples

git-svn-id: https://www.grenoble.prabi.fr/svn/LECASofts/ecoPrimers/trunk@235 60f365c0-8329-0410-b2a4-ec073aeeaa1d
parent 6f5f2a16
......@@ -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 */
/* -------------------- */
......
......@@ -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
......
......@@ -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)
));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment