Commit 5d8103f4 by Eric Coissac

added check for filtering pairs having specificity below a given threshold given using -T option

git-svn-id: https://www.grenoble.prabi.fr/svn/LECASofts/ecoPrimers/trunk@288 60f365c0-8329-0410-b2a4-ec073aeeaa1d
parent ca1e9d88
...@@ -76,6 +76,7 @@ static void PrintHelp() ...@@ -76,6 +76,7 @@ static void PrintHelp()
PP "-f : Remove data mining step during strict primer identification\n\n"); PP "-f : Remove data mining step during strict primer identification\n\n");
PP "-v : Store statistic file about memory usage during strict primer identification\n\n"); PP "-v : Store statistic file about memory usage during strict primer identification\n\n");
PP "-p : Print sets of primers\n\n"); PP "-p : Print sets of primers\n\n");
PP "-T : Ignore pairs having specificity below this Threshold\n\n");
PP "\n"); PP "\n");
PP "------------------------------------------\n"); PP "------------------------------------------\n");
PP "Table result description : \n"); PP "Table result description : \n");
...@@ -149,6 +150,7 @@ void initoptions(poptions_t options) ...@@ -149,6 +150,7 @@ void initoptions(poptions_t options)
options->salt = DEF_SALT; options->salt = DEF_SALT;
options->printAC=FALSE; options->printAC=FALSE;
options->print_sets_of_primers = FALSE; options->print_sets_of_primers = FALSE;
options->specificity_threshold = 0.6;
} }
void printapair(int32_t index,ppair_t pair, poptions_t options) void printapair(int32_t index,ppair_t pair, poptions_t options)
...@@ -345,7 +347,11 @@ uint32_t filterandsortpairs(ppair_t* sortedpairs,uint32_t count, poptions_t opti ...@@ -345,7 +347,11 @@ uint32_t filterandsortpairs(ppair_t* sortedpairs,uint32_t count, poptions_t opti
sortedpairs[j]->wellIdentifiedSeqs = ECOMALLOC(options->dbsize * sizeof(int),"Cannot allocate well_identified_array"); sortedpairs[j]->wellIdentifiedSeqs = ECOMALLOC(options->dbsize * sizeof(int),"Cannot allocate well_identified_array");
(void)taxonomycoverage(sortedpairs[j],options); (void)taxonomycoverage(sortedpairs[j],options);
taxonomyspecificity(sortedpairs[j], seqdb, options->dbsize); taxonomyspecificity(sortedpairs[j], seqdb, options->dbsize);
//j++;
//if specificity less than user provieded threshold (default 60%) then ignore this pair
if (sortedpairs[j]->bs >= options->specificity_threshold)
j++; j++;
} }
} }
...@@ -443,6 +449,7 @@ void printpairs (ppairtree_t pairs, poptions_t options,ecotaxonomy_t *taxonomy, ...@@ -443,6 +449,7 @@ void printpairs (ppairtree_t pairs, poptions_t options,ecotaxonomy_t *taxonomy,
printf("# DB sequences are considered as circular\n"); printf("# DB sequences are considered as circular\n");
else else
printf("# DB sequences are considered as linear\n"); printf("# DB sequences are considered as linear\n");
printf("# Pairs having specificity less than %0.2f will be ignored\n", options->specificity_threshold);
printf("#\n"); printf("#\n");
for (i=0;i < count;i++) for (i=0;i < count;i++)
...@@ -538,7 +545,7 @@ int main(int argc, char **argv) ...@@ -538,7 +545,7 @@ int main(int argc, char **argv)
initoptions(&options); initoptions(&options);
while ((carg = getopt(argc, argv, "hAfvcUDSpE:d:l:L:e:i:r:R:q:3:s:x:t:O:m:a:")) != -1) { while ((carg = getopt(argc, argv, "hAfvcUDSpE:d:l:L:e:i:r:R:q:3:s:x:t:O:m:a:T:")) != -1) {
switch (carg) { switch (carg) {
/* ---------------------------- */ /* ---------------------------- */
...@@ -707,6 +714,12 @@ int main(int argc, char **argv) ...@@ -707,6 +714,12 @@ int main(int argc, char **argv)
options.print_sets_of_primers = TRUE; options.print_sets_of_primers = TRUE;
break; break;
/* --------------------------------- */
case 'T': /* Ignore pairs having specificity below this Threshold */
/* --------------------------------- */
sscanf(optarg,"%f",&(options.specificity_threshold));
break;
case '?': /* bad option */ case '?': /* bad option */
/* -------------------- */ /* -------------------- */
errflag++; errflag++;
...@@ -717,7 +730,6 @@ int main(int argc, char **argv) ...@@ -717,7 +730,6 @@ int main(int argc, char **argv)
if (options.saltmethod != 2) //if not SALT_METHOD_OWCZARZY if (options.saltmethod != 2) //if not SALT_METHOD_OWCZARZY
options.saltmethod = SALT_METHOD_SANTALUCIA; //then force SALT_METHOD_SANTALUCIA options.saltmethod = SALT_METHOD_SANTALUCIA; //then force SALT_METHOD_SANTALUCIA
if (options.salt < 0.01 || options.salt > 0.3) //if salt value out of literature values if (options.salt < 0.01 || options.salt > 0.3) //if salt value out of literature values
options.salt = DEF_SALT; //set to default options.salt = DEF_SALT; //set to default
......
...@@ -290,6 +290,7 @@ typedef struct { ...@@ -290,6 +290,7 @@ typedef struct {
float salt; float salt;
PNNParams pnparm; PNNParams pnparm;
bool_t print_sets_of_primers; bool_t print_sets_of_primers;
float specificity_threshold;
} options_t, *poptions_t; } options_t, *poptions_t;
typedef ecoseq_t **pecodnadb_t; typedef ecoseq_t **pecodnadb_t;
......
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