Skip to content

Key the random local clock's rates prior to its clock partition - #222

Merged
walterxie merged 1 commit into
masterfrom
fix/rlc-rates-prior-id
Nov 9, 2026
Merged

walterxie merged 1 commit into
masterfrom
fix/rlc-rates-prior-id

Conversation

@alexeid

@alexeid alexeid commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

In beast-fx/.../fxtemplates/ClockModels.xml the random local clock's rates prior has id RRatesPrior.c:s$(n). Its connect rule is generated from the same id, so it is added correctly at first. But .c:s$(n) doesn't match the .c:$(n) pattern in BeautiDoc.translatePartitionNames, so $(n) becomes the data partition's name rather than the clock's.

After renaming the data partition, the rule looks for RRatesPrior.c:s<newname>. Switching the clock away from the random local clock then leaves the old prior in the analysis, on clockrates that are no longer in the model. The posterior is unaffected (the parameter is fixed), but the logged prior is off and the XML carries a dangling prior.

This PR drops the stray s, and updates the id expected by SimpleClockModelTest (currently @Disabled).

Tested in BEAUti 3 (master + this change): with the change, after a random local clock, renaming the data partition and switching to a strict clock, no random local clock prior is left behind; without it, RRatesPrior.c:s<oldname> remains. BEAST 3 accepts the XML either way. mvn -pl beast-fx test passes.

The same fix (plus the mean-rate prior id, already correct here) is CompEvol/BeastFX#114 for BEAST 2.7. Found while comparing BEAST 2.7.9 and BEAST 3 analyses built in BEAUti (CompEvol/beast3-test, C15).

RRatesPrior.c:s$(n) does not match the .c:$(n) pattern, so BEAUti fills
in $(n) with the data partition's name instead of the clock's. After the
data partition is renamed, the rule looks for RRatesPrior.c:s<newname>,
so switching the clock away from the random local clock leaves the old
prior in the analysis, on clock rates that are no longer in the model.
The same fix is in CompEvol/BeastFX#114 for BEAST 2.7.
@walterxie
walterxie merged commit b4c3161 into master Nov 9, 2026
1 check passed
@walterxie
walterxie deleted the fix/rlc-rates-prior-id branch November 9, 2026 23:06
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.

2 participants