Explorar o código

ensure subtype assignment for all entities, #100

Alexander Rose %!s(int64=4) %!d(string=hai) anos
pai
achega
c17bfd65e7
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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) {