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

Update code for Biopython 1.84 compatibility #391

Merged
merged 19 commits into from
Jul 3, 2024

Conversation

MatBarba
Copy link
Contributor

@MatBarba MatBarba commented Jul 3, 2024

Remade #297 from the latest main.
Various type hints fixes along the way.

One big change: I've added a new GFFSeqFeature object, subclass of Bio.SeqFeature. The only difference is that this one has an additional attribute "sub_features" that the GFF parser adds.

By replacing every occurrence, we can make sure that we use the correct typing without ignoring the warnings. Bonus benefit: we no longer need to add sub_features = [] every time we create a SeqFeature object.

Other change, similar problem: we used to add an attribute organelle to the SeqRecord. I've changed it to store this information in the existing annotations instead.

I have set the biopython version to 1.3 for now

@MatBarba MatBarba requested a review from JAlvarezJarreta July 3, 2024 13:30
@JAlvarezJarreta JAlvarezJarreta added the enhancement New feature or request label Jul 3, 2024
Copy link
Contributor

@JAlvarezJarreta JAlvarezJarreta 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, thank you for updating this (annoying) change in Biopython 👍

pyproject.toml Outdated Show resolved Hide resolved
src/python/ensembl/io/genomio/genbank/extract_data.py Outdated Show resolved Hide resolved
src/python/ensembl/io/genomio/gff3/features.py Outdated Show resolved Hide resolved
src/python/ensembl/io/genomio/gff3/features.py Outdated Show resolved Hide resolved
src/python/ensembl/io/genomio/gff3/features.py Outdated Show resolved Hide resolved
Copy link
Contributor

@JAlvarezJarreta JAlvarezJarreta left a comment

Choose a reason for hiding this comment

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

Quite a nasty situation having to use cast in Python...

@MatBarba MatBarba requested a review from JAlvarezJarreta July 3, 2024 15:01
@JAlvarezJarreta JAlvarezJarreta changed the title Update code for Biopython 1.83 compatibility (new) Update code for Biopython 1.84 compatibility Jul 3, 2024
@JAlvarezJarreta JAlvarezJarreta merged commit b33d2f0 into main Jul 3, 2024
1 check passed
@JAlvarezJarreta JAlvarezJarreta deleted the mbarba/biopython_183_ready3 branch July 3, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants