Skip to content

Commit fbada95

Browse files
authored
Merge pull request #89 from revbayes/more-tests
More tests.
2 parents 658413e + ca6a6e5 commit fbada95

File tree

14 files changed

+30
-24
lines changed

14 files changed

+30
-24
lines changed

tutorials/fbd_simple/tests.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FBD_tutorial.Rev

tutorials/host_rep/host_rep.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -119,60 +119,60 @@ In this tutorial we are going to perform the analysis with two different host tr
119119
Now, let's begin.
120120

121121
First, create file management variables for input
122-
122+
{% snippet scripts/run_nymphalini.Rev %}
123123
phy_host_fn = "data/angio_25tips_time.phy"
124124
phy_parasite_fn = "data/Nymphalini.phy"
125125
dat_parasite_fn = "data/interaction_matrix.nex"
126-
126+
{% endsnippet %}
127127
then read in our character data
128-
128+
{% snippet scripts/run_nymphalini.Rev %}
129129
dat_parasite <- readDiscreteCharacterData(dat_parasite_fn)
130-
130+
{% endsnippet %}
131131
For this tutorial we'll assume we know the host and parasite phylogenies without error. Note that our host repertoire inference method uses a root branch length to estimate the stationary probabilities at the root node. Our parasite tree file (`Nymphalini.phy`) is modified to have a branch length assigned to the root node. If you provide a tree without a root branch length, the software will consider it to be the same length as the tree height.
132-
132+
{% snippet scripts/run_nymphalini.Rev %}
133133
phy_parasite <- readTrees(phy_parasite_fn)[1]
134-
134+
{% endsnippet %}
135135
Here is where you can change the host tree to `angio_25tips_bl1.phy` when you repeat the analysis
136-
136+
{% snippet scripts/run_nymphalini.Rev %}
137137
phy_host <- readTrees(phy_host_fn)[1]
138-
138+
{% endsnippet %}
139139
Retrieve dataset dimensions
140-
140+
{% snippet scripts/run_nymphalini.Rev %}
141141
n_host_tips <- phy_host.ntips()
142142
n_host_branches <- 2 * n_host_tips - 2
143143
n_parasite_branches <- 2 * phy_parasite.ntips() - 2
144144
n_sites <- dat_parasite.nchar()
145-
145+
{% endsnippet %}
146146
Add more information to the name of output files
147-
147+
{% snippet scripts/run_nymphalini.Rev %}
148148
out_str = "out.time"
149149
out_fn = "output/" + out_str
150-
150+
{% endsnippet %}
151151
We need to create vectors of *moves* and *monitors* to later inform how our Markov chain Monte Carlo (MCMC) analysis needs to propose and sample new model parameters and host repertoire histories. Also, we use monitors to record the information we want to use
152-
152+
{% snippet scripts/run_nymphalini.Rev %}
153153
moves = VectorMoves()
154154
monitors = VectorMonitors()
155-
155+
{% endsnippet %}
156156
Next, we'll build the transition rate matrix for the model. In this example, the rate matrix requires four rates: two gain rates (0->1 and 1->2) and two loss rates (1->0 and 2->1).
157157

158158
First, create a vector containing all transition rates and assign it a move
159-
159+
{% snippet scripts/run_nymphalini.Rev %}
160160
switch_rates_pos ~ dnDirichlet( [1,1,1,1] )
161161
moves.append( mvSimplex(switch_rates_pos, alpha=10, weight=2, tune=false) )
162-
162+
{% endsnippet %}
163163
We'll now create a set of deterministic nodes to help us map our simplex of transition rates onto specific host gain and loss events
164-
164+
{% snippet scripts/run_nymphalini.Rev %}
165165
switch_rate_0_to_1 := switch_rates_pos[1]
166166
switch_rate_0_to_2 := 0.
167167
switch_rate_1_to_0 := switch_rates_pos[2]
168168
switch_rate_1_to_2 := switch_rates_pos[3]
169169
switch_rate_2_to_0 := 0.
170170
switch_rate_2_to_1 := switch_rates_pos[4]
171-
171+
{% endsnippet %}
172172
Next, we assemble our named rate variables into a vector
173-
173+
{% snippet scripts/run_nymphalini.Rev %}
174174
switch_rates := v( switch_rate_0_to_1, switch_rate_0_to_2, switch_rate_1_to_0, switch_rate_1_to_2, switch_rate_2_to_0, switch_rate_2_to_1 )
175-
175+
{% endsnippet %}
176176
We then construct a rate matrix for three states (0: non-host, 1: potential host, 2: actual host) using our vector of named rates. We found that the MCMC mixes better when the Q matrix is not rescaled such that the expected number of events per unit time per character is 1 (`rescaled=false`). This might not be true for every data set and you can always change it to `rescaled=true`.
177177

178178
Q_char := fnFreeK( transition_rates=switch_rates, rescaled=false )

tutorials/intro/tests.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
linear_regression_generative.Rev
2+
linear_regression.Rev

tutorials/intro_posterior_prediction/index.md

100755100644
File mode changed.

tutorials/intro_posterior_prediction/pps_SingleNormal_results.txt

100755100644
File mode changed.

tutorials/intro_posterior_prediction/pps_TwoNormals_fullMCMC_results.txt

100755100644
File mode changed.

tutorials/intro_posterior_prediction/pps_TwoNormals_results.txt

100755100644
File mode changed.

tutorials/intro_posterior_prediction/twoNormals_means.log

100755100644
File mode changed.

tutorials/intro_posterior_prediction/twoNormals_posterior.log

100755100644
File mode changed.

tutorials/intro_posterior_prediction/twoNormals_sds.log

100755100644
File mode changed.

0 commit comments

Comments
 (0)