with full coverage statistic
git-svn-id: https://www.grenoble.prabi.fr/svn/LECASofts/ecoPrimers/branches/eric-test@189 60f365c0-8329-0410-b2a4-ec073aeeaa1d
This commit is contained in:
@ -106,13 +106,20 @@ void printapair(int32_t index,ppair_t pair, poptions_t options)
|
|||||||
else
|
else
|
||||||
printf("%s",ecoUnhashWord(pair->p2->word,options->primer_length));
|
printf("%s",ecoUnhashWord(pair->p2->word,options->primer_length));
|
||||||
|
|
||||||
|
printf("\t%c%c", "bG"[(int)pair->p1->good],"bG"[(int)pair->p2->good]);
|
||||||
|
|
||||||
|
|
||||||
printf("\t%d", pair->inexample);
|
printf("\t%d", pair->inexample);
|
||||||
printf("\t%d", pair->outexample);
|
printf("\t%d", pair->outexample);
|
||||||
|
printf("\t%4.3f", pair->yule);
|
||||||
|
|
||||||
|
printf("\t%d", pair->intaxa);
|
||||||
|
printf("\t%d", pair->outtaxa);
|
||||||
|
printf("\t%4.3f", (float)pair->intaxa/options->intaxa);
|
||||||
|
|
||||||
printf("\t%d", pair->mind);
|
printf("\t%d", pair->mind);
|
||||||
printf("\t%d", pair->maxd);
|
printf("\t%d", pair->maxd);
|
||||||
printf("\t%3.2f\t", (float)pair->sumd/pair->inexample);
|
printf("\t%3.2f\n", (float)pair->sumd/pair->inexample);
|
||||||
printf("\t%4.3f\n", pair->yule);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,8 +150,11 @@ uint32_t filterandsortpairs(ppair_t* sortedpairs,uint32_t count, poptions_t opti
|
|||||||
|
|
||||||
if (q > options->sensitivity_quorum &&
|
if (q > options->sensitivity_quorum &&
|
||||||
qfp < options->false_positive_quorum)
|
qfp < options->false_positive_quorum)
|
||||||
|
{
|
||||||
|
(void)taxonomycoverage(sortedpairs[j],options);
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return j;
|
return j;
|
||||||
}
|
}
|
||||||
@ -154,7 +164,7 @@ void printpairs (ppairtree_t pairs, poptions_t options)
|
|||||||
ppair_t* sortedpairs;
|
ppair_t* sortedpairs;
|
||||||
ppair_t* index;
|
ppair_t* index;
|
||||||
ppairlist_t pl;
|
ppairlist_t pl;
|
||||||
int32_t i,j;
|
size_t i,j;
|
||||||
int32_t count;
|
int32_t count;
|
||||||
|
|
||||||
fprintf(stderr,"Total pair count : %d\n",pairs->count);
|
fprintf(stderr,"Total pair count : %d\n",pairs->count);
|
||||||
@ -264,45 +274,6 @@ void setresulttaxonrank (ecotaxonomy_t *taxonomy, poptions_t options)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* to get db stats, totals of species, genus etc....*/
|
/* to get db stats, totals of species, genus etc....*/
|
||||||
int32_t getrankdbstats(pecodnadb_t seqdb, uint32_t seqdbsize, ecotaxonomy_t *taxonomy,
|
|
||||||
poptions_t options)
|
|
||||||
{
|
|
||||||
uint32_t i;
|
|
||||||
uint32_t j;
|
|
||||||
uint32_t nameslots = 500;
|
|
||||||
uint32_t namesindex = 0;
|
|
||||||
int32_t *ranktaxonids = ECOMALLOC(nameslots * sizeof(int32_t), "Error in taxon rank allocation");
|
|
||||||
int32_t taxid;
|
|
||||||
|
|
||||||
ecotx_t *tmptaxon;
|
|
||||||
|
|
||||||
for (i=0;i<seqdbsize;i++)
|
|
||||||
{
|
|
||||||
taxid = taxonomy->taxons->taxon[seqdb[i]->taxid].taxid;
|
|
||||||
tmptaxon = eco_findtaxonbytaxid(taxonomy, taxid);
|
|
||||||
if (tmptaxon)
|
|
||||||
tmptaxon = eco_findtaxonatrank(tmptaxon, options->taxonrankidx);
|
|
||||||
if (tmptaxon)
|
|
||||||
{
|
|
||||||
for (j = 0; j < namesindex; j++)
|
|
||||||
{
|
|
||||||
if (tmptaxon->taxid == ranktaxonids[j]) break;
|
|
||||||
}
|
|
||||||
if (j < namesindex) continue; /* name is already in list, so no need to add it*/
|
|
||||||
|
|
||||||
if (namesindex == nameslots)
|
|
||||||
{
|
|
||||||
nameslots += 500;
|
|
||||||
ranktaxonids = ECOREALLOC(ranktaxonids, nameslots * sizeof(int32_t), "Cannot allocate pair rank taxon table");
|
|
||||||
}
|
|
||||||
ranktaxonids[namesindex] = tmptaxon->taxid;
|
|
||||||
namesindex++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ECOFREE(ranktaxonids, "free rank taxon table");
|
|
||||||
|
|
||||||
return namesindex;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef MASKEDCODE
|
#ifdef MASKEDCODE
|
||||||
|
|
||||||
@ -513,8 +484,10 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
rankdbstats = getrankdbstats(seqdb, seqdbsize, taxonomy, &options);
|
rankdbstats = getrankdbstats(seqdb, seqdbsize, taxonomy, &options);
|
||||||
|
|
||||||
fprintf(stderr,"Database is constituted of %5d examples\n",insamples);
|
fprintf(stderr,"Database is constituted of %5d examples corresponding to %5d %s\n",insamples,
|
||||||
fprintf(stderr," and %5d counterexamples\n",outsamples);
|
options.intaxa,options.taxonrank);
|
||||||
|
fprintf(stderr," and %5d counterexamples corresponding to %5d %s\n",outsamples,
|
||||||
|
options.outtaxa,options.taxonrank);
|
||||||
fprintf(stderr,"Total distinct %s count %d\n",options.taxonrank, rankdbstats);
|
fprintf(stderr,"Total distinct %s count %d\n",options.taxonrank, rankdbstats);
|
||||||
|
|
||||||
fprintf(stderr,"\nIndexing words in sequences\n");
|
fprintf(stderr,"\nIndexing words in sequences\n");
|
||||||
|
Reference in New Issue
Block a user