Update protein.py#1174
Merged
Merged
Conversation
GzipFile reads files as objects ('rb' mode, text not implemented), therefore the .split() contains a "b" character in front.
The solution proposed is decoding the byte into strings.
JAGulin
reviewed
Sep 28, 2022
| @@ -73,17 +73,17 @@ | |||
| last_chain_label = None | |||
| for line in infile: | |||
| line = line.split() | |||
There was a problem hiding this comment.
This old example fails for me too, but I'd rather suggest converting the line in one go and drop the other changes. E.g.
line = line.decode("utf-8").split()
Member
There was a problem hiding this comment.
Yes I agree, this is much easier and works.
JAGulin
suggested changes
Sep 28, 2022
JAGulin
left a comment
There was a problem hiding this comment.
When updating anyway, the download URL should be changed to
https://files.rcsb.org/pub/pdb/data/structures/divided/pdb/q0/pdb%s.ent.gz
according to the documentation on
prabhuramachandran
requested changes
Oct 17, 2022
prabhuramachandran
left a comment
Member
There was a problem hiding this comment.
Thank you, I agree with @JAGulin that the one-line fix is much easier.
| @@ -73,17 +73,17 @@ | |||
| last_chain_label = None | |||
| for line in infile: | |||
| line = line.split() | |||
Member
There was a problem hiding this comment.
Yes I agree, this is much easier and works.
Change the URL and also make the required changes.
prabhuramachandran
approved these changes
Oct 17, 2022
Member
|
I have made the necessary changes myself. Will fire the builds now. |
This file contains hidden or 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
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.
GzipFile reads files as objects ('rb' mode, text not implemented), therefore the .split() contains a "b" character in front. The solution proposed is decoding the byte into strings.