|
@@ -10,12 +10,13 @@ import { Encoder, Category, Field } from './cif/encoder';
|
|
|
import { ComponentAtom } from '../../mol-model-formats/structure/property/atoms/chem_comp';
|
|
|
import { ComponentBond } from '../../mol-model-formats/structure/property/bonds/chem_comp';
|
|
|
import { getElementIdx, isHydrogen } from '../../mol-model/structure/structure/unit/bonds/common';
|
|
|
+import { ElementSymbol } from '../../mol-model/structure/model/types';
|
|
|
|
|
|
interface Atom {
|
|
|
Cartn_x: number,
|
|
|
Cartn_y: number,
|
|
|
Cartn_z: number,
|
|
|
- type_symbol: string & { '@type': 'element-symbol' },
|
|
|
+ type_symbol: ElementSymbol,
|
|
|
index: number
|
|
|
}
|
|
|
|
|
@@ -113,7 +114,7 @@ export abstract class LigandEncoder implements Encoder<string> {
|
|
|
// ignore all alternate locations after the first
|
|
|
if (atoms.has(lai)) continue;
|
|
|
|
|
|
- const ts = type_symbol.value(key, data, index) as string & { '@type': 'element-symbol' };
|
|
|
+ const ts = type_symbol.value(key, data, index) as ElementSymbol;
|
|
|
if (this.skipHydrogen(ts)) continue;
|
|
|
|
|
|
const a: { [k: string]: (string | number) } = {};
|
|
@@ -133,14 +134,14 @@ export abstract class LigandEncoder implements Encoder<string> {
|
|
|
return atoms;
|
|
|
}
|
|
|
|
|
|
- protected skipHydrogen(type_symbol: string & { '@type': 'element-symbol' }) {
|
|
|
+ protected skipHydrogen(type_symbol: ElementSymbol) {
|
|
|
if (this.hydrogens) {
|
|
|
return false;
|
|
|
}
|
|
|
return this.isHydrogen(type_symbol);
|
|
|
}
|
|
|
|
|
|
- protected isHydrogen(type_symbol: string & { '@type': 'element-symbol' }) {
|
|
|
+ protected isHydrogen(type_symbol: ElementSymbol) {
|
|
|
return isHydrogen(getElementIdx(type_symbol));
|
|
|
}
|
|
|
|