fix: write molecular_clock.txt in clock command - #575
Merged
Conversation
The clock command printed the rate estimate to stdout but never saved it to a file, unlike the timetree command which writes molecular_clock.txt. Add the same file output to estimate_clock_model() and extract shared save_molecular_clock() helper used by both commands. Closes #574
The print message for the molecular clock file incorrectly said "Inferred sequence evolution model" -- a copy-paste from the GTR block above. Fix to say "Inferred molecular clock model".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: write molecular_clock.txt in clock command
The
treetime clockcommand prints the rate estimate to stdout but never saves it to a file, despite the documentation listing "a text-file with the rate estimate" among the output files. Thetimetreecommand already writes this file via inline code.Extract a shared
save_molecular_clock()helper [src] that writesmolecular_clock.txtand prints a confirmation message. Use it in bothestimate_clock_model()[src] andrun_timetree()[src], replacing the duplicated inline file-writing code.The
run_timetreeprint message formolecular_clock.txtincorrectly said "Inferred sequence evolution model" -- a copy-paste from the GTR block directly above it. The shared helper now prints a consistent--- molecular clock model (saved as ...)message for both commands.Verification
Before (clock command produces no
molecular_clock.txt):After:
Work items
molecular_clock.txtoutput toestimate_clock_model()save_molecular_clock()helper to deduplicate file-writing betweenclockandtimetreerun_timetree()for the molecular clock filePossible improvements
sequence_evolution_model.txtsaves inrun_timetree[src] andancestral_reconstruction[src] to use---prefix (both use'\nInferred ...'while all other file-save messages use'--- ...')