Quellcode durchsuchen

don't calc sec-struc for archival files

Alexander Rose vor 5 Jahren
Ursprung
Commit
b8de1de3a8
1 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen
  1. 5 2
      src/mol-plugin/state/transforms/helpers.ts

+ 5 - 2
src/mol-plugin/state/transforms/helpers.ts

@@ -8,11 +8,14 @@ import { Structure } from '../../../mol-model/structure';
 import { ComputedSecondaryStructure } from '../../../mol-model-props/computed/secondary-structure';
 
 /**
- * Attaches ComputedSecondaryStructure property when unavailable in sourceData
+ * Attaches ComputedSecondaryStructure property when unavailable in sourceData and
+ * when not an archival file (i.e. no database_2.database_id field)
  */
 export async function ensureSecondaryStructure(s: Structure) {
     if (s.models.length === 1 && s.model && s.model.sourceData.kind === 'mmCIF') {
-        if (!s.model.sourceData.data.struct_conf.id.isDefined && !s.model.sourceData.data.struct_sheet_range.id.isDefined) {
+        if (!s.model.sourceData.data.struct_conf.id.isDefined && !s.model.sourceData.data.struct_sheet_range.id.isDefined &&
+            !s.model.sourceData.data.database_2.database_id.isDefined
+        ) {
             await ComputedSecondaryStructure.attachFromCifOrCompute(s)
         }
     }