Skip to content

Commit

Permalink
fix: some entities might be defined but not have any coordinates
Browse files Browse the repository at this point in the history
In that case the `chainIndexDict` does not have the corresponding key.
This fix still creates the corresponding `Entity` but with an empty chain list.
  • Loading branch information
papillot committed May 24, 2024
1 parent ac675d2 commit cc34e1d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/parser/cif-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -844,8 +844,9 @@ function processEntities (cif: CifCategories, structure: Structure, chainIndexDi
const descriptionField = e.getField('pdbx_description')!
const typeField = e.getField('type')!
const n = e.rowCount
for (let i = 0; i < n; ++i) {
const chainIndexList: number[] = Array.from(chainIndexDict[ idField.int(i) ])
for (let i = 0; i < n; ++i) {
// 7a4p has a missing entity in chainIndexDict (entity 20 has no coordinates)
const chainIndexList: number[] = Array.from(chainIndexDict[ idField.int(i) ] ?? [])
structure.entityList[ i ] = new Entity(
structure, i, descriptionField?.str(i), typeField.str(i) as EntityTypeString, chainIndexList
)
Expand Down

0 comments on commit cc34e1d

Please sign in to comment.