Преглед изворни кода

ensure subtype assignment for all entities, #100

Alexander Rose пре 4 година
родитељ
комит
c17bfd65e7
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      src/mol-model-formats/structure/basic/entities.ts

+ 5 - 0
src/mol-model-formats/structure/basic/entities.ts

@@ -90,6 +90,11 @@ export function getEntities(data: BasicData, properties: Model['properties']): E
         assignSubtype = true;
     }
 
+    if (entityIds.size < subtypes.length) {
+        // still unassigned subtypes, need to derive from component id/type
+        assignSubtype = true;
+    }
+
     if (assignSubtype) {
         const chemCompType = new Map<string, string>();
         if (data.chem_comp) {