Browse Source

adds turns and bends as dedicated secondary structure elements

Sebastian Bittrich 6 years ago
parent
commit
09db0abadb

+ 12 - 3
src/mol-model/structure/model/properties/seconday-structure.ts

@@ -19,11 +19,20 @@ interface SecondaryStructure {
 }
 
 namespace SecondaryStructure {
-    export type Element = None | Helix | Sheet
+    export type Element = None | Bend | Turn | Helix | Sheet
 
     export interface None {
-        kind: 'none',
-        flags?: SecondaryStructureType // TODO should this level of detail be added to non-defined secondary structure elements?
+        kind: 'none'
+    }
+
+    export interface Bend {
+        kind: 'bend',
+        flags: SecondaryStructureType
+    }
+
+    export interface Turn {
+        kind: 'turn',
+        flags: SecondaryStructureType
     }
 
     export interface Helix {

+ 15 - 2
src/mol-model/structure/model/properties/utils/secondary-structure.ts

@@ -211,11 +211,20 @@ function createElement(kind: string, flag: DSSPType.Flag, getResidueFlag: (f: DS
             kind: 'sheet',
             flags: getResidueFlag(flag)
         } as SecondaryStructure.Sheet
-    } else {
+    } else if (kind === 'turn') {
+        return {
+            kind: 'turn',
+            flags: getResidueFlag(flag)
+        }
+    } else if (kind === 'bend') {
         return {
-            kind: 'none',
+            kind: 'bend',
             flags: getResidueFlag(flag)
         }
+    } else {
+        return {
+            kind: 'none'
+        }
     }
 }
 
@@ -224,6 +233,10 @@ function mapToKind(assignment: SecondaryStructureType.Flag) {
         return 'helix'
     } else if (assignment === SecondaryStructureType.SecondaryStructureDssp.B || assignment === SecondaryStructureType.SecondaryStructureDssp.E) {
         return 'sheet'
+    } else if (assignment === SecondaryStructureType.SecondaryStructureDssp.T) {
+        return 'turn'
+    } else if (assignment === SecondaryStructureType.SecondaryStructureDssp.S) {
+        return 'bend'
     } else {
         return 'none'
     }

+ 1 - 1
src/tests/browser/render-structure.ts

@@ -62,7 +62,7 @@ function getCartoonRepr() {
 }
 
 async function init() {
-    const cif = await downloadFromPdb('3j3q')
+    const cif = await downloadFromPdb('1acj')
     const models = await getModels(cif)
     console.time('computeModelDSSP')
     const secondaryStructure = computeModelDSSP(models[0].atomicHierarchy,