Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All the kings horses and all the kings men #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 20 additions & 16 deletions itree.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,19 +296,21 @@ inline long xeTreeU_GG(KMerY *tree, WTYPE word, IXTYPE ix, UTree *ut) {
//printf("old = %s\nnew = %s\n",oldOrig,ut->SampStrings[ix]);
//printf("--> Conserved num semis = %u, position = %u\n",numP, ixP);
if (numP == 0) // kingdom diverged
++numP, strcpy(buffer,"k__; "), ixP = 2;
++numP, strcpy(buffer,"k__;"), ixP = 2;
if (numP == 1)
++numP, strcpy(buffer + ixP + 2,"p__; "), ixP += 5;
++numP, strcpy(buffer + ixP + 1,"p__;"), ixP += 4;
if (numP == 2)
++numP, strcpy(buffer + ixP + 2,"c__; "), ixP += 5;
++numP, strcpy(buffer + ixP + 1,"c__;"), ixP += 4;
if (numP == 3)
++numP, strcpy(buffer + ixP + 2,"o__; "), ixP += 5;
++numP, strcpy(buffer + ixP + 1,"o__;"), ixP += 4;
if (numP == 4)
++numP, strcpy(buffer + ixP + 2,"f__; "), ixP += 5;
++numP, strcpy(buffer + ixP + 1,"f__;"), ixP += 4;
if (numP == 5)
++numP, strcpy(buffer + ixP + 2,"g__; "), ixP += 5;
if (numP == 6) // species diverged
strcpy(buffer + ixP + 2,"s__");
++numP, strcpy(buffer + ixP + 1,"g__;"), ixP += 4;
if (numP == 6)
++numP, strcpy(buffer + ixP + 1,"s__;"), ixP += 4;
if (numP == 7) // strain diverged
strcpy(buffer + ixP + 1,"t__");
//printf("--> Interpolated: %s\n",buffer);
IXTYPE new_ix = addSampleUd(ut,buffer);

Expand Down Expand Up @@ -391,19 +393,21 @@ inline int parapluieU(UTree *ktree, WTYPE wordO, IXTYPE ix) {
strcpy(buffer,oldOrig); \
if (numP < 2) { tree->ix = BAD_IX; return 1; } \
if (numP == 0) \
++numP, strcpy(buffer,"k__; "), ixP = 2; \
++numP, strcpy(buffer,"k__;"), ixP = 2; \
if (numP == 1) \
++numP, strcpy(buffer + ixP + 2,"p__; "), ixP += 5; \
++numP, strcpy(buffer + ixP + 1,"p__;"), ixP += 4; \
if (numP == 2) \
++numP, strcpy(buffer + ixP + 2,"c__; "), ixP += 5; \
++numP, strcpy(buffer + ixP + 1,"c__;"), ixP += 4; \
if (numP == 3) \
++numP, strcpy(buffer + ixP + 2,"o__; "), ixP += 5; \
++numP, strcpy(buffer + ixP + 1,"o__;"), ixP += 4; \
if (numP == 4) \
++numP, strcpy(buffer + ixP + 2,"f__; "), ixP += 5; \
++numP, strcpy(buffer + ixP + 1,"f__;"), ixP += 4; \
if (numP == 5) \
++numP, strcpy(buffer + ixP + 2,"g__; "), ixP += 5; \
++numP, strcpy(buffer + ixP + 1,"g__;"), ixP += 4; \
if (numP == 6) \
strcpy(buffer + ixP + 2,"s__"); \
++numP, strcpy(buffer + ixP + 1,"s__;"), ixP += 4; \
if (numP == 7) \
strcpy(buffer + ixP + 1,"t__"); \
IXTYPE new_ix = addSampleUd(ut,buffer); \
tree->ix = new_ix; \
return 0; \
Expand Down Expand Up @@ -1454,7 +1458,7 @@ int main(int argc, char *argv[]) {
printf("usage: xtree-search%s compTree.ctr fastaToSearch.fa output.txt [RC]",
DO_GG ? "GG" : ""); exit(1); }
UTree *xtr = XT_read32(argv[1], DO_GG ? ';' : 0); //("compTre.ctr");
XT_doSearch32(xtr,argv[2],argv[3], DO_GG ? 7 : 0, argc > 4);
XT_doSearch32(xtr,argv[2],argv[3], DO_GG ? 8 : 0, argc > 4);
exit(0);
#endif
#if defined BUILD || defined BUILD_GG
Expand Down