This file is indexed.

/usr/share/beast-mcmc2/templates/ClockModels.xml is in beast2-mcmc 2.4.4+dfsg-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<beast version='2.0'
       namespace='beast.app.beauti:beast.core:beast.evolution.branchratemodel:beast.evolution.speciation:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood:beast.evolution:beast.math.distributions'>


    <!-- Clock models -->
    <mergewith point='clockModelTemplates'>

        <!-- Strict clock -->
        <subtemplate id='StrictClock' class='beast.evolution.branchratemodel.StrictClockModel'
                     mainid='StrictClock.c:$(n)'>
            <![CDATA[
                <branchRateModel spec='StrictClockModel' id='StrictClock.c:$(n)'>
                    <clock.rate id='clockRate.c:$(n)' spec='parameter.RealParameter' value='1.0' estimate='false'/>
                </branchRateModel>

				<operator id='StrictClockRateScaler.c:$(n)' spec='ScaleOperator' scaleFactor="0.75" weight="3" parameter='@clockRate.c:$(n)'/>

				<upDownOperator id='strictClockUpDownOperator.c:$(n)' spec='UpDownOperator' scaleFactor="0.75" weight="3">
					<up idref="clockRate.c:$(n)"/>
					<down idref="Tree.t:$(n)"/>
				</upDownOperator>

		        <prior id='ClockPrior.c:$(n)' x='@clockRate.c:$(n)'><distr spec="beast.math.distributions.Uniform" upper='Infinity'/></prior>
]]>
            <connect srcID='clockRate.c:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(clockRate.c:$(n)) and clockRate.c:$(n)/estimate=true'/>

            <connect srcID='clockRate.c:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(clockRate.c:$(n)) and clockRate.c:$(n)/estimate=true'/>
            <connect srcID='ClockPrior.c:$(n)' targetID='prior' inputName='distribution'
                     if='inlikelihood(clockRate.c:$(n)) and clockRate.c:$(n)/estimate=true'>substitution rate of
                partition c:$(n)
            </connect>
            <connect srcID='StrictClockRateScaler.c:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(clockRate.c:$(n)) and clockRate.c:$(n)/estimate=true'>Scale substitution rate of
                partition c:$(n)
            </connect>
            <connect srcID='strictClockUpDownOperator.c:$(n)' targetID='mcmc' inputName='operator'
                     if='nooperator(FixMeanRatesOperator) and inlikelihood(clockRate.c:$(n)) and inlikelihood(Tree.t:$(n)) and Tree.t:$(n)/estimate=true and clockRate.c:$(n)/estimate=true'>
                Scale up substitution rate c:$(n) and scale down tree t:($n)
            </connect>
        </subtemplate>

        <!-- Relaxed clock exponential -->
        <subtemplate id='RelaxedClockExponential' class='beast.evolution.branchratemodel.UCRelaxedClockModel'
                     mainid='ExponentialRelaxedClock.c:$(n)'
                     suppressInputs='beast.evolution.branchratemodel.UCRelaxedClockModel.distr,beast.evolution.branchratemodel.UCRelaxedClockModel.rateQuantiles'>
            <![CDATA[
        <plugin spec='UCRelaxedClockModel' id="ExponentialRelaxedClock.c:$(n)" tree='@Tree.t:$(n)'>
			<parameter name='clock.rate' id='ucedMean.c:$(n)' value='1.0' estimate='false'/>
            <distr id='Exponential.c:$(n)' name='distr' spec="beast.math.distributions.Exponential">
				<parameter id='UCExpLambda.c:$(n)' name='mean' value='1.0'/>
			</distr>
            <rateCategories spec='parameter.IntegerParameter' id='expRateCategories.c:$(n)' value="1" dimension='10' estimate='true'/>
        </plugin>

        <operator id='ucedMeanScaler.c:$(n)' spec='ScaleOperator' scaleAll='false' scaleFactor="0.5" weight="1" parameter="@ucedMean.c:$(n)"/>
        <operator id="ExpCategoriesRandomWalk.c:$(n)" spec="IntRandomWalkOperator" windowSize='1' weight="10" parameter="@expRateCategories.c:$(n)"/>
		<operator id='ExpCategoriesSwapOperator.c:$(n)' spec='SwapOperator' howMany="1" weight="10" intparameter='@expRateCategories.c:$(n)'/>
		<operator id='ExpCategoriesUniform.c:$(n)' spec='UniformOperator' weight="10" parameter='@expRateCategories.c:$(n)'/>

		<upDownOperator id='relaxedUpDownOperatorExp.c:$(n)' spec='UpDownOperator' scaleFactor="0.75" weight="3">
			<up idref="ucedMean.c:$(n)"/>
			<down idref="Tree.t:$(n)"/>
		</upDownOperator>

		<log id='rateStat.c:$(n)' spec='RateStatistic' tree='@Tree.t:$(n)' branchratemodel='@ExponentialRelaxedClock.c:$(n)'/>
        <prior id='UCMeanRatePrior.c:$(n)' x='@ucedMean.c:$(n)'><distr spec="beast.math.distributions.Uniform" upper='Infinity'/></prior>
]]>
            <connect srcID='ucedMean.c:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(ucedMean.c:$(n)) and ucedMean.c:$(n)/estimate=true'/>
            <connect srcID='expRateCategories.c:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(expRateCategories.c:$(n))'/>

            <connect srcID='UCMeanRatePrior.c:$(n)' targetID='prior' inputName='distribution'
                     if='inlikelihood(ucedMean.c:$(n)) and ucedMean.c:$(n)/estimate=true'>uncorrelated exponential
                relaxed clock mean of partition c:$(n)
            </connect>

            <connect srcID='ucedMeanScaler.c:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(ucedMean.c:$(n)) and ucedMean.c:$(n)/estimate=true'>Scale clock rate of partition
                c:$(n)
            </connect>
            <connect srcID='ExpCategoriesRandomWalk.c:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(expRateCategories.c:$(n)) and expRateCategories.c:$(n)/estimate=true'>Randomly change categories of partition c:$(n)
            </connect>
            <connect srcID='ExpCategoriesSwapOperator.c:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(expRateCategories.c:$(n)) and expRateCategories.c:$(n)/estimate=true'>Swap categories of partition c:$(n)
            </connect>
            <connect srcID='ExpCategoriesUniform.c:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(expRateCategories.c:$(n)) and expRateCategories.c:$(n)/estimate=true'>Uniformly draw categories of partition c:$(n)
            </connect>
            <connect srcID='relaxedUpDownOperatorExp.c:$(n)' targetID='mcmc' inputName='operator'
                     if='nooperator(FixMeanRatesOperator) and inlikelihood(ucedMean.c:$(n)) and inlikelihood(Tree.t:$(n)) and ucedMean.c:$(n)/estimate=true and Tree.t:$(n)/estimate=true'>
                Up/down scaler for mean rate and tree of partition c:$(n)
            </connect>
            <connect srcID='Tree.t:$(n)' targetID='ExponentialRelaxedClock.c:$(n)' inputName='tree' if='inlikelihood(ExponentialRelaxedClock.c:$(n))'/>
            <connect srcID='Tree.t:$(n)' targetID='rateStat.c:$(n)' inputName='tree' if='inlikelihood(ExponentialRelaxedClock.c:$(n))'/>

            <connect srcID='ucedMean.c:$(n)' targetID='tracelog' inputName='log'
                     if='inlikelihood(ucedMean.c:$(n)) and ucedMean.c:$(n)/estimate=true'/>
            <connect srcID='rateStat.c:$(n)' targetID='tracelog' inputName='log'
                     if='inposterior(ExponentialRelaxedClock.c:$(n))'/>

            <connect srcID='ExponentialRelaxedClock.c:$(n)' targetID='TreeWithMetaDataLogger.t:$(n)'
                     inputName='branchratemodel' if='inposterior(ExponentialRelaxedClock.c:$(n))'/>
        </subtemplate>


        <!-- Relaxed clock log normal -->
        <subtemplate id='RelaxedClockLogNormal' class='beast.evolution.branchratemodel.UCRelaxedClockModel'
                     mainid='RelaxedClock.c:$(n)'
                     suppressInputs='beast.evolution.branchratemodel.UCRelaxedClockModel.distr,beast.evolution.branchratemodel.UCRelaxedClockModel.rateQuantiles'>
            <![CDATA[
        <plugin spec='UCRelaxedClockModel' id="RelaxedClock.c:$(n)" tree='@Tree.t:$(n)'>
			<parameter name='clock.rate' id='ucldMean.c:$(n)' value='1.0'/>
            <distr id='LogNormalDistributionModel.c:$(n)' name='distr' spec="beast.math.distributions.LogNormalDistributionModel" meanInRealSpace='true'>
                <parameter name='M' value="1.0" estimate='false' lower='0' upper='1'/>
                <parameter name='S' id='ucldStdev.c:$(n)' value="0.1" lower="0" estimate='true'/>
            </distr>
            <rateCategories spec='parameter.IntegerParameter' id='rateCategories.c:$(n)' value="1" dimension='10' estimate='true'/>
        </plugin>

        <operator id='ucldMeanScaler.c:$(n)' spec='ScaleOperator' scaleAll='false' scaleFactor="0.5" weight="1" parameter="@ucldMean.c:$(n)"/>
        <operator id='ucldStdevScaler.c:$(n)' spec='ScaleOperator' scaleAll='false' scaleFactor="0.5" weight="3" parameter="@ucldStdev.c:$(n)"/>
        <operator id="CategoriesRandomWalk.c:$(n)" spec="IntRandomWalkOperator" windowSize='1' weight="10" parameter="@rateCategories.c:$(n)"/>
		<operator id='CategoriesSwapOperator.c:$(n)' spec='SwapOperator' howMany="1" weight="10" intparameter='@rateCategories.c:$(n)'/>
		<operator id='CategoriesUniform.c:$(n)' spec='UniformOperator' weight="10" parameter='@rateCategories.c:$(n)'/>

		<upDownOperator id='relaxedUpDownOperator.c:$(n)' spec='UpDownOperator' scaleFactor="0.75" weight="3">
			<up idref="ucldMean.c:$(n)"/>
			<down idref="Tree.t:$(n)"/>
		</upDownOperator>

        <prior id='ucldStdevPrior.c:$(n)' x='@ucldStdev.c:$(n)'>

            <!-- this prior has a median of 0.1 and 97.5% of its probability is below S=1 -->
            <distr spec="beast.math.distributions.Gamma">
                <parameter name='alpha' value="0.5396" estimate='false'/> <!-- shape -->
                <parameter name='beta' value="0.3819" estimate='false'/> <!-- scale -->
            </distr>

            <!-- <distr spec="beast.math.distributions.Exponential">
                <parameter name='mean' value="0.3333" estimate='false'/>
            </distr> -->
        </prior>


		<log id='rate.c:$(n)' spec='RateStatistic' tree='@Tree.t:$(n)' branchratemodel='@RelaxedClock.c:$(n)'/>
        <prior id='MeanRatePrior.c:$(n)' x='@ucldMean.c:$(n)'><distr spec="beast.math.distributions.Uniform" upper='Infinity'/></prior>
]]>
            <connect srcID='ucldMean.c:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(ucldMean.c:$(n)) and ucldMean.c:$(n)/estimate=true'/>
            <connect srcID='ucldStdev.c:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(ucldStdev.c:$(n)) and ucldStdev.c:$(n)/estimate=true'/>
            <connect srcID='rateCategories.c:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(rateCategories.c:$(n))'/>

            <connect srcID='ucldMeanScaler.c:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(ucldMean.c:$(n)) and ucldMean.c:$(n)/estimate=true'>Scale clock rate of partition
                c:$(n)
            </connect>
            <connect srcID='ucldStdevScaler.c:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(ucldStdev.c:$(n)) and ucldStdev.c:$(n)/estimate=true'>Scale stdev of rate of partition c:$(n)
            </connect>
            <connect srcID='CategoriesRandomWalk.c:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(rateCategories.c:$(n)) and rateCategories.c:$(n)/estimate=true'>Randomly change categories of partition c:$(n)
            </connect>
            <connect srcID='CategoriesSwapOperator.c:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(rateCategories.c:$(n)) and rateCategories.c:$(n)/estimate=true'>Swap categories of partition c:$(n)
            </connect>
            <connect srcID='CategoriesUniform.c:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(rateCategories.c:$(n)) and rateCategories.c:$(n)/estimate=true'>Uniformly draw categories of partition c:$(n)
            </connect>
            <connect srcID='relaxedUpDownOperator.c:$(n)' targetID='mcmc' inputName='operator'
                     if='nooperator(FixMeanRatesOperator) and inlikelihood(ucldMean.c:$(n)) and ucldMean.c:$(n)/estimate=true and Tree.t:$(n)/estimate=true'>
                Up/down scaler for mean rate and tree of partition c:$(n)
            </connect>
            <connect srcID='Tree.t:$(n)' targetID='RelaxedClock.c:$(n)' inputName='tree' if='inlikelihood(RelaxedClock.c:$(n))'/>
            <connect srcID='Tree.t:$(n)' targetID='rate.c:$(n)' inputName='tree' if='inlikelihood(RelaxedClock.c:$(n))'/>

            <connect srcID='ucldMean.c:$(n)' targetID='tracelog' inputName='log'
                     if='inlikelihood(ucldMean.c:$(n)) and ucldMean.c:$(n)/estimate=true'/>
            <connect srcID='ucldStdev.c:$(n)' targetID='tracelog' inputName='log' if='inlikelihood(ucldStdev.c:$(n))'/>
            <connect srcID='rate.c:$(n)' targetID='tracelog' inputName='log' if='inposterior(RelaxedClock.c:$(n))'/>

            <connect srcID='ucldStdevPrior.c:$(n)' targetID='prior' inputName='distribution'
                     if='inlikelihood(ucldStdev.c:$(n))'>uncorrelated lognormal relaxed clock stdev of partition c:$(n)
            </connect>
            <connect srcID='MeanRatePrior.c:$(n)' targetID='prior' inputName='distribution'
                     if='inlikelihood(ucldMean.c:$(n)) and inlikelihood(Tree.t:$(n)) and ucldMean.c:$(n)/estimate=true'>
                uncorrelated lognormal relaxed clock mean of partition c:$(n)
            </connect>

            <connect srcID='RelaxedClock.c:$(n)' targetID='TreeWithMetaDataLogger.t:$(n)' inputName='branchratemodel'
                     if='inposterior(RelaxedClock.c:$(n))'/>
        </subtemplate>


        <!-- Random local clock -->
        <subtemplate id='RandomLocalClock' class='beast.evolution.branchratemodel.RandomLocalClockModel'
                     mainid='RandomLocalClock.c:$(n)'
                     suppressInputs='beast.evolution.branchratemodel.RandomLocalClockModel.rates'>
            <![CDATA[
        <input spec='RandomLocalClockModel' id="RandomLocalClock.c:$(n)" ratesAreMultipliers="false" tree='@Tree.t:$(n)'>
            <clock.rate id='meanClockRate.c:$(n)' spec='parameter.RealParameter' value='1.0' estimate='false'/>
            <parameter spec='parameter.BooleanParameter' name='indicators' id='Indicators.c:$(n)' value="0"/>
            <parameter name='rates' id='clockrates.c:$(n)' value="1"/>
        </input>

        <operator id="IndicatorsBitFlip.c:$(n)" spec="BitFlipOperator" weight="15" parameter="@Indicators.c:$(n)"/>
<!-- this should probably be a DeltaExchange instead of scale operator to keep mean rate to 1 -->
        <operator id='ClockRateScaler.c:$(n)' spec='ScaleOperator' scaleAll='false' scaleFactor="0.5" weight="15" parameter="@clockrates.c:$(n)"/>

        <operator id='randomClockScaler.c:$(n)' spec='ScaleOperator' scaleAll='false' scaleFactor="0.5" weight="1" parameter="@meanClockRate.c:$(n)"/>
		<upDownOperator id='randomClockUpDownOperator.c:$(n)' spec='UpDownOperator' scaleFactor="0.75" weight="3">
			<up idref="meanClockRate.c:$(n)"/>
			<down idref="Tree.t:$(n)"/>
		</upDownOperator>

		<distribution idref="prior">
			<if cond='inlikelihood(RandomLocalClock.c:$(n))'>
				<!-- prior on rates -->
			    <prior id='RRatesPrior.c:s$(n)' name="distribution" x='@clockrates.c:$(n)'>
			        <Gamma id="Gamma.0" name="distr">
			            <parameter estimate="false" name="alpha">0.5</parameter>
			            <parameter estimate="false" name="beta">2.0</parameter>
			        </Gamma>
				</prior>

				<!-- prior on number of changes -->
				<prior id="RRateChangesPrior.c:$(n)" name="distribution">
					<x id="RRateChanges.c:$(n)" spec="beast.core.util.Sum" arg="@Indicators.c:$(n)"/>
                    <distr spec='beast.math.distributions.Poisson'>
                          <lambda spec='parameter.RealParameter' estimate='false' value='0.6931471805599453'/>
                    </distr>
				</prior>
			</if>
		</distribution>

		<logger idref="tracelog">
			<if cond='inlikelihood(RandomLocalClock.c:$(n))'>
				<log idref="RRateChanges.c:$(n)"/>
			</if>
		</logger>

        <prior id='MeanRRatePrior.c:s$(n)' x='@meanClockRate.c:$(n)'><distr spec="beast.math.distributions.Uniform" upper='Infinity'/></prior>
]]>
            <connect srcID='Indicators.c:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(Indicators.c:$(n))'/>
            <connect srcID='meanClockRate.c:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(meanClockRate.c:$(n)) and meanClockRate.c:$(n)/estimate=true'/>
            <connect srcID='clockrates.c:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(clockrates.c:$(n))'/>


            <connect srcID='randomClockScaler.c:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(meanClockRate.c:$(n)) and meanClockRate.c:$(n)/estimate=true'>Scale clock rate of
                partition c:$(n)
            </connect>
            <connect srcID='randomClockUpDownOperator.c:$(n)' targetID='mcmc' inputName='operator'
                     if='nooperator(FixMeanRatesOperator) and inlikelihood(meanClockRate.c:$(n)) and inlikelihood(Tree.t:$(n)) and meanClockRate.c:$(n)/estimate=true'>
                Up/down scaler for mean rate and tree of partition c:$(n)
            </connect>
            <connect srcID='IndicatorsBitFlip.c:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(Indicators.c:$(n))'>Flip indicator bits for random clock of partition c:$(n)
            </connect>
            <connect srcID='ClockRateScaler.c:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(clockrates.c:$(n))'>Scale random clock rates of partition c:$(n)
            </connect>
            <connect srcID='Tree.t:$(n)' targetID='RandomLocalClock.c:$(n)' inputName='tree' if='inlikelihood(RandomLocalClock.c:$(n))'/>

            <connect srcID='Indicators.c:$(n)' targetID='tracelog' inputName='log'
                     if='inlikelihood(Indicators.c:$(n))'/>
            <connect srcID='clockrates.c:$(n)' targetID='tracelog' inputName='log'
                     if='inlikelihood(clockrates.c:$(n))'/>
            <connect srcID='meanClockRate.c:$(n)' targetID='tracelog' inputName='log'
                     if='inposterior(RandomLocalClock.c:$(n)) and meanClockRate.c:$(n)/estimate=true'/>

            <connect srcID='MeanRRatePrior.c:$(n)' targetID='prior' inputName='distribution'
                     if='inlikelihood(meanClockRate.c:$(n)) and meanClockRate.c:$(n)/estimate=true'>substitution rate of
                partition c:$(n)
            </connect>

            <connect srcID='RandomLocalClock.c:$(n)' targetID='TreeWithMetaDataLogger.t:$(n)'
                     inputName='branchratemodel' if='inposterior(RandomLocalClock.c:$(n))'/>
        </subtemplate>

    </mergewith>

</beast>