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
This commit is contained in:
2010-12-13 17:09:54 +00:00
parent ca1e9d8899
commit 5d8103f4b4
2 changed files with 17 additions and 4 deletions

View File

@ -76,6 +76,7 @@ static void PrintHelp()
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 "-p : Print sets of primers\n\n");
PP "-T : Ignore pairs having specificity below this Threshold\n\n");
PP "\n");
PP "------------------------------------------\n");
PP "Table result description : \n");
@ -149,6 +150,7 @@ void initoptions(poptions_t options)
options->salt = DEF_SALT;
options->printAC=FALSE;
options->print_sets_of_primers = FALSE;
options->specificity_threshold = 0.6;
}
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
sortedpairs[j]->wellIdentifiedSeqs = ECOMALLOC(options->dbsize * sizeof(int),"Cannot allocate well_identified_array");
(void)taxonomycoverage(sortedpairs[j],options);
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++;
}
}
@ -443,6 +449,7 @@ void printpairs (ppairtree_t pairs, poptions_t options,ecotaxonomy_t *taxonomy,
printf("# DB sequences are considered as circular\n");
else
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");
for (i=0;i < count;i++)
@ -538,7 +545,7 @@ int main(int argc, char **argv)
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) {
/* ---------------------------- */
@ -707,6 +714,12 @@ int main(int argc, char **argv)
options.print_sets_of_primers = TRUE;
break;
/* --------------------------------- */
case 'T': /* Ignore pairs having specificity below this Threshold */
/* --------------------------------- */
sscanf(optarg,"%f",&(options.specificity_threshold));
break;
case '?': /* bad option */
/* -------------------- */
errflag++;
@ -717,7 +730,6 @@ int main(int argc, char **argv)
if (options.saltmethod != 2) //if not SALT_METHOD_OWCZARZY
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
options.salt = DEF_SALT; //set to default

View File

@ -290,6 +290,7 @@ typedef struct {
float salt;
PNNParams pnparm;
bool_t print_sets_of_primers;
float specificity_threshold;
} options_t, *poptions_t;
typedef ecoseq_t **pecodnadb_t;