176 lines
4.4 KiB
Text
176 lines
4.4 KiB
Text
log tnt.log;
|
|
macro=;
|
|
taxname=;
|
|
mxram 10240;
|
|
nstates 32;
|
|
nstates NOGAPS;
|
|
|
|
/*Arguments*/
|
|
if ( argnumber != 1 )
|
|
silent -console;
|
|
quote - /-----------------------------------------------\;
|
|
quote - | GUOYI TNT SCRIPT 2022-2023 MIT |;
|
|
quote - | You need to give your filename |;
|
|
quote - | tnt*> guoyi filename; |;
|
|
quote - \-----------------------------------------------/;
|
|
proc/;
|
|
end
|
|
|
|
/*Report what will be done*/
|
|
quote - /-----------------------------------------------\;
|
|
quote - | Implied weighting will be estimated. |;
|
|
quote - | TBR Mult and Xmult will be performed. |;
|
|
quote - | Strict consensus will be used. |;
|
|
quote - | Relative bremer support, jackknifing and |;
|
|
quote - | bootstrap will be shown on the svg. |;
|
|
quote - | TL, CI and RI will be calculated finally. |;
|
|
quote - \------------------------------------------------/;
|
|
|
|
|
|
/*Set K*/
|
|
procedure %1;
|
|
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';
|
|
|
|
/*Reopen tnt*/
|
|
procedure %1;
|
|
hold 5000;
|
|
|
|
/*Search trees*/
|
|
xpiwe(*;
|
|
mult=replic 1000 tbr hold 10;
|
|
sect: slack 1000;
|
|
xmult=rss hit 1000 drift 10 ratchet 10 fuse 10;
|
|
piwe&;
|
|
|
|
/*Export trees*/
|
|
export= trees.tre;
|
|
taxname-;
|
|
export= trees_no.tre;
|
|
taxname=;
|
|
|
|
/*Consensus tree*/
|
|
bbreak=tbr;
|
|
nelsen *;
|
|
|
|
/*Get Bremer/jak/boot support*/
|
|
ttags=;
|
|
sub 1; hold +1000; bbreak=fill;
|
|
sub 2; hold +2000; bbreak=fill;
|
|
sub 3; hold +3000; bbreak=fill;
|
|
sub 4; hold +4000; bbreak=fill;
|
|
sub 5; hold +5000; bbreak=fill;
|
|
sub 6; hold +6000; bbreak=fill;
|
|
sub 7; hold +7000; bbreak=fill;
|
|
sub 8; hold +8000; bbreak=fill;
|
|
bsupport[;
|
|
resample jak replications 1000;
|
|
resample boot replications 1000;
|
|
|
|
/*Export consensus tree with supports*/
|
|
ttags & con.svg thickness 7 italics fontsize 15;
|
|
export < con.tre;
|
|
taxname-;
|
|
export - con_no.tre;
|
|
|
|
/*Caulculate TL/CI/RI score*/
|
|
length *;
|
|
report-;
|
|
var-;
|
|
var =
|
|
0 themin
|
|
1 themax
|
|
+ CIs [ ( ntrees + 1 ) ]
|
|
+ RIs [ ( ntrees + 1 ) ]
|
|
+ this
|
|
;
|
|
set themin minsteps;
|
|
set themax maxsteps;
|
|
loop 0 ntrees
|
|
progress #1 (ntrees+1) Calculating indices...;
|
|
set this length[#1];
|
|
set CIs[#1] 'themin'/'this'; /*CI=1 means no homoplasy*/
|
|
set RIs[#1] ('themax'-'this')/('themax'-'themin'); /*RI=1 character fits perfetcly*/
|
|
stop
|
|
progress/;
|
|
report=;
|
|
macfloat 3;
|
|
maketable CIs Consistency index;
|
|
maketable RIs Retention index;
|
|
|
|
/*Report*/
|
|
quote - /----------------------------------------------\;
|
|
quote - | The analysis has been finished. |;
|
|
quote - | The file `tnt.log` contains |;
|
|
quote - | K, TL, CI and RI |;
|
|
quote - | The file `trees*.tre` contain |;
|
|
quote - | trees found by mult and xmult |;
|
|
quote - | The file `con*.tre` contain |;
|
|
quote - | strict consensus tree |;
|
|
quote - | The file `*_no.tre` contain |;
|
|
quote - | tree with `taxaname-` |;
|
|
quote - | The file `con.svg` contain |;
|
|
quote - | strict consensus tree with |;
|
|
quote - | relative bremer, jak and boot |;
|
|
quote - | support on the tree |;
|
|
quote - \----------------------------------------------/;
|
|
|
|
/*Quit*/
|
|
zzz;
|