diff --git a/README b/README new file mode 100644 index 0000000..fefda04 --- /dev/null +++ b/README @@ -0,0 +1,21 @@ +# TNT Script used by Guoyi + +This scripts are followed MIT except for setk.run which belongs to Salvador Arias(Instituto Miguel Lillo, San Miguel de Tucumán, Argentina). + +## tnt.run + +- `file.tnt` must be changed to your own file; + +- `trees.tre`, `bt.tre` are trees with taxaname; + +- `trees_no.tre`, `bt_no.tre` are trees without taxaname which can be put into Winclada with the `file.tnt`; + +- `majority` can be replaced by `nelsen`; + +- `boot` can be replaced by `jack`; + +## setk_tnt.run + +- `file.tnt` must be changed to your own file; + +- You can find the recommended k from `setk.log` and then change in `piwe=` `tnt.run`; diff --git a/setk.run b/setk.run new file mode 100644 index 0000000..1cc962a --- /dev/null +++ b/setk.run @@ -0,0 +1,71 @@ +macro= + +var: + actK + minK + maxK + gVal + a + b + Nval + maxIts +; + +if (ntax<0) + quote NO HAY DATOS!; + proc/; +end + +set gVal 1; + +/* busca el valor de g */ +loop 0 nchar + if (!isinfo[#1]) continue; end + if (!isact[#1]) continue; end + set a=maxsteps[#1]; + set b=minsteps[#1]; + if (('a'-'b')>'gVal') + set gVal 'a'-'b'; + end +stop + +quote valor de g = 'gVal'; + +set actK 10; +set minK 0; +set maxK 500; /* Asume 500 como el maximo posible valor de K */ + +set maxIts 0; + +/* busca el mejor valor de K */ +loop 0 1 + quote actual valor de k = 'actK'; + set a 1-('actK'/('actK'+1)); + quote 'a'; + set b ('actK'/('actK'+'gVal'-1))-('actK'/('actK'+'gVal')); + quote 'b'; + set Nval 'a'/'b'; + quote valor de N = 'Nval'; + if (('Nval'>14.8)&&('Nval'<15.2)) endloop; end /* N esta en el rango */ + if ('Nval'>15.2) + set minK 'actK'; + else + set maxK 'actK'; + end + set a ('maxK'-'minK')/2; + set actK 'minK' + 'a'; + set maxIts ++; + if ('maxIts'==100) endloop; end /* salida de emergencia */ + setloop 0; +stop + +/* Si salio de emergencia */ +if ('maxIts'==100) + quote NO SE TERMINARON LAS ITERACIONES; + quote mejor K encontrado: 'actK'; + proc /; +end + +quote Valor de K: 'actK' (N='Nval'); +piwe='actK'; +proc/; diff --git a/setk_tnt.run b/setk_tnt.run new file mode 100644 index 0000000..5efc1bb --- /dev/null +++ b/setk_tnt.run @@ -0,0 +1,4 @@ +log setk.log; +p file.tnt; +setk.run; +quit; diff --git a/winclada.run b/winclada.run deleted file mode 100644 index ce7e793..0000000 --- a/winclada.run +++ /dev/null @@ -1,24 +0,0 @@ -mxram 10240 ; -nstates 32 ; -nstates NOGAPS ; - -piwe=12; - -procedure mor.tnt ; -log winclada.log ; - -hold 100000 ; -xpiwe(*; mult=replic 1000 tbr hold 10; -xpiwe&; piwe&; -export= treeswc.tre ; - -bbreak=tbr ; -majority * ; - -resample boot replications 1000; -export= btwc.tre ; - -length * ; -stats.run; - -quit ;