You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added "?" to the output file to indicate when we were unable to test a clan in a tree. Up until now, this would have been a "1" as it did not violate the CLan, however this change may be more useful to users as (for instnace) it will allow to identify where trees were not tested by any Clan.
Also fixed a bug, where for a very small clade a Clan may be passed when in fact it violates it.
@@ -236,15 +236,15 @@ int main (int argc, char *argv[])
236
236
}
237
237
238
238
}
239
-
/* printf("number of taxa in tree are %d\n", numtaxa); */
239
+
/*printf("number of taxa in tree are %d\n", numtaxa); */
240
240
/* for(i=0; i<numtaxa; i++) printf("taxa %d = >%s<\n", i, taxa[i]);*/
241
241
242
242
/* go through all the clades from the clades file */
243
243
string[0]='\0';
244
244
fprintf(outfile, "\t%d", numtaxa);
245
245
for(n=0; n<numclades; n++)
246
246
{
247
-
/*printf("n=%d\n", n);*/
247
+
/*printf("Checking Clade %d\n", n);*/
248
248
/* identify the taxa from this clade that are actually in the tree */
249
249
strcpy(string, clades[n]);
250
250
numintree=0;
@@ -266,114 +266,129 @@ int main (int argc, char *argv[])
266
266
token=strtok(NULL, " ");
267
267
} /* clanlist now contains a list of all the taxa that are in both the clade and the tree */
268
268
foundclade=TRUE;
269
-
if(numintree>1&& (numtaxa-numintree) >1) /* there is no point in looking for clades of taxa if only onw (or none) of them are in the tree */
269
+
if(numintree>1) /* there is no point in looking for clades of taxa if only onw (or none) of them are in the tree */
270
270
{
271
-
foundclade=FALSE;
272
-
/* Extract all the clans from the tree */
273
-
i=0;
274
-
while(tree[i] !=';'&& !foundclade)
275
-
{
276
-
if( tree[i] =='('&&i!=0)
271
+
if((numtaxa-numintree) >1) /* If the tree is ONLY made up of taxa from the clan, then by default the clan is there and we don;t need tot test any further */
/* Check to see if the taxa outside the constraint are the same as in the clade */
358
-
/*printf("checking outside\n");*/
359
-
foundclade= TRUE; /* this is because if k=0, then none of the clade taxa were in the constaint, and if the number of remaining taxa in the tree == number of taxa in clade, then they must be all the taxa we are looking for */
/* Check to see if the taxa outside the constraint are the same as in the clade */
361
+
/* printf("checking outside\n"); */
362
+
foundclade= TRUE; /* this is because if k=0, then none of the clade taxa were in the constaint, and if the number of remaining taxa in the tree == number of taxa in clade, then they must be all the taxa we are looking for */
363
+
}
364
+
365
+
366
+
}
367
+
i++;
363
368
}
364
-
i++;
369
+
370
+
if(foundclade)
371
+
{
372
+
fprintf(outfile, "\t1");
373
+
/*printf("found %s\n", clades[n]);*/
374
+
}
375
+
else
376
+
{
377
+
fprintf(outfile, "\t0");
378
+
/*printf("did not find %s\n", clades[n]);*/
379
+
}
380
+
}
381
+
else
382
+
{
383
+
fprintf(outfile, "\t1");
384
+
/* The tree is entirely made up of taxa from the lcan being tested, so be default it passes. */
365
385
}
366
-
}
367
-
if(foundclade)
368
-
{
369
-
fprintf(outfile, "\t1");
370
-
/*printf("found %s\n", clades[n]);*/
371
-
}
372
-
else
373
-
{
374
-
fprintf(outfile, "\t0");
375
-
/*printf("did not find %s\n", clades[n]);*/
376
386
}
387
+
else/* we did not find enough taxa in to test this Clan */
0 commit comments