Skip to content

Extend PDBList obsolete handling to mmCIF, XML and assemblies (#3988)#5177

Open
Abdeltoto wants to merge 2 commits intobiopython:masterfrom
Abdeltoto:feat/pdblist-obsolete-mmCif-mmtf
Open

Extend PDBList obsolete handling to mmCIF, XML and assemblies (#3988)#5177
Abdeltoto wants to merge 2 commits intobiopython:masterfrom
Abdeltoto:feat/pdblist-obsolete-mmCif-mmtf

Conversation

@Abdeltoto
Copy link
Copy Markdown

Hi,

I worked on issue #3988. The idea was to extend the obsolete file handling in update_pdb so it works with mmCIF and XML formats (not just PDB), and to move assembly files when a structure becomes obsolete.

Changes made:

  1. 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 are pdb{pdb_code}.ent. I added a _get_obsolete_filename helper that returns the right name for each format.

  2. mmtf and bundle – Obsolete structures are not available in mmtf (as noted in the docstring). For these formats we skip the obsolete move step.

  3. Assembly files – When with_assemblies=True and a structure becomes obsolete, we now also move the corresponding assembly files (e.g. {pdb_code}-assembly1.cif or {pdb_code}.pdb1) to the obsolete folder.

  4. Bug fix – Replaced pl.retrieve_assembly_file with self.retrieve_assembly_file in the new/modified download loop.

  5. Assert replacement – Replaced the asserts on local_pdb and obsolete_pdb with explicit if/raise ValueError (consistent with Do not use assert outside of testing code #3600).

Closes #3988

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
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.

Extend PDBList obsolete handling to mmCIF and mmtf formats as well as assemblies

1 participant