ソースを参照

fix handling of alternate locations in ligand-encoder#_getAtoms

Sebastian Bittrich 3 年 前
コミット
5fa8178df7
1 ファイル変更5 行追加4 行削除
  1. 5 4
      src/mol-io/writer/ligand-encoder.ts

+ 5 - 4
src/mol-io/writer/ligand-encoder.ts

@@ -109,11 +109,12 @@ export abstract class LigandEncoder implements Encoder<string> {
                 const key = it.move();
 
                 const lai = label_atom_id.value(key, data, index) as string;
+                // ignore all alternate locations after the first
+                if (atoms.has(lai)) continue;
+
                 const ts = type_symbol.value(key, data, index) as string;
-                if (this.skipHydrogen(ts)) {
-                    index++;
-                    continue;
-                }
+                if (this.skipHydrogen(ts)) continue;
+
                 const a: { [k: string]: (string | number) } = {};
 
                 for (let _f = 0, _fl = fields.length; _f < _fl; _f++) {