From ae354b9ede3bdf4059de8086494bc58b3cd62897 Mon Sep 17 00:00:00 2001 From: Benjamin Hillmann Date: Thu, 22 Jun 2017 14:13:16 -0500 Subject: [PATCH 1/3] All the kings horses and all the kings men --- itree.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/itree.c b/itree.c index 2c31b05..cebc6eb 100644 --- a/itree.c +++ b/itree.c @@ -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 + 2,"p__;"), ixP += 5; if (numP == 2) - ++numP, strcpy(buffer + ixP + 2,"c__; "), ixP += 5; + ++numP, strcpy(buffer + ixP + 2,"c__;"), ixP += 5; if (numP == 3) - ++numP, strcpy(buffer + ixP + 2,"o__; "), ixP += 5; + ++numP, strcpy(buffer + ixP + 2,"o__;"), ixP += 5; if (numP == 4) - ++numP, strcpy(buffer + ixP + 2,"f__; "), ixP += 5; + ++numP, strcpy(buffer + ixP + 2,"f__;"), ixP += 5; 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 + 2,"g__;"), ixP += 5; + if (numP == 6) + ++numP, strcpy(buffer + ixP + 2,"s__;"), ixP += 5; + if (numP == 7) // species diverged + strcpy(buffer + ixP + 2,"t__"); //printf("--> Interpolated: %s\n",buffer); IXTYPE new_ix = addSampleUd(ut,buffer); @@ -1454,7 +1456,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 From 30c537f91171cf7dc96ffd1dac6ce2ea6dee1785 Mon Sep 17 00:00:00 2001 From: Gabriel Al-Ghalith Date: Fri, 30 Jun 2017 15:33:49 -0500 Subject: [PATCH 2/3] fixed spaceless taxstring interpolation but not tested so not sure if fixed --- itree.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/itree.c b/itree.c index cebc6eb..34deb35 100644 --- a/itree.c +++ b/itree.c @@ -296,21 +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 = 1; 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) - ++numP, strcpy(buffer + ixP + 2,"s__;"), ixP += 5; - if (numP == 7) // species diverged - strcpy(buffer + ixP + 2,"t__"); + ++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); From d9ca7bffb20d6ce980d84f54469164dc51efbcd7 Mon Sep 17 00:00:00 2001 From: Gabriel Al-Ghalith Date: Fri, 30 Jun 2017 15:39:48 -0500 Subject: [PATCH 3/3] also mirror the changes in the taxa tree update the umbrella (ctr parapluie) function needed some rain --- itree.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/itree.c b/itree.c index 34deb35..1561a26 100644 --- a/itree.c +++ b/itree.c @@ -296,7 +296,7 @@ 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 = 1; + ++numP, strcpy(buffer,"k__;"), ixP = 2; if (numP == 1) ++numP, strcpy(buffer + ixP + 1,"p__;"), ixP += 4; if (numP == 2) @@ -393,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; \