Browse Source

fixed wrong index use when atom_site in ihm models

Alexander Rose 6 years ago
parent
commit
7edac1794e
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/mol-model-formats/structure/mmcif/parser.ts

+ 2 - 1
src/mol-model-formats/structure/mmcif/parser.ts

@@ -347,7 +347,8 @@ async function readIHM(ctx: RuntimeContext, format: mmCIF_Format, formatData: Fo
         let atom_site, atom_site_sourceIndex;
         if (atom_sites.has(id)) {
             const e = atom_sites.get(id)!;
-            const { atom_site: sorted, sourceIndex } = await sortAtomSite(ctx, e.table, e.start, e.end);
+            // need to sort `format.data.atom_site` as `e.start` and `e.end` are indices into that
+            const { atom_site: sorted, sourceIndex } = await sortAtomSite(ctx, format.data.atom_site, e.start, e.end);
             atom_site = sorted;
             atom_site_sourceIndex = sourceIndex;
         } else {