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

#999 cif parsing #1001

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
#999 _chem_comp can be defined on mmCIF files
The code was assuming that the _chem_comp property was only available
for non macromolecular structures (such as cif
files for hetero atoms entities).
It appears that some PDB files (e.g. `32C2`) may define
a _chem_comp loop around every
chemical component such as its amino-acids.
This breaks the previous code as `cif.chem_comp` then contains
an array of strings instead of a string.
The fix here is to assume that if `struct` is present then we should not
enter in the block for parsing simple entities.
ppillot committed Nov 19, 2023
commit 82950b46d2ec8f757eb57cd07c767745de76b496
2 changes: 1 addition & 1 deletion src/parser/cif-parser.ts
Original file line number Diff line number Diff line change
@@ -1072,7 +1072,7 @@ class CifParser extends StructureParser {
_parseChunkOfLines(0, lines.length, lines)
})

if (cif.chem_comp && cif.chem_comp_atom) {
if (cif.chem_comp && cif.chem_comp_atom && !cif.struct) {
parseChemComp(cif, s, sb)
sb.finalize()
s.finalizeAtoms()