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

Hide BiopythonDeprecationWarnings when reading certain sequence files #1731

Open
wants to merge 3 commits into
base: victorlin/centralize-sequence-read
Choose a base branch
from

Conversation

victorlin
Copy link
Member

@victorlin victorlin commented Jan 17, 2025

Description of proposed changes

Biopython 1.85 shows a deprecation warning when using format='fasta' with files that start with anything but '>'.

The warning as-is should not be exposed to Augur users. It is not triggered when reading files with format='fasta-pearson', so this is the easiest thing to do continue accepting such files for Biopython >=1.85.

This way, Augur users get consistent, backwards compatible behavior no matter the Biopython version they use.

Related issue(s)

Fixes #1727

Checklist

@victorlin victorlin self-assigned this Jan 17, 2025
@victorlin victorlin marked this pull request as ready for review January 17, 2025 23:26
@corneliusroemer corneliusroemer linked an issue Jan 20, 2025 that may be closed by this pull request
@corneliusroemer
Copy link
Member

Suggestion for this elegant solution with version switch is from @tsibley: #1727 (comment)

augur/ancestral.py Outdated Show resolved Hide resolved
Copy link
Member

@corneliusroemer corneliusroemer left a comment

Choose a reason for hiding this comment

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

A unit test testing that a variety of fasta's are supported would be cool maybe, we already know that our integration tests catch it, but not unit ones.

@victorlin victorlin force-pushed the victorlin/centralize-sequence-read branch from 63cdf89 to cc365cb Compare January 21, 2025 21:11
@victorlin victorlin force-pushed the victorlin/fix-ci branch 2 times, most recently from 945011a to b031ce6 Compare January 21, 2025 23:59
@victorlin victorlin force-pushed the victorlin/centralize-sequence-read branch from cc365cb to 8fa862a Compare January 21, 2025 23:59
@victorlin victorlin force-pushed the victorlin/centralize-sequence-read branch from 8fa862a to cf5c8be Compare January 22, 2025 00:33
@victorlin victorlin force-pushed the victorlin/centralize-sequence-read branch from cf5c8be to fbb56fe Compare January 22, 2025 01:35
Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (victorlin/centralize-sequence-read@42a5b6f). Learn more about missing BASE report.

Additional details and impacted files
@@                          Coverage Diff                          @@
##             victorlin/centralize-sequence-read    #1731   +/-   ##
=====================================================================
  Coverage                                      ?   73.05%           
=====================================================================
  Files                                         ?       79           
  Lines                                         ?     8333           
  Branches                                      ?     1700           
=====================================================================
  Hits                                          ?     6088           
  Misses                                        ?     1958           
  Partials                                      ?      287           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

augur/io/sequences.py Outdated Show resolved Hide resolved
@victorlin victorlin force-pushed the victorlin/centralize-sequence-read branch from fbb56fe to e7ed6a7 Compare January 22, 2025 22:51
Instead of relying on Biopython's which are subject to change across
versions.
Biopython 1.85 shows a deprecation warning when using format='fasta'
with files that start with anything but '>'.

The warning as-is should not be exposed to Augur users. It is not
triggered when reading files with format='fasta-pearson', so this is the
easiest thing to do continue accepting such files for Biopython
>=1.85.

This way, Augur users get consistent, backwards compatible behavior no
matter the Biopython version they use.
This reverts "Temporarily disable failing test" (f5323be) which should no longer fail after previous changes.
@victorlin victorlin force-pushed the victorlin/centralize-sequence-read branch from e7ed6a7 to 42a5b6f Compare January 23, 2025 19:08
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.

CI failing with new BioPython deprecation warning
3 participants