Compare commits

...

6 commits

Author SHA1 Message Date
031a15c8cf typo 2023-02-26 03:34:30 +08:00
3979e7fde0 Merge remote-tracking branch 'refs/remotes/origin/main' 2023-02-26 03:32:39 +08:00
97cdc9a302 polish using macro 2023-02-26 03:32:18 +08:00
ccdbd98b97
chang to md 2023-02-26 02:43:52 +08:00
39c4340a6d add: setk 2023-02-26 02:42:56 +08:00
efcf81cd34
add *_no.tre 2023-01-29 01:49:58 +08:00
5 changed files with 126 additions and 51 deletions

22
README.md Normal file
View file

@ -0,0 +1,22 @@
# TNT Script used by Guoyi
These scripts follow MIT except for setk.run which belongs to Salvador Arias(Instituto Miguel Lillo, San Miguel de Tucumán, Argentina).
## Usage
- OS: Arch Linux;
- `tnt run guoyi.run file.tnt`, `file.tnt` is your data;
- Type `;` and enter;
## Options
- `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`;

33
guoyi.run Normal file
View file

@ -0,0 +1,33 @@
log tnt.log;
macro=;
taxname=;
mxram 10240;
nstates 32;
nstates NOGAPS;
procedure %1;
setk.run;
procedure %1;
hold 1000;
xpiwe(*;
mult=replic 1000 tbr hold 1;
xpiwe&;piwe&;
export= trees.tre;
taxname-;
export= trees_no.tre;
taxname=;
bbreak=tbr;
majority *;
ttags=;
resample boot replications 1000;
ttags & bt.svg thickness 7 italics fontsize 15;
export < bt.tre;
taxname-;
export - bt_no.tre;
length *;
stats.run;
quit ;

71
setk.run Normal file
View file

@ -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/;

27
tnt.run
View file

@ -1,27 +0,0 @@
mxram 10240 ;
nstates 32 ;
nstates NOGAPS ;
piwe=12;
procedure file.tnt ;
log tnt.log ;
taxname= ;
hold 100000 ;
xpiwe(*; mult=replic 1000 tbr hold 10;
xpiwe&; piwe&;
export= trees.tre ;
bbreak=tbr ;
majority * ;
ttags= ;
resample boot replications 1000;
ttags & bt.svg thickness 7 italics fontsize 15;
export < bt.tre ;
length * ;
stats.run;
quit ;

View file

@ -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 ;