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

pdbx get_sequence return dict of seq #611

Merged
merged 10 commits into from
Jun 28, 2024

Conversation

tjmier
Copy link
Contributor

@tjmier tjmier commented Jun 24, 2024

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:

seq_dict = get_sequences(my_cif)
chain_A_seq = seq_dict["A"]

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.

@padix-key
Copy link
Member

For reference: This is the continuation of #600

@padix-key padix-key self-requested a review June 25, 2024 07:38
@padix-key
Copy link
Member

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 padix-key merged commit 2331695 into biotite-dev:master Jun 28, 2024
20 checks passed
@tjmier
Copy link
Contributor Author

tjmier commented Jul 2, 2024

Excellent! Thank you for your patience. I learned a lot despite this being such a small change.

@tjmier tjmier deleted the get_sequence_by_chainid branch July 2, 2024 20:18
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