Browse Source

improved structure docs and sequence description

Alexander Rose 5 years ago
parent
commit
29609e04c2
2 changed files with 8 additions and 2 deletions
  1. 2 0
      src/mol-model/structure/structure/structure.ts
  2. 6 2
      src/mol-plugin/ui/sequence.tsx

+ 2 - 0
src/mol-model/structure/structure/structure.ts

@@ -277,10 +277,12 @@ class Structure {
         return this._props.model;
     }
 
+    /** The master-model, other models can have links to it  */
     get masterModel(): Model | undefined {
         return this._props.masterModel
     }
 
+    /** A representative model, e.g. the first model of a trajectory */
     get representativeModel(): Model | undefined {
         return this._props.representativeModel
     }

+ 6 - 2
src/mol-plugin/ui/sequence.tsx

@@ -103,8 +103,12 @@ function getModelEntityOptions(structure: Structure) {
         if (seen.has(key)) continue
 
         let description = SP.entity.pdbx_description(l).join(', ')
-        if (description.startsWith('Polymer ') && structure.models.length > 1) {
-            description += ` (${structure.models[modelIdx].entry})`
+        if (structure.models.length) {
+            if (structure.representativeModel) { // indicates model trajectory
+                description += ` (Model ${structure.models[modelIdx].modelNum})`
+            } else  if (description.startsWith('Polymer ')) { // indicates generic entity name
+                description += ` (${structure.models[modelIdx].entry})`
+            }
         }
         const label = `${id}: ${description}`
         options.push([ key, label ])