Skip to content

Commit

Permalink
fix post hoc analyser + add example
Browse files Browse the repository at this point in the history
  • Loading branch information
rbouckaert committed Jul 11, 2023
1 parent 6da47e3 commit c7475e5
Show file tree
Hide file tree
Showing 7 changed files with 301 additions and 7 deletions.
59 changes: 59 additions & 0 deletions examples/posthocanalysis/testPostHocAnalysis.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#
#model:
#
#<?xml version="1.0" encoding="UTF-8" standalone="no"?><input id="posterior" spec="beast.base.inference.CompoundDistribution">
# <distribution id="prior" spec="beast.base.inference.CompoundDistribution">
# <distribution id="YuleModel.t:dna" spec="beast.base.evolution.speciation.YuleModel">
# <parameter id="birthRate.t:dna" lower="0.0" name="birthDiffRate" spec="beast.base.inference.parameter.RealParameter">1.0</parameter>
# <tree id="Tree.t:dna" spec="beast.base.evolution.tree.Tree">
# <taxonset id="TaxonSet.dna" spec="beast.base.evolution.alignment.TaxonSet">
# </taxonset>
# </tree>
# </distribution>
# <prior id="YuleBirthRatePrior.t:dna" name="distribution" x="@birthRate.t:dna">
# <Uniform id="Uniform.1" name="distr" upper="Infinity"/>
# </prior>
# <prior id="FrequenciesPrior.s:dna" name="distribution">
# <parameter dimension="4" id="freqParameter.s:dna" lower="0.0" name="x" spec="beast.base.inference.parameter.RealParameter" upper="1.0">0.25</parameter>
# <distr id="Dirichlet.0" spec="beast.base.inference.distribution.Dirichlet">
# <parameter dimension="4" estimate="false" id="RealParameter.3" name="alpha" spec="beast.base.inference.parameter.RealParameter">4.0 4.0 4.0 4.0</parameter>
# </distr>
# </prior>
# <prior id="KappaPrior.s:dna" name="distribution">
# <parameter id="kappa.s:dna" lower="0.0" name="x" spec="beast.base.inference.parameter.RealParameter">2.0</parameter>
# <LogNormal id="LogNormalDistributionModel.0" name="distr">
# <parameter estimate="false" id="RealParameter.1" name="M" spec="beast.base.inference.parameter.RealParameter">1.0</parameter>
# <parameter estimate="false" id="RealParameter.2" name="S" spec="beast.base.inference.parameter.RealParameter">1.25</parameter>
# </LogNormal>
# </prior>
# </distribution>
# <distribution id="likelihood" spec="beast.base.inference.CompoundDistribution" useThreads="true">
# <distribution data="@dna" id="treeLikelihood.dna" spec="beast.base.evolution.likelihood.ThreadedTreeLikelihood" tree="@Tree.t:dna">
# <siteModel id="SiteModel.s:dna" spec="beast.base.evolution.sitemodel.SiteModel">
# <parameter estimate="false" id="mutationRate.s:dna" lower="0.0" name="mutationRate" spec="beast.base.inference.parameter.RealParameter">1.0</parameter>
# <parameter estimate="false" id="gammaShape.s:dna" lower="0.1" name="shape" spec="beast.base.inference.parameter.RealParameter">1.0</parameter>
# <parameter estimate="false" id="proportionInvariant.s:dna" lower="0.0" name="proportionInvariant" spec="beast.base.inference.parameter.RealParameter" upper="1.0">0.0</parameter>
# <substModel id="hky.s:dna" kappa="@kappa.s:dna" spec="beast.base.evolution.substitutionmodel.HKY">
# <frequencies frequencies="@freqParameter.s:dna" id="estimatedFreqs.s:dna" spec="beast.base.evolution.substitutionmodel.Frequencies"/>
# </substModel>
# </siteModel>
# <branchRateModel id="StrictClock.c:dna" spec="beast.base.evolution.branchratemodel.StrictClockModel">
# <parameter estimate="false" id="clockRate.c:dna" lower="0.0" name="clock.rate" spec="beast.base.inference.parameter.RealParameter">1.0</parameter>
# </branchRateModel>
# </distribution>
# </distribution>
# <distribution id="fossilCalibrations" spec="beast.base.inference.CompoundDistribution"/>
#</input>
#
Sample posterior likelihood prior treeLikelihood Tree.height Tree.treeLength YuleModel birthRate kappa freqParameter.1 freqParameter.2 freqParameter.3 freqParameter.4
0 -7078.303048647919 -7074.939932406025 -3.3631162418940974 -7074.939932406025 2.0268501351378134 5.950654576931362 -5.594457381409796 1.9508570854721188 2.0 0.25 0.25 0.25 0.25
100000 -5084.232683008769 -5091.202164361688 6.969481352919923 -5091.202164361688 0.2498310540524289 1.7470473504362949 5.02666032744127 7.5084198596 2.539076798063384 0.2725348717723629 0.2724270672060836 0.20490156613459143 0.25013649488696205
200000 -5056.257512979744 -5063.189359613766 6.931846634021946 -5063.189359613766 0.24700928700067404 1.6561468980623089 5.581389440956438 7.775580684996254 2.5753150438689993 0.28035013524637387 0.28906898979658047 0.12792790042493826 0.3026529745321075
300000 -5051.712322632851 -5058.968982395007 7.2566597621552145 -5058.968982395007 0.26564844097113727 1.7297390927412177 5.843059305590806 5.166259069127232 2.4979965397928066 0.28773071286953633 0.28804760040617466 0.13025133869447844 0.2939703480298107
400000 -5059.86687009985 -5066.159766155217 6.292896055367457 -5066.159766155217 0.2604345720909398 1.6904463943715475 5.012506059921903 3.159281867305655 2.3502060235281252 0.2781050121363103 0.30678312081353953 0.11720778657375423 0.2979040804763959
500000 -5052.483060645312 -5059.869046005873 7.385985360560462 -5059.869046005873 0.2523197414682515 1.7137803702742005 5.859448785721435 5.919997221424275 2.225401474274649 0.2946557536690123 0.2898856960311982 0.1309155524811124 0.2845429978186771
600000 -5057.753865195475 -5064.374109522826 6.620244327351802 -5064.374109522826 0.2672992627136393 1.806127955133274 5.4451332838040605 5.21200941966205 2.828568772219936 0.2833006959180678 0.28020625221361667 0.12248325504917207 0.3140097968191434
700000 -5052.581067036369 -5059.935377325931 7.354310289561582 -5059.935377325931 0.25494902303838496 1.711415391088245 5.824661157014702 4.464040817003514 2.3019133627605153 0.2857386694838131 0.30172716680468786 0.13393144994144596 0.2786027137700531
800000 -5056.184484773595 -5062.728768820264 6.5442840466690395 -5062.728768820264 0.2530553908981864 1.679409347586007 5.1724479734698585 3.270938634914328 2.5441038027024994 0.30090784666723613 0.26533514293892485 0.12964110587259564 0.3041159045212434
900000 -5059.8892017083945 -5064.502222807706 4.6130210993110525 -5064.502222807706 0.24873993037509748 1.672297273428906 3.2675138729699764 10.903910152190786 2.741334636653413 0.26875080594756623 0.28805665466978664 0.13326711495838323 0.3099254244242639
1000000 -5057.658315680889 -5060.860164376698 3.2018486958082875 -5060.860164376698 0.26895523250839737 1.7628395043534504 1.9521385384951024 11.249200461401443 2.5884671465665847 0.300769117921119 0.2888055916784842 0.12079940068965078 0.28962588971074604
42 changes: 42 additions & 0 deletions examples/posthocanalysis/testPostHocAnalysis.trees
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#NEXUS

Begin taxa;
Dimensions ntax=10;
Taxlabels
Cow
Carp
Chicken
Human
Loach
Mouse
Rat
Seal
Whale
Frog
;
End;
Begin trees;
Translate
1 Cow,
2 Carp,
3 Chicken,
4 Human,
5 Loach,
6 Mouse,
7 Rat,
8 Seal,
9 Whale,
10 Frog
;
tree STATE_0 = ((((2:0.1261101090351116,(10:0.02660865616494308,4:0.02660865616494308):0.09950145287016852):0.03769776397127364,8:0.16380787300638525):0.8536429164292316,(((7:0.08474158644419744,(3:0.020453415049256622,1:0.020453415049256622):0.06428817139494081):0.1372736693847453,5:0.22201525582894274):0.01375136586233855,9:0.2357666216912813):0.7816841677443356):1.0093993457021966,6:2.0268501351378134):0.0;
tree STATE_100000 = (((10:0.18162546411296912,(5:0.12436947252474177,2:0.12436947252474177):0.05725599158822735):0.04322753169173449,3:0.2248529958047036):0.024978058247725282,(((7:0.08868983811061293,6:0.08868983811061293):0.07662516157257546,((1:0.10396576009468639,9:0.10396576009468639):0.022456663564907192,8:0.12642242365959358):0.038892576023594805):0.06682928865775281,4:0.2321442883409412):0.017686765711487695):0.0;
tree STATE_200000 = ((3:0.2106756383717695,(10:0.1796169605403208,(5:0.11300544863522323,2:0.11300544863522323):0.06661151190509758):0.031058677831448694):0.036333648628904536,(((7:0.07829178869549978,6:0.07829178869549978):0.08092944623662786,((1:0.08425923090263027,9:0.08425923090263027):0.044151431807078007,8:0.12841066270970827):0.03081057222241937):0.04942612434155347,4:0.2086473592736811):0.03836192772699293):0.0;
tree STATE_300000 = ((3:0.23186299448777956,(10:0.1724362748263448,(5:0.1157909992699058,2:0.1157909992699058):0.056645275556439):0.05942671966143476):0.03378544648335771,(((7:0.0873263856473462,6:0.0873263856473462):0.07482469489846454,((1:0.09052843254298543,9:0.09052843254298543):0.03496441050456564,8:0.12549284304755107):0.036658237498259666):0.05070211988540896,4:0.2128532004312197):0.052795240539917576):0.0;
tree STATE_400000 = ((3:0.21078152272463385,(10:0.1581504786878109,(5:0.12087278828073728,2:0.12087278828073728):0.03727769040707363):0.05263104403682295):0.049653049366305935,(((7:0.08075399182006365,6:0.08075399182006365):0.06733172900778508,((1:0.10074315936085738,9:0.10074315936085738):0.02500763657382156,8:0.12575079593467894):0.022334924893169794):0.0763530717251884,4:0.22443879255303714):0.035995779537902645):0.0;
tree STATE_500000 = (((10:0.17119281784185333,(5:0.11676158807338993,2:0.11676158807338993):0.0544312297684634):0.07310261750052147,3:0.2442954353423748):0.008024306125876679,(4:0.20972299093860874,((7:0.08300234522950072,6:0.08300234522950072):0.07736741889502093,((1:0.1016575359465695,9:0.1016575359465695):0.020480873894309595,8:0.12213840984087909):0.03823135428364255):0.0493532268140871):0.042596750529642735):0.0;
tree STATE_600000 = ((3:0.22628228897635883,(10:0.17352467643441788,(5:0.1205840177796669,2:0.1205840177796669):0.05294065865475098):0.052757612541940946):0.04101697373728047,(((7:0.09731585381973966,6:0.09731585381973966):0.07418506899893883,((1:0.1031267307183876,9:0.1031267307183876):0.03049893593411429,8:0.1336256666525019):0.037875256166176596):0.0740683496875657,4:0.2455692725062442):0.021729990207395106):0.0;
tree STATE_700000 = ((3:0.2318017365592682,(10:0.18823977518439725,(5:0.1215882904261527,2:0.1215882904261527):0.06665148475824455):0.04356196137487095):0.023147286479116763,(((7:0.07196686770821592,6:0.07196686770821592):0.0798533199780436,((1:0.09800361844166648,9:0.09800361844166648):0.02884555994878811,8:0.1268491783904546):0.024971009295804925):0.05942750292880136,4:0.21124769061506088):0.04370133242332408):0.0;
tree STATE_800000 = ((3:0.22696773201017081,(10:0.1787677898565458,(5:0.11046374238792307,2:0.11046374238792307):0.06830404746862272):0.048199942153625025):0.02608765888801559,(((7:0.0787141559221822,6:0.0787141559221822):0.07165421722647736,((1:0.09850888880162201,8:0.09850888880162201):0.022397181079866282,9:0.12090606988148829):0.029462303267171266):0.058233440632382755,4:0.2086018137810423):0.044453577117144094):0.0;
tree STATE_900000 = ((3:0.20098360109200797,(10:0.1767243318450242,(5:0.11071026884208054,2:0.11071026884208054):0.06601406300294366):0.024259269246983767):0.04775632928308951,(((7:0.08220864828757406,6:0.08220864828757406):0.0675194634328088,((1:0.0981556261501598,9:0.0981556261501598):0.029010124134205367,8:0.12716575028436516):0.022562361436017697):0.07941296273673337,4:0.22914107445711623):0.019598855917981245):0.0;
tree STATE_1000000 = ((4:0.2199560919411732,((7:0.09486533292941787,6:0.09486533292941787):0.07584007117294453,((1:0.10234633437862133,9:0.10234633437862133):0.01365297382758622,8:0.11599930820620755):0.054706095896154855):0.049250687838810786):0.04899914056722418,(3:0.22849477409446958,(10:0.17615471216741757,(5:0.11640708151698592,2:0.11640708151698592):0.05974763065043165):0.05234006192705201):0.040460458413927786):0.0;
End;
Loading

0 comments on commit c7475e5

Please sign in to comment.