Skip to content

I added a new tutorial#141

Open
nicocastillorod wants to merge 5 commits intosourcefrom
hisse_tutorial
Open

I added a new tutorial#141
nicocastillorod wants to merge 5 commits intosourcefrom
hisse_tutorial

Conversation

@nicocastillorod
Copy link
Copy Markdown

Hi, I added a tutorial entitled "Hypothesis testing of state-dependent diversification with a full HiSSE model" for the SSE section.


}

for (j in 1:NUM_HIDDEN) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation seems a bit weird here.

Comment thread tutorials/sse/scripts/hisse4_tp.Rev Outdated
nStates = NUM_RATES)

# clamp the model with the "observed" tree
hisse.clamp(observed_phylogeny)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean hisse4.clamp( )? Right now the script will not run.

moves.append(mvSlice(q_1A1B, window = 0.1, weight=2, search_method = "stepping_out"))
moves.append(mvSlice(q_1B1A, window = 0.1, weight=2, search_method = "stepping_out"))

# first initialize the matrix with all zeros:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation seems wrong here.

moves.append(mvSlide(extinction_beta[i],delta=0.20,tune=true,weight=2.0))

}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong indentation here also.

rate_sd <- 2 * half_sd

# Create a normal distributed variable for the diversification and turnover rates

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing indentation

moves.append(mvSlice(extinction_alpha[i],window = 0.1, weight=2, search_method = "stepping_out"))
}

for (i in 1:(NUM_HIDDEN-1)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing indentation


}

for (j in 1:NUM_HIDDEN) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing indentation


# first initialize the matrix with all zeros:
for (i in 1:NUM_RATES) {
for (j in 1:NUM_RATES) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing indentation

q[3][4] := q_0B1B
q[3][1] := q_0B0A
q[4][3] := q_1B0B
q[4][2] := q_1B1A
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about this? I'm not entirely sure it has exactly the same speed, but maybe it is easier to read? Up to you.

q := [ [0,           q_0A1A,  q_0A0B, 0             ],
          [q_1A0A, 0,            0,             q_1A1B],
          [q_0B0A, 0,            0,             q_0B0B],
          [0,            q_1B1A, q_1B0B,  0            ] ]

@bredelings
Copy link
Copy Markdown
Contributor

Hi Nicolas, thank you for the new tutorial!

It would be really nice if we could add a test for this tutorial.

To add a test, we would do something like:

  • add a new line that reads hisse_8_transitions.Rev to sse/tests.txt
  • ensure that the the script tutorials/run_tutorial_tests.sh runs the script for exactly 1 iteration.

The last part is a bit tricky, since you don't specify an iteration number for your mcmc.run command.

@nicocastillorod
Copy link
Copy Markdown
Author

Hi Ben! Thank you for your review! I fixed the indentation and added hisse_8_transitions.Rev to sse/tests.txt. I ran the tutorials/run_tutorial_tests.sh script in my computer, and it passed without any additional changes to the script.

moves.append(mvSlice(q_1D1C, window = 0.1, weight=2, search_method = "stepping_out"))

# first initialize the matrix with all zeros:
for (i in 1:NUM_RATES) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation is still wrong here

@bredelings
Copy link
Copy Markdown
Contributor

Hi Nicolas, some of the other comments are not addressed yet.

If you add the current script to the tests without modifying it, then the tests will become very slow. So we need to figure out how to make the run_tutorial_tests.sh script run your test for only 1 iteration.

For other scripts, the run_tutorial_tests.sh makes a copy, modifies the number of iterations to be 1, and then runs the copy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants