-
Notifications
You must be signed in to change notification settings - Fork 105
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
pdbx get_sequence return dict of seq #611
Merged
padix-key
merged 10 commits into
biotite-dev:master
from
tjmier:get_sequence_by_chainid
Jun 28, 2024
Merged
pdbx get_sequence return dict of seq #611
padix-key
merged 10 commits into
biotite-dev:master
from
tjmier:get_sequence_by_chainid
Jun 28, 2024
Conversation
This file contains 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
'get_sequence' in the module 'biotite.structure.io.pdb' to return a dictionary mapping chain_id to the sequence
with entity_poly.pdbx_strand_id as keys. Updated test_pdx.py test_get_sequence to reflect returning a dict instead of a list
For reference: This is the continuation of #600 |
padix-key
approved these changes
Jun 25, 2024
Looks good to me. I will keep this PR open until patch version 0.41.2 was released (due to #605), which should arrive in the upcoming days. |
padix-key
reviewed
Jun 28, 2024
Excellent! Thank you for your patience. I learned a lot despite this being such a small change. |
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.
Accidentally deleted my last pull request on this topic.
Purpose:
Modified biotite.structure.io.pdbx.get_sequence to return a dictionary of sequences instead of a list. This change provides a more intuitive way to access sequences by their chain identifiers.
Details:
Old Behavior: Returned a list of sequences.
New Behavior: Returns a dictionary where keys are derived from entity_poly.pdbx_strand_id (often equivalent to chain_id and atom_site.auth_asym_id in most cases). Dictionary values are the corresponding sequences.
Example Usage:
Rationale:
The change in return type improves the usability of the function by allowing direct access to sequences using chain identifiers, which is a common use case.
Impact:
This change is non-backwards compatible. Code that relies on the previous list-based return type will need to be updated.
Tests and examples have been updated to reflect this change in return type.