Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix alignment filename assumptions #1206

Merged
merged 4 commits into from
May 4, 2023

Conversation

tsibley
Copy link
Member

@tsibley tsibley commented May 4, 2023

See commit messages.

Testing

  • Added cram test demonstrating failure
  • Manually confirmed fix

Checklist

  • Add a message in CHANGES.md summarizing the changes in this PR that are end user focused. Keep headers and formatting consistent with the rest of the file.

@tsibley tsibley requested a review from a team May 4, 2023 18:17
tsibley added 3 commits May 4, 2023 11:20
…g in .fasta

Applies only when using IQ-TREE.

Demonstrates an issue reported by Jon Bråte in a discussion post.¹

¹ <https://discussion.nextstrain.org/t/is-this-the-expected-behaviour-of-augur-tree/1375>
For example, .fa is another common suffix for FASTA filenames, but using
it in the input alignment filename here resulted in both the temporary
output alignment filename and the log file name being the same as the
input alignment filename.  This bug meant the input alignment file was
overwritten! (twice!) and tree building failed when using IQ-TREE with
such a filename.

We should assume as little as possible about filenames and use pathlib
for all manipulations.  The use of str.replace() here was particularly
naive as it wasn't even anchored to the end of the string.

The change here would read a bit cleaner if build_iqtree() used Path
objects internally instead of using strings, but that's a larger change
for another commit/time.

Reported by Jon Bråte in a discussion post.¹

¹ <https://discussion.nextstrain.org/t/is-this-the-expected-behaviour-of-augur-tree/1375>
…ommand

log_file was missed by "shell-quote all user-defined filenames"
(1b28739).

substition_model comes straight from the user via --substitution-model.
@tsibley tsibley force-pushed the trs/fix-alignment-filename-assumptions branch from 68778f0 to f523a50 Compare May 4, 2023 18:22
@codecov
Copy link

codecov bot commented May 4, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (631feb6) 68.81% compared to head (7b77437) 68.81%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1206   +/-   ##
=======================================
  Coverage   68.81%   68.81%           
=======================================
  Files          64       64           
  Lines        6936     6936           
  Branches     1693     1693           
=======================================
  Hits         4773     4773           
  Misses       1856     1856           
  Partials      307      307           
Impacted Files Coverage Δ
augur/tree.py 50.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@jameshadfield jameshadfield left a comment

Choose a reason for hiding this comment

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

Looks good by inspection

@tsibley tsibley merged commit e6a0c08 into master May 4, 2023
@tsibley tsibley deleted the trs/fix-alignment-filename-assumptions branch May 4, 2023 23:33
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