This file is indexed.

/usr/share/beast-mcmc2/templates/SubstModels.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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
<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'>

       
       
       
    <mergewith point='substModelTemplates'>
    
        <!-- gamma site model -->
        <subtemplate id='Gamma Site Model' class='beast.evolution.sitemodel.SiteModel' mainid='SiteModel.s:$(n)'>
            <![CDATA[
            <plugin spec='SiteModel' id="SiteModel.s:$(n)" gammaCategoryCount='0'>
                <!--substModel will be automatically detected /-->
                <proportionInvariant spec='parameter.RealParameter' id='proportionInvariant.s:$(n)' value='0.0' lower='0' upper='1' estimate='false'/>
                <mutationRate        spec='parameter.RealParameter' id='mutationRate.s:$(n)' value='1.0'        estimate='false'/>
                <shape               spec='parameter.RealParameter' id='gammaShape.s:$(n)' value='1.0'         estimate='false'/>
            </plugin>

                <prior id='MutationRatePrior.s:$(n)' x='@mutationRate.s:$(n)'><distr spec="OneOnX"/></prior>
            <prior id='GammaShapePrior.s:$(n)' x='@gammaShape.s:$(n)'><distr spec="beast.math.distributions.Exponential" mean='1'/></prior>
            <prior id='PropInvariantPrior.s:$(n)' x='@proportionInvariant.s:$(n)'><distr spec="beast.math.distributions.Uniform" lower='0' upper='1'/></prior>

            <operator id='proportionInvariantScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@proportionInvariant.s:$(n)"/>
            <operator id='mutationRateScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@mutationRate.s:$(n)"/>
            <operator id='gammaShapeScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@gammaShape.s:$(n)"/>
            ]]>

                        <connect method="beast.app.beauti.SiteModelInputEditor.customConnector"/>

<!-- when FixMeanMutationRatesOperator, the prior is uniform due to the operator -->
            <connect srcID='MutationRatePrior.s:$(n)'         targetID='prior' inputName='distribution' if='nooperator(FixMeanMutationRatesOperator) and inlikelihood(mutationRate.s:$(n)) and mutationRate.s:$(n)/estimate=true'/>

            <connect srcID='proportionInvariant.s:$(n)'       targetID='state' inputName='stateNode' if='inlikelihood(proportionInvariant.s:$(n)) and proportionInvariant.s:$(n)/estimate=true'/>
            <connect srcID='mutationRate.s:$(n)'              targetID='state' inputName='stateNode' if='inlikelihood(mutationRate.s:$(n)) and mutationRate.s:$(n)/estimate=true'/>
            <connect srcID='gammaShape.s:$(n)'                targetID='state' inputName='stateNode' if='inlikelihood(gammaShape.s:$(n)) and gammaShape.s:$(n)/estimate=true'/>


            <connect srcID='proportionInvariantScaler.s:$(n)' targetID='mcmc' inputName='operator' if='inlikelihood(proportionInvariant.s:$(n)) and proportionInvariant.s:$(n)/estimate=true'>Scales proportion of invariant sites parameter of partition $(n)</connect>
            <connect srcID='mutationRateScaler.s:$(n)'        targetID='mcmc' inputName='operator' if='nooperator(FixMeanMutationRatesOperator) and inlikelihood(mutationRate.s:$(n)) and mutationRate.s:$(n)/estimate=true'>Scales mutation rate of partition s:$(n)</connect>
            <connect srcID='gammaShapeScaler.s:$(n)'          targetID='mcmc' inputName='operator' if='inlikelihood(gammaShape.s:$(n)) and gammaShape.s:$(n)/estimate=true'>Scales gamma shape parameter of partition s:$(n)</connect>

            <connect srcID='proportionInvariant.s:$(n)'       targetID='tracelog' inputName='log' if='inposterior(proportionInvariant.s:$(n)) and proportionInvariant.s:$(n)/estimate=true'/>
            <connect srcID='mutationRate.s:$(n)'              targetID='tracelog' inputName='log' if='inlikelihood(mutationRate.s:$(n)) and mutationRate.s:$(n)/estimate=true'/>
            <connect srcID='gammaShape.s:$(n)'                targetID='tracelog' inputName='log' if='inlikelihood(gammaShape.s:$(n)) and gammaShape.s:$(n)/estimate=true'/>

            <connect srcID='GammaShapePrior.s:$(n)'           targetID='prior' inputName='distribution' if='inlikelihood(gammaShape.s:$(n)) and gammaShape.s:$(n)/estimate=true'>Prior on gamma shape for partition s:$(n)</connect>
            <connect srcID='PropInvariantPrior.s:$(n)'        targetID='prior' inputName='distribution' if='inlikelihood(proportionInvariant.s:$(n)) and proportionInvariant.s:$(n)/estimate=true'>Prior on proportion invariant for partition s:$(n)</connect>

        </subtemplate>

    

        <!-- substitution models -->
        <!-- JC69 substitution model -->
        <subtemplate id='JC69' class='beast.evolution.substitutionmodel.JukesCantor' mainid='JC69.s:$(n)'>
            <![CDATA[
        <plugin spec='JukesCantor' id='JC69.s:$(n)'/>
]]>
        </subtemplate>

        <!-- HKY substitution model -->
        <subtemplate id='HKY' class='beast.evolution.substitutionmodel.HKY' mainid='hky.s:$(n)'>
            <![CDATA[
        <plugin spec='HKY' id='hky.s:$(n)'>
            <parameter id="kappa.s:$(n)" name='kappa' value="2.0" lower="0.0" estimate='true'/>
            <frequencies id='estimatedFreqs.s:$(n)' spec='Frequencies'>
                <frequencies id='freqParameter.s:$(n)' spec='parameter.RealParameter' dimension='4' value='0.25' lower='0' upper='1'/>
            </frequencies>
        </plugin>

        <plugin id='KappaScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@kappa.s:$(n)"/>
        <plugin id='FrequenciesExchanger.s:$(n)' spec='DeltaExchangeOperator' delta="0.01" weight="0.1" parameter="@freqParameter.s:$(n)"/>

        <prior id='KappaPrior.s:$(n)' x='@kappa.s:$(n)'>
            <distr spec="LogNormalDistributionModel" meanInRealSpace='false'>
                <parameter name='M' value="1.0" estimate='false'/>
                <parameter name='S' value="1.25" estimate='false'/>
            </distr>
		</prior>
<!--
        <prior id='FrequenciesPrior.s:$(n)' x='@freqParameter.s:$(n)'><distr spec="beast.math.distributions.Uniform" lower='0' upper='1'/></prior>
-->

]]>

            <connect srcID='kappa.s:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(kappa.s:$(n)) and kappa.s:$(n)/estimate=true'/>
            <connect srcID='freqParameter.s:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(hky.$(n)) and inlikelihood(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>

            <connect srcID='KappaScaler.s:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(kappa.s:$(n)) and kappa.s:$(n)/estimate=true'>Scale HKY transition-transversion
                parameter of partition s:$(n)
            </connect>
            <connect srcID='FrequenciesExchanger.s:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(hky.$(n)) and inlikelihood(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'>
                Exchange values of frequencies of partition s:$(n)
            </connect>

            <connect srcID='kappa.s:$(n)' targetID='tracelog' inputName='log'
                     if='inlikelihood(kappa.s:$(n)) and kappa.s:$(n)/estimate=true'/>
            <connect srcID='freqParameter.s:$(n)' targetID='tracelog' inputName='log'
                     if='inlikelihood(hky.$(n)) and inlikelihood(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>

            <connect srcID='KappaPrior.s:$(n)' targetID='prior' inputName='distribution'
                     if='inlikelihood(kappa.s:$(n)) and kappa.s:$(n)/estimate=true'>HKY transition-transversion
                parameter of partition s:$(n)
            </connect>
            <!--
                        <connect srcID='FrequenciesPrior.s:$(n)'     targetID='prior' inputName='distribution' if='inposterior(hky.s:$(n)) and inposterior(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>
            -->
        </subtemplate>


        <!-- TN93 substitution model -->
        <subtemplate id='TN93' class='beast.evolution.substitutionmodel.TN93' mainid='tn93.s:$(n)'>
            <![CDATA[
        <plugin spec='TN93' id='tn93.s:$(n)'>
            <parameter id="kappa1.s:$(n)" name='kappa1' value="2.0" lower="0.0" estimate='true'/>
            <parameter id="kappa2.s:$(n)" name='kappa2' value="2.0" lower="0.0" estimate='true'/>
            <frequencies id='estimatedFreqs.s:$(n)' spec='Frequencies'>
                <frequencies id='freqParameter.s:$(n)' spec='parameter.RealParameter' dimension='4' value='0.25' lower='0' upper='1'/>
            </frequencies>
        </plugin>

        <plugin id='kappa1Scaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@kappa1.s:$(n)"/>
        <plugin id='kappa2Scaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@kappa2.s:$(n)"/>
        <plugin id='FrequenciesExchanger.s:$(n)' spec='DeltaExchangeOperator' delta="0.01" weight="0.1" parameter="@freqParameter.s:$(n)"/>

        <prior id='kappa1Prior.s:$(n)' x='@kappa1.s:$(n)'>
            <distr spec="LogNormalDistributionModel" meanInRealSpace='false'>
                <parameter name='M' value="1.0" estimate='false'/>
                <parameter name='S' value="1.25" estimate='false'/>
            </distr>
	</prior>
        <prior id='kappa2Prior.s:$(n)' x='@kappa2.s:$(n)'>
            <distr spec="LogNormalDistributionModel" meanInRealSpace='false'>
                <parameter name='M' value="1.0" estimate='false'/>
                <parameter name='S' value="1.25" estimate='false'/>
            </distr>
	</prior>
<!--
        <prior id='FrequenciesPrior.s:$(n)' x='@freqParameter.s:$(n)'><distr spec="beast.math.distributions.Uniform" lower='0' upper='1'/></prior>
-->

]]>

            <connect srcID='kappa1.s:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(kappa1.s:$(n)) and kappa1.s:$(n)/estimate=true'/>
            <connect srcID='kappa2.s:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(kappa2.s:$(n)) and kappa2.s:$(n)/estimate=true'/>
            <connect srcID='freqParameter.s:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(hky.$(n)) and inlikelihood(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>

            <connect srcID='kappa1Scaler.s:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(kappa1.s:$(n)) and kappa1.s:$(n)/estimate=true'>Scale TN93 kappa1 (rateAG)
                parameter of partition s:$(n)
            </connect>
            <connect srcID='kappa2Scaler.s:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(kappa2.s:$(n)) and kappa2.s:$(n)/estimate=true'>Scale TN93 kappa2 (rateCT)
                parameter of partition s:$(n)
            </connect>
            <connect srcID='FrequenciesExchanger.s:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(hky.$(n)) and inlikelihood(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'>
                Exchange values of frequencies of partition s:$(n)
            </connect>

            <connect srcID='kappa1.s:$(n)' targetID='tracelog' inputName='log'
                     if='inlikelihood(kappa1.s:$(n)) and kappa1.s:$(n)/estimate=true'/>
            <connect srcID='kappa2.s:$(n)' targetID='tracelog' inputName='log'
                     if='inlikelihood(kappa2.s:$(n)) and kappa2.s:$(n)/estimate=true'/>
            <connect srcID='freqParameter.s:$(n)' targetID='tracelog' inputName='log'
                     if='inlikelihood(hky.$(n)) and inlikelihood(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>

            <connect srcID='kappa1Prior.s:$(n)' targetID='prior' inputName='distribution'
                     if='inlikelihood(kappa1.s:$(n)) and kappa1.s:$(n)/estimate=true'>TN93 kappa1 (rateAG) parameter of
                partition s:$(n)
            </connect>
            <connect srcID='kappa2Prior.s:$(n)' targetID='prior' inputName='distribution'
                     if='inlikelihood(kappa2.s:$(n)) and kappa2.s:$(n)/estimate=true'>TN93 kappa2 (rateCT) parameter of
                partition s:$(n)
            </connect>
            <!--
                        <connect srcID='FrequenciesPrior.s:$(n)'     targetID='prior' inputName='distribution' if='inposterior(hky.s:$(n)) and inposterior(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>
            -->
        </subtemplate>


        <!-- GTR substitution model -->
        <subtemplate id='GTR' class='beast.evolution.substitutionmodel.GTR' mainid='gtr.s:$(n)'
                     suppressInputs='beast.evolution.substitutionmodel.GTR.eigenSystem'>
            <![CDATA[
        <plugin spec='GTR' id='gtr.s:$(n)'>
            <parameter id="rateAC.s:$(n)" name='rateAC' value="1.0" lower="0.0" estimate='true'/>
            <parameter id="rateAG.s:$(n)" name='rateAG' value="1.0" lower="0.0" estimate='true'/>
            <parameter id="rateAT.s:$(n)" name='rateAT' value="1.0" lower="0.0" estimate='true'/>
            <parameter id="rateCG.s:$(n)" name='rateCG' value="1.0" lower="0.0" estimate='true'/>
            <parameter id="rateCT.s:$(n)" name='rateCT' value="1.0" lower="0.0" estimate='false'/>
            <parameter id="rateGT.s:$(n)" name='rateGT' value="1.0" lower="0.0" estimate='true'/>
            <frequencies id='estimatedFreqs.s:$(n)' spec='Frequencies'>
                <frequencies id='freqParameter.s:$(n)' spec='parameter.RealParameter' dimension='4' value='0.25' lower='0' upper='1'/>
            </frequencies>
        </plugin>

        <operator id='RateACScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@rateAC.s:$(n)"/>
        <operator id='RateAGScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@rateAG.s:$(n)"/>
        <operator id='RateATScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@rateAT.s:$(n)"/>
        <operator id='RateCGScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@rateCG.s:$(n)"/>
        <operator id='RateCTScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@rateCT.s:$(n)"/>
        <operator id='RateGTScaler.s:$(n)' spec='ScaleOperator' scaleFactor="0.5" weight="0.1" parameter="@rateGT.s:$(n)"/>
        <operator id='FrequenciesExchanger.s:$(n)' spec='DeltaExchangeOperator' delta="0.01" weight="0.1" parameter="@freqParameter.s:$(n)"/>

        <prior id='RateACPrior.s:$(n)' x='@rateAC.s:$(n)'><distr spec="beast.math.distributions.Gamma"><parameter name="alpha" value='0.05' estimate='false'/><parameter name="beta" value='10.0' estimate='false'/></distr></prior>
        <prior id='RateAGPrior.s:$(n)' x='@rateAG.s:$(n)'><distr spec="beast.math.distributions.Gamma"><parameter name="alpha" value='0.05' estimate="false"/><parameter name="beta" value='20.0' estimate="false"/></distr></prior>
        <prior id='RateATPrior.s:$(n)' x='@rateAT.s:$(n)'><distr spec="beast.math.distributions.Gamma"><parameter name="alpha" value='0.05' estimate="false"/><parameter name="beta" value='10.0' estimate="false"/></distr></prior>
        <prior id='RateCGPrior.s:$(n)' x='@rateCG.s:$(n)'><distr spec="beast.math.distributions.Gamma"><parameter name="alpha" value='0.05' estimate="false"/><parameter name="beta" value='10.0' estimate="false"/></distr></prior>
        <prior id='RateCTPrior.s:$(n)' x='@rateCT.s:$(n)'><distr spec="beast.math.distributions.Gamma"><parameter name="alpha" value='0.05' estimate="false"/><parameter name="beta" value='20.0' estimate="false"/></distr></prior>
        <prior id='RateGTPrior.s:$(n)' x='@rateGT.s:$(n)'><distr spec="beast.math.distributions.Gamma"><parameter name="alpha" value='0.05' estimate="false"/><parameter name="beta" value='10.0' estimate="false"/></distr></prior>
]]>

            <connect srcID='freqParameter.s:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>
            <connect srcID='rateAC.s:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(rateAC.s:$(n)) and rateAC.s:$(n)/estimate=true'/>
            <connect srcID='rateAG.s:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(rateAG.s:$(n)) and rateAG.s:$(n)/estimate=true'/>
            <connect srcID='rateAT.s:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(rateAT.s:$(n)) and rateAT.s:$(n)/estimate=true'/>
            <connect srcID='rateCG.s:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(rateCG.s:$(n)) and rateCG.s:$(n)/estimate=true'/>
            <connect srcID='rateCT.s:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(rateCT.s:$(n)) and rateCT.s:$(n)/estimate=true'/>
            <connect srcID='rateGT.s:$(n)' targetID='state' inputName='stateNode'
                     if='inlikelihood(rateGT.s:$(n)) and rateGT.s:$(n)/estimate=true'/>

            <connect srcID='FrequenciesExchanger.s:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'>Exchange values of
                frequencies of partition s:$(n)
            </connect>
            <connect srcID='RateACScaler.s:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(rateAC.s:$(n)) and rateAC.s:$(n)/estimate=true'>Scale GTR A-C substitution
                parameter of partition s:$(n)
            </connect>
            <connect srcID='RateAGScaler.s:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(rateAG.s:$(n)) and rateAG.s:$(n)/estimate=true'>Scale GTR A-G substitution
                parameter of partition s:$(n)
            </connect>
            <connect srcID='RateATScaler.s:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(rateAT.s:$(n)) and rateAT.s:$(n)/estimate=true'>Scale GTR A-T substitution
                parameter of partition s:$(n)
            </connect>
            <connect srcID='RateCGScaler.s:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(rateCG.s:$(n)) and rateCG.s:$(n)/estimate=true'>Scale GTR C-G substitution
                parameter of partition s:$(n)
            </connect>
            <connect srcID='RateCTScaler.s:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(rateCT.s:$(n)) and rateCT.s:$(n)/estimate=true'>Scale GTR C-T substitution
                parameter of partition s:$(n)
            </connect>
            <connect srcID='RateGTScaler.s:$(n)' targetID='mcmc' inputName='operator'
                     if='inlikelihood(rateGT.s:$(n)) and rateGT.s:$(n)/estimate=true'>Scale GTR G-T substitution
                parameter of partition s:$(n)
            </connect>

            <connect srcID='freqParameter.s:$(n)' targetID='tracelog' inputName='log'
                     if='inlikelihood(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>
            <connect srcID='rateAC.s:$(n)' targetID='tracelog' inputName='log'
                     if='inlikelihood(rateAC.s:$(n)) and rateAC.s:$(n)/estimate=true'/>
            <connect srcID='rateAG.s:$(n)' targetID='tracelog' inputName='log'
                     if='inlikelihood(rateAG.s:$(n)) and rateAG.s:$(n)/estimate=true'/>
            <connect srcID='rateAT.s:$(n)' targetID='tracelog' inputName='log'
                     if='inlikelihood(rateAT.s:$(n)) and rateAT.s:$(n)/estimate=true'/>
            <connect srcID='rateCG.s:$(n)' targetID='tracelog' inputName='log'
                     if='inlikelihood(rateCG.s:$(n)) and rateCG.s:$(n)/estimate=true'/>
            <connect srcID='rateCT.s:$(n)' targetID='tracelog' inputName='log'
                     if='inlikelihood(rateCT.s:$(n)) and rateCT.s:$(n)/estimate=true'/>
            <connect srcID='rateGT.s:$(n)' targetID='tracelog' inputName='log'
                     if='inlikelihood(rateGT.s:$(n)) and rateGT.s:$(n)/estimate=true'/>

            <connect srcID='RateACPrior.s:$(n)' targetID='prior' inputName='distribution'
                     if='inlikelihood(rateAC.s:$(n)) and rateAC.s:$(n)/estimate=true'>GTR A-C substitution parameter of
                partition s:$(n)
            </connect>
            <connect srcID='RateAGPrior.s:$(n)' targetID='prior' inputName='distribution'
                     if='inlikelihood(rateAG.s:$(n)) and rateAG.s:$(n)/estimate=true'>GTR A-G substitution parameter of
                partition s:$(n)
            </connect>
            <connect srcID='RateATPrior.s:$(n)' targetID='prior' inputName='distribution'
                     if='inlikelihood(rateAT.s:$(n)) and rateAT.s:$(n)/estimate=true'>GTR A-T substitution parameter of
                partition s:$(n)
            </connect>
            <connect srcID='RateCGPrior.s:$(n)' targetID='prior' inputName='distribution'
                     if='inlikelihood(rateCG.s:$(n)) and rateCG.s:$(n)/estimate=true'>GTR C-G substitution parameter of
                partition s:$(n)
            </connect>
            <connect srcID='RateCTPrior.s:$(n)' targetID='prior' inputName='distribution'
                     if='inlikelihood(rateCT.s:$(n)) and rateCT.s:$(n)/estimate=true'>GTR C-T substitution parameter of
                partition s:$(n)
            </connect>
            <connect srcID='RateGTPrior.s:$(n)' targetID='prior' inputName='distribution'
                     if='inlikelihood(rateGT.s:$(n)) and rateGT.s:$(n)/estimate=true'>GTR G-T substitution parameter of
                partition s:$(n)
            </connect>
        </subtemplate>


        <!-- empirical amino acid substitution models -->
        <subtemplate id='Blosum62' class='beast.evolution.substitutionmodel.Blosum62'
                     suppressInputs='beast.evolution.substitutionmodel.Blosum62.eigenSystem'
                     mainid='Blosum62.s:$(n)'><!--value spec='XML'-->
            <![CDATA[<plugin spec='Blosum62' id='Blosum62.s:$(n)'/>]]></subtemplate>
        <subtemplate id='Dayhoff' class='beast.evolution.substitutionmodel.Dayhoff'
                     suppressInputs='beast.evolution.substitutionmodel.Dayhoff.eigenSystem'
                     mainid='Dayhoff.s:$(n)'><!--value spec='XML'-->
            <![CDATA[<plugin spec='Dayhoff' id='Dayhoff.s:$(n)'/>]]></subtemplate>
        <subtemplate id='JTT' class='beast.evolution.substitutionmodel.JTT'
                     suppressInputs='beast.evolution.substitutionmodel.JTT.eigenSystem'
                     mainid='JTT.s:$(n)'><!--value spec='XML'-->
            <![CDATA[<plugin spec='JTT' id='JTT.s:$(n)'/>]]></subtemplate>
        <subtemplate id='cpREV' class='beast.evolution.substitutionmodel.CPREV'
                     suppressInputs='beast.evolution.substitutionmodel.CPREV.eigenSystem'
                     mainid='CPREV.s:$(n)'><!--value spec='XML'-->
            <![CDATA[<plugin spec='CPREV' id='CPREV.s:$(n)'/>]]></subtemplate>
        <subtemplate id='mtREV' class='beast.evolution.substitutionmodel.MTREV'
                     suppressInputs='beast.evolution.substitutionmodel.MTREV.eigenSystem'
                     mainid='MTREV.s:$(n)'><!--value spec='XML'-->
            <![CDATA[<plugin spec='MTREV' id='MTREV.s:$(n)'/>]]></subtemplate>
        <subtemplate id='WAG' class='beast.evolution.substitutionmodel.WAG'
                     suppressInputs='beast.evolution.substitutionmodel.WAG.eigenSystem'
                     mainid='WAG.s:$(n)'><!--value spec='XML'-->
            <![CDATA[<plugin spec='WAG' id='WAG.s:$(n)'/>]]></subtemplate>

        <!-- binary model -->
        <subtemplate id='MutationDeathModel' class='beast.evolution.substitutionmodel.MutationDeathModel'
                     mainid='MutationDeathModel.s:$(n)'
                     suppressInputs="beast.evolution.substitutionmodel.MutationDeathModel.substmodel,beast.evolution.substitutionmodel.MutationDeathModel.frequencies">
            <![CDATA[
		<plugin id='MutationDeathModel.s:$(n)' spec='beast.evolution.substitutionmodel.MutationDeathModel'>
			<parameter name='deathprob' id='deathprob.s:$(n)' value='0.1' estimate='false'/>
			<frequencies id='freqs.s:$(n)' spec='Frequencies'>
				<frequencies spec='parameter.RealParameter' value='1 0'/>
			</frequencies>
		</plugin>
]]>
        </subtemplate>


        <!-- frequency models -->
        <subtemplate id='Estimated' class='beast.evolution.substitutionmodel.Frequencies'
                     mainid='estimatedFreqs.s:$(n)'>
            <![CDATA[
            <frequencies id='estimatedFreqs.s:$(n)' spec='Frequencies'>
                <frequencies id='freqParameter.s:$(n)' spec='parameter.RealParameter' dimension='4' value='0.25' lower='0' upper='1'/>
            </frequencies>

	        <plugin id='FrequenciesExchanger.s:$(n)' spec='DeltaExchangeOperator' delta="0.01" weight="0.1" parameter="@freqParameter.s:$(n)"/>
]]>
            <connect srcID='freqParameter.s:$(n)' targetID='state' inputName='stateNode'
                     if='inposterior(estimatedFreqs.s:$(n)) and inposterior(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>
            <connect srcID='FrequenciesExchanger.s:$(n)' targetID='mcmc' inputName='operator'
                     if='inposterior(estimatedFreqs.s:$(n)) and inposterior(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'>
                Exchange values of frequencies of partition s:$(n)
            </connect>
            <connect srcID='freqParameter.s:$(n)' targetID='tracelog' inputName='log'
                     if='inposterior(estimatedFreqs.s:$(n)) and inposterior(freqParameter.s:$(n)) and freqParameter.s:$(n)/estimate=true'/>
        </subtemplate>

        <subtemplate id='Empirical' class='beast.evolution.substitutionmodel.Frequencies'
                     mainid='empiricalFreqs.s:$(n)'>
            <![CDATA[
            <frequencies id='empiricalFreqs.s:$(n)' spec='Frequencies' data='@$(n)' estimate='true'/>
]]>
        </subtemplate>

        <subtemplate id='AllEqual' class='beast.evolution.substitutionmodel.Frequencies' mainid='equalFreqs.s:$(n)'>
            <![CDATA[
            <frequencies id='equalFreqs.s:$(n)' spec='Frequencies' data='@$(n)' estimate='false'/>
]]>
        </subtemplate>
    </mergewith>
    
    
</beast>