Extend PDBList obsolete handling to mmCIF, XML and assemblies (#3988)#5177
Open
Abdeltoto wants to merge 2 commits intobiopython:masterfrom
Open
Extend PDBList obsolete handling to mmCIF, XML and assemblies (#3988)#5177Abdeltoto wants to merge 2 commits intobiopython:masterfrom
Abdeltoto wants to merge 2 commits intobiopython:masterfrom
Conversation
Fix update_pdb to use correct filenames for each format (pdb, mmCif, xml). Add _move_obsolete_assemblies to move assembly files when structure becomes obsolete. Skip mmtf/bundle (obsolete not available). Fix pl -> self bug. Replace asserts with if/raise. Closes biopython#3988 Made-with: Cursor
for more information, see https://pre-commit.ci
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.
Hi,
I worked on issue #3988. The idea was to extend the obsolete file handling in
update_pdbso it works with mmCIF and XML formats (not just PDB), and to move assembly files when a structure becomes obsolete.Changes made:
Correct filenames for each format – The old code used
pdb{pdb_code}.{file_format}for all formats, which was wrong. mmCIF files are{pdb_code}.cif, XML are{pdb_code}.xml, PDB arepdb{pdb_code}.ent. I added a_get_obsolete_filenamehelper that returns the right name for each format.mmtf and bundle – Obsolete structures are not available in mmtf (as noted in the docstring). For these formats we skip the obsolete move step.
Assembly files – When
with_assemblies=Trueand a structure becomes obsolete, we now also move the corresponding assembly files (e.g.{pdb_code}-assembly1.cifor{pdb_code}.pdb1) to the obsolete folder.Bug fix – Replaced
pl.retrieve_assembly_filewithself.retrieve_assembly_filein the new/modified download loop.Assert replacement – Replaced the asserts on
local_pdbandobsolete_pdbwith explicitif/raise ValueError(consistent with Do not use assert outside of testing code #3600).Closes #3988