Skip to content
Snippets Groups Projects
Commit beb1b265 authored by dsehnal's avatar dsehnal
Browse files

scan all entities when looking for struct_conn etries

- solves PDB loading issue
parent 6a81e48c
No related branches found
No related tags found
No related merge requests found
...@@ -111,24 +111,28 @@ export namespace StructConn { ...@@ -111,24 +111,28 @@ export namespace StructConn {
symmetry: struct_conn.ptnr2_symmetry symmetry: struct_conn.ptnr2_symmetry
}; };
const entityIds = Array.from(model.entities.data.id.toArray());
const _p = (row: number, ps: typeof p1) => { const _p = (row: number, ps: typeof p1) => {
if (ps.label_asym_id.valueKind(row) !== Column.ValueKind.Present) return void 0; if (ps.label_asym_id.valueKind(row) !== Column.ValueKind.Present) return void 0;
const asymId = ps.label_asym_id.value(row); const asymId = ps.label_asym_id.value(row);
const entityIndex = model.atomicHierarchy.index.findEntity(asymId);
if (entityIndex < 0) return void 0;
const residueIndex = model.atomicHierarchy.index.findResidue(
model.entities.data.id.value(entityIndex),
asymId,
ps.auth_seq_id.value(row),
ps.ins_code.value(row)
);
if (residueIndex < 0) return void 0;
const atomName = ps.label_atom_id.value(row); const atomName = ps.label_atom_id.value(row);
// turns out "mismat" records might not have atom name value // turns out "mismat" records might not have atom name value
if (!atomName) return void 0; if (!atomName) return undefined;
const atomIndex = model.atomicHierarchy.index.findAtomOnResidue(residueIndex, atomName, ps.label_alt_id.value(row));
if (atomIndex < 0) return void 0; const altId = ps.label_alt_id.value(row);
return { residueIndex, atomIndex, symmetry: ps.symmetry.value(row) }; for (const eId of entityIds) {
const residueIndex = model.atomicHierarchy.index.findResidue(
eId,
asymId,
ps.auth_seq_id.value(row),
ps.ins_code.value(row)
);
if (residueIndex < 0) continue;
const atomIndex = model.atomicHierarchy.index.findAtomOnResidue(residueIndex, atomName, altId);
if (atomIndex < 0) continue;
return { residueIndex, atomIndex, symmetry: ps.symmetry.value(row) };
}
return void 0;
}; };
const entries: StructConn.Entry[] = []; const entries: StructConn.Entry[] = [];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment