polish: bremer from TBR instead of sub

This commit is contained in:
kuoi 2023-10-09 17:00:29 +08:00
parent 0332d175fd
commit 33dd36290d
1 changed files with 27 additions and 33 deletions

View File

@ -319,9 +319,9 @@ end
export= %7.trees.tre; export= %7.trees.tre;
taxname-; taxname-;
export= %7.trees_no.tre; export= %7.trees_no.tre;
tsave *= %7.trees.tnt.tre;
taxname=; taxname=;
tsave = %7.trees.ctf; tsave = %7.trees.ctf;
tsave *= %7.trees.tnt.tre;
/*Get npars number*/ /*Get npars number*/
var: npars; var: npars;
@ -341,35 +341,32 @@ ttags]; /*in one line*/
if (argnumber<=5) if (argnumber<=5)
/*bremer search*/ /*set value of suboptimal from most parsimony tree */
sub 1; hold +1000; bbreak=fill; sub: 0;
sub 3; hold +3000; bbreak=fill;
sub 5; hold +5000; bbreak=fill;
sub 7; hold +7000; bbreak=fill;
/*adjust to zero following Goloboff*/
sub 0;
/*get the consensus tree number*/
var: nsubpars;
set nsubpars ntrees;
/*save strict consensus tree for bremer*/ /*save strict consensus tree for bremer*/
hold+1; hold+1;
bs * 0.'nsubpars'; nelsen * 0.'npars';
/*get the consensus tree number*/
var: contree;
set contree ntrees;
/*calculate relative bremer support*/ /*calculate relative bremer support*/
bs [ 0.'nsubpars' ; bs ]!! 'contree' ;
/*set the br value float*/ /*set the br value float*/
macfloat 2; macfloat 1;
/*calculate bremer support*/ /*calculate bremer support*/
bsupport 0.'nsubpars'; bsupport !! 'contree';
/*choose final tree*/ /*choose final tree*/
tchoose/; tchoose/;
/*adjust to zero following Pablo Goloboff*/
sub 0;
/*jakknifing*/ /*jakknifing*/
resample jak replications 1000 from 0; /*from 0 will orphan other trees*/ resample jak replications 1000 from 0; /*from 0 will orphan other trees*/
/*bootstrap*/ /*bootstrap*/
@ -380,40 +377,37 @@ else
if(( %6 == 0.1 )||( %6 == 0.2 )||( %6 == 0.3 )||( %6==1.1 )||( %6 ==1.2 )||( %6 ==1.3 )||( %6 == 2.1 )||( %6 == 2.2 )||( %6 == 2.3 )||( %6 == 3.1 )||( %6 == 3.2 )||( %6 == 3.3 )||( %6 == 4.1 )||( %6 == 4.2 )||( %6 == 4.3 )||( %6 == 5.1 )||( %6 == 5.2 )||( %6 == 5.3 )||( %6 == 6.1 )||( %6 == 6.2 )||( %6 == 6.3 )||( %6 == 7.1 )||( %6 == 7.2 )||( %6 == 7.3 )) /*bremer support related can only use strict consensus*/ if(( %6 == 0.1 )||( %6 == 0.2 )||( %6 == 0.3 )||( %6==1.1 )||( %6 ==1.2 )||( %6 ==1.3 )||( %6 == 2.1 )||( %6 == 2.2 )||( %6 == 2.3 )||( %6 == 3.1 )||( %6 == 3.2 )||( %6 == 3.3 )||( %6 == 4.1 )||( %6 == 4.2 )||( %6 == 4.3 )||( %6 == 5.1 )||( %6 == 5.2 )||( %6 == 5.3 )||( %6 == 6.1 )||( %6 == 6.2 )||( %6 == 6.3 )||( %6 == 7.1 )||( %6 == 7.2 )||( %6 == 7.3 )) /*bremer support related can only use strict consensus*/
/*bremer search*/ /*set value of suboptimal from most parsimony tree*/
sub 1; hold +1000; bbreak=fill; sub: 0;
sub 3; hold +3000; bbreak=fill;
sub 5; hold +5000; bbreak=fill;
sub 7; hold +7000; bbreak=fill;
/*adjust to zero following Goloboff*/
sub 0;
/*get the consensus tree number*/
var: nsubpars;
set nsubpars ntrees;
/*save strict consensus tree for bremer*/ /*save strict consensus tree for bremer*/
hold+1; hold+1;
bs * 0.'nsubpars'; nelsen * 0.'npars';
/*get the consensus tree number*/
var: contree;
set contree ntrees;
if(( %6 == 0.1 )||( %6 == 0.3 )||( %6==1.1 )||( %6 ==1.3 )||( %6 == 2.1 )||( %6 == 2.3 )||( %6 == 3.1 )||( %6 == 3.3 )||( %6 == 4.1 )||( %6 == 4.3 )||( %6 == 5.1 )||( %6 == 5.3 )||( %6 == 6.1 )||( %6 == 6.3 )||( %6 == 7.1 )||( %6 == 7.3 )) if(( %6 == 0.1 )||( %6 == 0.3 )||( %6==1.1 )||( %6 ==1.3 )||( %6 == 2.1 )||( %6 == 2.3 )||( %6 == 3.1 )||( %6 == 3.3 )||( %6 == 4.1 )||( %6 == 4.3 )||( %6 == 5.1 )||( %6 == 5.3 )||( %6 == 6.1 )||( %6 == 6.3 )||( %6 == 7.1 )||( %6 == 7.3 ))
/*calculate relative bremer support*/ /*calculate relative bremer support*/
bs [ 0.'nsubpars'; bs ]!! 'contree';
end end
if(( %6 == 0.2 )||( %6 == 0.3 )||( %6==1.2 )||( %6 ==1.3 )||( %6 == 2.2 )||( %6 == 2.3 )||( %6 == 3.2 )||( %6 == 3.3 )||( %6 == 4.2 )||( %6 == 4.3 )||( %6 == 5.2 )||( %6 == 5.3 )||( %6 == 6.2 )||( %6 == 6.3 )||( %6 == 7.2 )||( %6 == 7.3 )) if(( %6 == 0.2 )||( %6 == 0.3 )||( %6==1.2 )||( %6 ==1.3 )||( %6 == 2.2 )||( %6 == 2.3 )||( %6 == 3.2 )||( %6 == 3.3 )||( %6 == 4.2 )||( %6 == 4.3 )||( %6 == 5.2 )||( %6 == 5.3 )||( %6 == 6.2 )||( %6 == 6.3 )||( %6 == 7.2 )||( %6 == 7.3 ))
/*set the br value float*/ /*set the br value float*/
macfloat 2; macfloat 1;
/*calculate bremer support*/ /*calculate bremer support*/
bsupport 0.'nsubpars'; bsupport !! 'contree';
end end
/*choose final tree*/ /*choose final tree*/
tchoose/; tchoose/;
/*adjust to zero following Pablo Goloboff*/
sub 0;
/*jackknifing*/ /*jackknifing*/
if((%6 == 1.1) || (%6 == 1.2) || (%6 == 1.3) || (%6 == 3.1) || (%6 == 3.2) || (%6 == 3.3) || (%6 == 5.1) || (%6 == 5.2) || (%6 == 5.3) || (%6 == 7.1) || (%6 == 7.2) || (%6 == 7.3)) if((%6 == 1.1) || (%6 == 1.2) || (%6 == 1.3) || (%6 == 3.1) || (%6 == 3.2) || (%6 == 3.3) || (%6 == 5.1) || (%6 == 5.2) || (%6 == 5.3) || (%6 == 7.1) || (%6 == 7.2) || (%6 == 7.3))
resample jak replications 1000 from 0; resample jak replications 1000 from 0;