Uh oh!
There was an error while loading. Please reload this page.
Implementing gemmi-based mmcif reader (with easy extension to PDB/PDBx and mmJSON) - #4712
Implementing gemmi-based mmcif reader (with easy extension to PDB/PDBx and mmJSON)#4712marinegor wants to merge 154 commits into
gemmi-based mmcif reader (with easy extension to PDB/PDBx and mmJSON)#4712Conversation
Hello @marinegor! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2024-10-25 11:17:29 UTC |
Linter Bot Results:Hi @marinegor! Thanks for making this PR. We linted your code and found the following: Some issues were found with the formatting of your code.
Please have a look at the Please note: The |
richardjgowers
left a comment
There was a problem hiding this comment.
Looks good so far, will require a small test file to check reader/parser halves.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
IAlibay
commented
Jul 12, 2026
@orbeckst can you give me until Tuesday please? I agree it's an important feature and I do want to review it, however there's some other high priority items within MDAnalysis that needs addressing first. Either way, I'm not going to be releasing a be version of MDAnalysis until after the 17th - so it not being merged until then isn't an issue. |
orbeckst
commented
Jul 12, 2026
Ok |
IAlibay
left a comment
There was a problem hiding this comment.
Sorry for the very brief review, mostly cleaning things to do.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Documentation build overview
109 files changed · |
Atoms without altLocs in the MMCIF will have null bytes assigned to their altLoc attribute. When writing the structure out to PDB, it includes those null bytes, in violation of the PDB spec (not that this have stopped anyone before). Not fully sure of the consequences but figured I'd raise it before it's merged. Altered tail of 1BD2.cif to include non-null altLocs: Tail of reconstructed PDB (but \0 is actually a null byte) You can recreate this with the following: https://gist.github.com/ianmkenney/624300e0395bcf2c918c2fa8b92fd86e Just clone MDA and check out the PR head next to the Makefile and run |
Uh oh!
There was an error while loading. Please reload this page.
BradyAJohnston
commented
Aug 19, 2026
Everything should now be addressed - but I can't figure out why |
orbeckst
commented
Sep 1, 2026
IAlibay
commented
Sep 1, 2026
Thanks for the ping (sorry I didn't see the earlier changes, travelling for conferences). I'll aim to review by end of the week. |
orbeckst
left a comment
There was a problem hiding this comment.
Very briefly skimmed and I might well be overlooking something so, just as comments:
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
IAlibay
left a comment
There was a problem hiding this comment.
There's unfortunately quite a few things that still need addressing.
Please feel free to open follow-up issues for some of these.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| [tool.setuptools.packages.find] | ||
| namespaces = false | ||
| [tool.setuptools.package-data] |
There was a problem hiding this comment.
Missing data/mmcif/*.gz and data/mmcif/*.cif entries.
| | MDAnalysis/coordinates/MMCIF\.py | ||
| | MDAnalysis/topology/MMCIFParser\.py |
There was a problem hiding this comment.
Should these be excluded from black, is the black to un-exclude these in a follow-up PR?
| DSSP = (_data_ref / "dssp").as_posix() | ||
| # MMCIF data: valid structures from RCSB and generated by Biopython | ||
| MMCIF = (_data_ref / "mmcif").as_posix() |
There was a problem hiding this comment.
This breaks the convention we use everywhere else for datafiles (and I notice that the DSSP one does too...).
It's fine if this ships as-is, but I would like this to be raised as an issue to be fixed in a follow-up PR please.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| "pyedr>=0.7.0", | ||
| "pytng>=0.2.3", | ||
| "gsd>3.0.0", | ||
| "gemmi>=0.7.3", # for mmcif format |
There was a problem hiding this comment.
| "gemmi>=0.7.3", # for mmcif format | |
| "gemmi>=0.7.3", # for mmcif format |
[nit] 2 spaces to keep with standard python formatting, either that or remove the comment - we don't do this for any other file format.
| serials.append(atom.serial) | ||
| names.append(atom.name) | ||
| chainids.append(chain.name) | ||
| elements.append(atom.element.name) |
There was a problem hiding this comment.
In the PDB parser, we:
- Check if the capitalized element is in SYMB2Z
- Store the capitalized element
Do we need to do either of these here?
| AltLocs(altlocs), | ||
| Atomids(serials), | ||
| Atomnames(names), | ||
| Atomtypes(names), |
There was a problem hiding this comment.
In the PDBParser, we use elements for AtomType, not names. Should this not be doing the same thing?
Fixes#2367 and also extends #4303 and solves #5089
Changes made in this Pull Request:
gemmilibrary (link) to parse mmcif filesclass MMCIFReader(base.SingleFrameReaderBase)andclass MMCIFParser(TopologyReaderBase)classes for thatAs a bonus, this implementation would potentially allow to read any of the gemmi-supported formats (source):
Also, this (with slight modifications) also would allow reading mmcif with multiple models sharing the same topology, as well as more feature-rich parsing of PDBs (the same code without changes can be used for parsing altlocs, charges, etc, from all of these formats).
However, I'm slightly lost on what's to be done next for this PR to be merged, so I'm asking if someone could help me navigate here (tagging @richardjgowers here as author of original PDBx implementation 4303).
PR Checklist
Developers certificate of origin
📚 Documentation preview 📚: https://mdanalysis--4712.org.readthedocs.build/en/4712/