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

ancestral, translate: GFF parsing broken with Biopython >=1.82 #1373

Closed
victorlin opened this issue Dec 22, 2023 · 1 comment · Fixed by #1400
Closed

ancestral, translate: GFF parsing broken with Biopython >=1.82 #1373

victorlin opened this issue Dec 22, 2023 · 1 comment · Fixed by #1400
Labels
bug Something isn't working

Comments

@victorlin
Copy link
Member

victorlin commented Dec 22, 2023

Scope

  • When VCF is used in augur translate --alignment
  • All usage of augur translate

Details

Biopython 1.82 was released a few hours ago which removed a deprecated feature in the SeqFeature API which is used indirectly in Augur through another dependency, BCBio (upstream issue). See failing CI for details.

Error message for search-ability:

Traceback (most recent call last):
  File "/home/runner/work/augur/augur/augur/__init__.py", line 66, in run
    return args.__command__.run(args)
  File "/home/runner/work/augur/augur/augur/translate.py", line 405, in run
    features = load_features(args.reference_sequence, genes)
  File "/home/runner/work/augur/augur/augur/utils.py", line 174, in load_features
    return _read_gff(reference, feature_names)
  File "/home/runner/work/augur/augur/augur/utils.py", line 277, in _read_gff
    gff_entries = list(GFF.parse(in_handle, limit_info={'gff_type': valid_types}))
  File "/home/runner/miniconda3/envs/test/lib/python3.10/site-packages/BCBio/GFF/GFFParser.py", line 793, in parse
    for rec in parser.parse_in_parts(gff_files, base_dict, limit_info,
  File "/home/runner/miniconda3/envs/test/lib/python3.10/site-packages/BCBio/GFF/GFFParser.py", line 337, in parse_in_parts
    cur_dict = self._results_to_features(cur_dict, results)
  File "/home/runner/miniconda3/envs/test/lib/python3.10/site-packages/BCBio/GFF/GFFParser.py", line 376, in _results_to_features
    base = self._add_parent_child_features(base, results.get('parent', []),
  File "/home/runner/miniconda3/envs/test/lib/python3.10/site-packages/BCBio/GFF/GFFParser.py", line 462, in _add_parent_child_features
    cur_parent, base = self._add_toplevel_feature(base, cur_parent_dict)
  File "/home/runner/miniconda3/envs/test/lib/python3.10/site-packages/BCBio/GFF/GFFParser.py", line 582, in _add_toplevel_feature
    new_feature = self._get_feature(feature_dict)
  File "/home/runner/miniconda3/envs/test/lib/python3.10/site-packages/BCBio/GFF/GFFParser.py", line 591, in _get_feature
    new_feature = SeqFeature.SeqFeature(location, feature_dict['type'],
TypeError: SeqFeature.__init__() got an unexpected keyword argument 'strand'


An error occurred (see above) that has not been properly handled by Augur.
To report this, please open a new issue including the original command and the error above:
    <https://github.com/nextstrain/augur/issues/new/choose>

Possible solutions

In the meantime, users should downgrade to an earlier version of Biopython.

  • Short-term: mark 1.82 as unsupported
    • Instead of releasing a major version of Augur, apply this to Nextstrain's managed runtimes.
  • Long-term: Submit a patch to bcbio-gff and hope it gets released.
@victorlin victorlin added the bug Something isn't working label Dec 22, 2023
@victorlin victorlin changed the title translate: Incompatible with Biopython 1.82 ancestral, translate: GFF parsing broken with Biopython 1.82 Dec 22, 2023
@victorlin
Copy link
Member Author

victorlin commented Dec 26, 2023

There is also usage of the deprecated feature within Augur itself:

augur/augur/utils.py

Lines 210 to 212 in ad4ed1b

nuc['pragma'] = SeqFeature(
FeatureLocation(start, stop),
strand=1,

Currently looking into why Biopython's deprecation warning doesn't get surfaced when using Augur CLI.

EDIT: This is because BCBio's suppression of Biopython deprecation warnings applies to Augur as well, effective after its import in utils.py. Fixed with 05bff35.

@victorlin victorlin changed the title ancestral, translate: GFF parsing broken with Biopython 1.82 ancestral, translate: GFF parsing broken with Biopython >=1.82 Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant