Browse Source

fix Si-Si bonds

Alexander Rose 5 years ago
parent
commit
a5c039bf11

+ 1 - 0
src/mol-model-formats/structure/cif-core.ts

@@ -97,6 +97,7 @@ async function getModels(db: CifCore_Database, format: CifCoreFormat, ctx: Runti
     } else {
         const element_symbol = new Array<string>(atomCount);
         for (let i = 0; i < atomCount; ++i) {
+            // TODO can take as is if type_symbol not given?
             element_symbol[i] = guessElementSymbolString(label.value(i));
         }
         typeSymbol = Column.ofStringArray(element_symbol);

+ 3 - 2
src/mol-model-formats/structure/util.ts

@@ -27,7 +27,8 @@ export function guessElementSymbolTokens(tokens: Tokens, str: string, start: num
         if (
             ((c === 78 || c === 110) && (c2 === 65 || c2 ===  97)) || // NA na Na nA
             ((c === 67 || c ===  99) && (c2 === 76 || c2 === 108)) || // CL
-            ((c === 70 || c === 102) && (c2 === 69 || c2 === 101))    // FE
+            ((c === 70 || c === 102) && (c2 === 69 || c2 === 101)) || // FE
+            ((c === 83 || c === 115) && (c2 === 73 || c2 === 105))    // SI
         ) return TokenBuilder.add(tokens, s, s + 2);
     }
 
@@ -53,7 +54,7 @@ export function guessElementSymbolString(str: string) {
     if (l === 1) return str; // one char
 
     if (l === 2) { // two chars
-        if (str === 'NA' || str === 'CL' || str === 'FE') return str;
+        if (str === 'NA' || str === 'CL' || str === 'FE' || str === 'SI') return str;
     }
 
     const c = str[0];

+ 4 - 1
src/mol-model/structure/structure/unit/bonds/common.ts

@@ -59,8 +59,11 @@ const __ElementBondThresholds: { [e: number]: number | undefined } = { 0: 1.42,
  * - Average    1.345 (+/- 0.020)
  * - Min        1.322
  * - Max        1.400
+ *
+ * Added Si-Si (420) as 2.37
+ * (https://cccbdb.nist.gov/expbondlengths2x.asp?descript=rSiSi)
  */
-const __ElementPairThresholds: { [e: number]: number | undefined } = { 0: 0.8, 20: 1.31, 27: 1.2, 35: 1.15, 44: 1.1, 54: 1, 60: 1.84, 72: 1.88, 84: 1.75, 85: 1.56, 86: 1.76, 98: 1.6, 99: 1.68, 100: 1.63, 112: 1.6, 113: 1.59, 114: 1.36, 129: 1.45, 135: 1.47, 144: 1.6, 152: 1.45, 170: 1.4, 180: 1.55, 202: 2.4, 222: 2.24, 224: 1.91, 225: 1.98, 243: 2.02, 269: 2, 293: 1.9, 480: 2.3, 512: 2.3, 544: 2.3, 612: 2.1, 629: 1.54, 665: 1, 813: 2.6, 854: 2.27, 894: 1.93, 896: 2.1, 937: 2.05, 938: 2.06, 981: 1.62, 1258: 2.68, 1309: 2.33, 1484: 1, 1763: 2.14, 1823: 2.48, 1882: 2.1, 1944: 1.72, 2380: 2.34, 3367: 2.44, 3733: 2.11, 3819: 2.6, 3821: 2.36, 4736: 2.75, 5724: 2.73, 5959: 2.63, 6519: 2.84, 6750: 2.87, 8991: 2.81 };
+const __ElementPairThresholds: { [e: number]: number | undefined } = { 0: 0.8, 20: 1.31, 27: 1.2, 35: 1.15, 44: 1.1, 54: 1, 60: 1.84, 72: 1.88, 84: 1.75, 85: 1.56, 86: 1.76, 98: 1.6, 99: 1.68, 100: 1.63, 112: 1.6, 113: 1.59, 114: 1.36, 129: 1.45, 135: 1.47, 144: 1.6, 152: 1.45, 170: 1.4, 180: 1.55, 202: 2.4, 222: 2.24, 224: 1.91, 225: 1.98, 243: 2.02, 269: 2, 293: 1.9, 420: 2.37, 480: 2.3, 512: 2.3, 544: 2.3, 612: 2.1, 629: 1.54, 665: 1, 813: 2.6, 854: 2.27, 894: 1.93, 896: 2.1, 937: 2.05, 938: 2.06, 981: 1.62, 1258: 2.68, 1309: 2.33, 1484: 1, 1763: 2.14, 1823: 2.48, 1882: 2.1, 1944: 1.72, 2380: 2.34, 3367: 2.44, 3733: 2.11, 3819: 2.6, 3821: 2.36, 4736: 2.75, 5724: 2.73, 5959: 2.63, 6519: 2.84, 6750: 2.87, 8991: 2.81 };
 
 const __DefaultBondingRadius = 2.001;