Added code for building sets of primers and -p command line option

git-svn-id: https://www.grenoble.prabi.fr/svn/LECASofts/ecoPrimers/trunk@279 60f365c0-8329-0410-b2a4-ec073aeeaa1d
This commit is contained in:
2010-09-13 09:44:53 +00:00
parent e483b17e18
commit dd08d73dda
6 changed files with 495 additions and 18 deletions

View File

@ -179,9 +179,16 @@ void twalkaction (const void *node, VISIT order, int level)
counttaxon(taxid);
}
void taxonomyspecificity (ppair_t pair)
int32_t gtxid;
void twalkaction2 (const void *node, VISIT order, int level)
{
uint32_t i;
int32_t *pt = (int32_t *) node;
gtxid = *pt;
}
void taxonomyspecificity (ppair_t pair, pecodnadb_t seqdb,uint32_t seqdbsize)
{
uint32_t i, j;
uint32_t ampfindex = 0;
int32_t taxid;
void *ampftree = NULL;
@ -219,11 +226,31 @@ void taxonomyspecificity (ppair_t pair)
}
}
memset (pair->wellIdentifiedSeqs, 0, seqdbsize*sizeof (int));
counttaxon(-1);
for (i = 0; i < ampfindex; i++)
{
if (ampfwithtaxtree[i].taxoncount > 1)
twalk(ampfwithtaxtree[i].taxontree, twalkaction);
//TR 5/9/10 - added code for well identified seqs
else if(ampfwithtaxtree[i].taxoncount == 1) /*well identified*/
{
gtxid = -1;
twalk(ampfwithtaxtree[i].taxontree, twalkaction2);
if (gtxid != -1)
{
for (j = 0; j < seqdbsize; j++)
if (seqdb[j]->ranktaxonid == gtxid
&&(pair->p1->directCount[j] > 0
|| pair->p1->reverseCount[j] > 0)
&& (pair->p2->directCount[j] > 0
|| pair->p2->reverseCount[j] > 0))
{
pair->wellIdentifiedSeqs[j] = 1;
}
}
}
}
pair->notwellidentifiedtaxa = counttaxon(-2);