ExecuteAFile ("../utils.ibf");

SetDialogPrompt 				  ("Existing labels");
DataSet 		ds = ReadDataFile (PROMPT_FOR_FILE);
labels  = LAST_FILE_PATH + ".labels";
ExecuteAFile (labels);
sequenceLabels = _subtypeAssignmentByNode;

Tree exportT = DATAFILE_TREE;

//Tree exportT = "(((V17_121_01_CRF_1:0.0099603,V17_121_02_CRF_1:0.016129)NODE3:0.396304,(V4_92_01_CRF_1:0.117269,(V4_91_01_CRF_1:0.0659018,(V4_90_01_CRF_1:0.0582447,((((V4_81_01_CRF_1:0.0452663,(V4_58_01_CRF_1:0.0237653,V4_51_01_CRF_1:0.0198009)NODE18:0.0272232)NODE16:0.00696719,(V4_50_01_CRF_1:0.068104,(((V4_80_01_CRF_1:0.0484046,V4_57_01_CRF_1:0.0235992)NODE25:0.0147446,((((V4_79_01_CRF_1:0.0147318,V4_78_01_CRF_1:0.0203335)NODE31:0.0107821,((V4_61_01_CRF_1:0.00867409,(V4_77_01_CRF_1:0.00625779,(V4_52_01_CRF_1:0.00289082,V4_54_01_CRF_1:0)NODE39:0.0163056)NODE37:0.00824209)NODE35:0.00375769,V4_74_01_CRF_1:0.0332873)NODE34:0.0115598)NODE30:0.00592754,((V4_69_01_CRF_1:0.0240203,(V4_72_01_CRF_1:0.0261211,V4_68_01_CRF_1:0.0201733)NODE46:0.00378542)NODE44:0.00317176,(V4_71_01_CRF_1:0.0265616,V4_55_01_CRF_1:0.0179473)NODE49:0.00579231)NODE43:0.00359293)NODE29:0.00585086,V4_70_01_CRF_1:0.0276534)NODE28:0)NODE24:0.01172,V4_63_01_CRF_1:0.0521367)NODE23:0.0056232)NODE21:0.0100952)NODE15:0.00797652,V4_86_01_L_CRF_1:0.084474)NODE14:0.0122263,(V4_53_01_CRF_1:0.0118805,V4_60_01_L_CRF_1:0.0155714)NODE55:0.0317006)NODE13:0.0134189)NODE11:0.0283292)NODE9:0.00835997)NODE7:0.198986,(((V7_33_01_L_CRF_1:0.172617,(V8_18_01_CRF_1:0.113552,((V8_34_01_CRF_1:0.0703109,V8_16_01_CRF_1:0.164566)NODE68:0.0310477,(((V8_28_01_CRF_1:0.0123192,V8_28_02_CRF_1:0.0165846)NODE73:0.00802619,V8_19_01_CRF_1:0.00601625)NODE72:0.0382578,((V8_30_01_CRF_1:0.0276253,V8_21_01_CRF_1:0.0434426)NODE78:0.0206793,V8_24_01_CRF_1:0.074878)NODE77:0.00259401)NODE71:0.0165653)NODE67:0)NODE65:0.0423799)NODE61:0.0121329,(((V6_29_01_CRF_1:0.012095,V6_20_01_CRF_1:0.00271474)NODE84:0.0990809,((((V6_23_01_CRF_1:0.029436,V6_15_01_CRF_1:0.0286259)NODE90:0.0124247,BASE_CRF_1:0.0274236)NODE89:0.00869148,V6_14_01_CRF_1:0.0478226)NODE88:0.0230042,(V6_17_01_CRF_1:0.0191387,V6_25_01_CRF_1:0.0260776)NODE95:0.0207581)NODE87:0.0607487)NODE83:0.0381816,(V6_D_01_CRF_1:0.0164005,((V6_32_01_CRF_1:0,V6_32_02_CRF_1:0.00294773)NODE101:0.022018,V6_B_01_CRF_1:0.0137997)NODE100:0.0115749)NODE98:0.0546282)NODE82:0.0737457)NODE60:0.136947,((((((((V1_133_01_L_CRF_1:0.0130693,V1_135_01_L_CRF_1:0.0216235)NODE114:0.0113183,(V1_132_01_CRF_1:0.0279827,V1_131_01_CRF_1:0.0185578)NODE117:0.0284882)NODE113:0.0480716,V1_35_01_CRF_1:0.129754)NODE112:0.0922844,((V1_99_01_CRF_1:0.136615,(V1_122_01_CRF_1:0.039224,(((V1_117_01_L_CRF_1:0.00283663,V1_117_02_CRF_1:0.00284016)NODE128:0.0194031,(V1_110_01_L_CRF_1:0,V1_110_01_CRF_1:0)NODE131:0.00703153)NODE127:0.00841616,V1_110_02_CRF_1:0.0112571)NODE126:0.017416)NODE124:0.0262043)NODE122:0.00206701,V1_88_01_CRF_1:0.110042)NODE121:0.0869131)NODE111:0.0341153,((V2_137_01_CRF_1:0.0364785,(((V2_109_03_CRF_1:0.00836624,(V2_116_01_CRF_1:0.0302773,V2_109_04_CRF_1:0.0657918)NODE143:0)NODE141:0.0106136,(V2_109_02_CRF_1:0.00843787,V2_109_01_CRF_1:0)NODE146:0.00922228)NODE140:0.0641392,V2_A_01_CRF_1:0.0276814)NODE139:0.0216682)NODE137:0.0365311,V2_112_02_CRF_1:0.123959)NODE136:0.100541)NODE110:0.16528,V18_36_01_CRF_1:0.336931)NODE109:0.0239766,((((((V13_85_02_CRF_1:0,V13_85_01_CRF_1:0.0119152)NODE159:0.0149965,V13_85_03_CRF_1:0.00646812)NODE158:0.0110257,(V13_84_01_CRF_1:0,V13_84_01_L_CRF_1:0)NODE163:0.0191856)NODE157:0.227818,((V19_93_01_CRF_1:0.180783,(((V10_94_06_CRF_1:0.00444679,((V10_96_04_CRF_1:0.00328894,(V10_96_06_CRF_1:0.00328116,V10_96_03_L_CRF_1:0)NODE178:0)NODE176:0.00658105,((V10_96_01_CRF_1:0.00805813,V10_96_01_2_CRF_1:0)NODE182:0.00401958,V10_94_02_L_CRF_1:0.00329179)NODE181:0.0081602)NODE175:0.0110746)NODE173:0.0203624,((V10_94_03_L_CRF_1:0,(V10_94_05_CRF_1:0.00660419,(V10_94_08_CRF_1:0,V10_94_07_CRF_1:0.00328833)NODE191:0)NODE189:0)NODE187:0.00325153,V10_94_04_CRF_1:0.00329257)NODE186:0)NODE170:0.00538585,(V10_94_01_L_CRF_1:0.00651465,(V10_94_01_CRF_1:0.00388938,V10_95_01_CRF_1:0.0173987)NODE197:0.00593642)NODE195:0)NODE169:0.093729)NODE167:0.0462289,((V11_125_01_CRF_1:0.105798,((V14_111_01_L_CRF_1:0,V14_111_01_CRF_1:0)NODE204:0.105412,(V14_130_01_CRF_1:0.105223,(V14_100_01_CRF_1:0.105827,(V9_123_01_CRF_1:0.0562991,(V9_129_01_L_CRF_1:0.0337413,((V9_124_01_CRF_1:0,V9_124_01_L_CRF_1:0.00297596)NODE216:0.0202608,(V9_120_01_CRF_1:0.00288878,V9_120_01_L_CRF_1:0)NODE219:0.0353068)NODE215:0.0167878)NODE213:0.0540277)NODE211:0.0871448)NODE209:0.00672734)NODE207:0.014068)NODE203:0.0319066)NODE201:0.0189007,((V12_38_01_CRF_1:0.0909517,(V12_89_01_CRF_1:0.115052,(((V12_41_02_CRF_1:0.00294112,V12_41_01_CRF_1:0)NODE229:0.023308,V12_44_01_CRF_1:0.0217534)NODE228:0.0123353,(V12_46_01_CRF_1:0.00793881,V12_E_01_CRF_1:0.119887)NODE233:0.00873568)NODE227:0.0354504)NODE225:0.0267064)NODE223:0.0512782,V12_98_01_CRF_1:0.116512)NODE222:0.102459)NODE200:0.0247365)NODE166:0.0189671)NODE156:0.0180197,V16_104_01_CRF_1:0.21055)NODE155:0.0850429,(((V5_37_01_CRF_1:0.0827224,V5_48_01_CRF_1:0.121141)NODE240:0.0255473,((V5_45_01_CRF_1:0.00318577,V5_43_01_CRF_1:0.0118825)NODE244:0.0321789,V5_40_1_CRF_1_01:0.0670574)NODE243:0)NODE239:0.03074,V5_39_01_CRF_1:0.0401032)NODE238:0.19614)NODE152:0.029736)NODE108:0.0322311,(V3_7_01_CRF_1:0.070053,(((V3_1_01_CRF_1:0.0358448,V3_2_01_CRF_1:0.0370692)NODE253:0.0120749,V3_9_01_CRF_1:0.0863131)NODE252:0.0206409,V3_4_01_CRF_1:0.0354739)NODE251:0.0207107)NODE249:0.21979)NODE107:0.0360513)NODE58:0.0485063)Node1:2.48553e-07,(BASE_CRF_2:0.142921,J2_CRF_1:0.0386996,((J3_CRF_1:0.206854,J5_CRF_1:0.111275)NODE500:0.0348108,J4_CRF_1:0.116061)NODE501:0.0471634)NODE502:0.000156479,BASE_CRF_3:0.0005063);";

fprintf (stdout, 		"\nAuto-generating internal node labels\n"); 

_doLabelGeneration ();

fprintf (stdout, sequenceLabels, "\n");
fprintf (labels, CLEAR_FILE, "_subtypeAssignmentByNode = \n", sequenceLabels, ";\n");

