ソースを参照

add interactions repr to surroundings behavior

Alexander Rose 5 年 前
コミット
30e01c07f7

+ 2 - 2
src/mol-model-props/computed/interactions/hydrogen-bonds.ts

@@ -21,7 +21,7 @@ import { MoleculeType, ProteinBackboneAtoms } from '../../../mol-model/structure
 
 const GeometryParams = {
     distanceMax: PD.Numeric(3.5, { min: 1, max: 5, step: 0.1 }),
-    backbone: PD.Boolean(false, { description: 'Include backbone-to-backbone hydrogen bonds' }),
+    backbone: PD.Boolean(true, { description: 'Include backbone-to-backbone hydrogen bonds' }),
     accAngleDevMax: PD.Numeric(45, { min: 0, max: 180, step: 1 }, { description: 'Max deviation from ideal acceptor angle' }),
     donAngleDevMax: PD.Numeric(45, { min: 0, max: 180, step: 1 }, { description: 'Max deviation from ideal donor angle' }),
     accOutOfPlaneAngleMax: PD.Numeric(90, { min: 0, max: 180, step: 1 }),
@@ -32,7 +32,7 @@ type GeometryProps = PD.Values<GeometryParams>
 
 const HydrogenBondsParams = {
     ...GeometryParams,
-    water: PD.Boolean(false, { description: 'Include water-to-water hydrogen bonds' }),
+    water: PD.Boolean(true, { description: 'Include water-to-water hydrogen bonds' }),
     sulfurDistanceMax: PD.Numeric(4.1, { min: 1, max: 5, step: 0.1 }),
 }
 type HydrogenBondsParams = typeof HydrogenBondsParams

+ 1 - 1
src/mol-model-props/computed/interactions/interactions.ts

@@ -140,7 +140,7 @@ export const InteractionsParams = {
         'halogen-bonds',
         // 'hydrophobic',
         'metal-coordination',
-        // 'weak-hydrogen-bonds',
+        'weak-hydrogen-bonds',
     ], PD.objectToOptions(ContactProviders)),
     contacts: PD.Group(ContactsParams, { isFlat: true }),
     ...getProvidersParams()

+ 21 - 7
src/mol-plugin/behavior/dynamic/selection/structure-representation-interaction.ts

@@ -38,25 +38,34 @@ enum Tags {
     ResidueSel = 'structure-interaction-residue-sel',
     ResidueRepr = 'structure-interaction-residue-repr',
     SurrSel = 'structure-interaction-surr-sel',
-    SurrRepr = 'structure-interaction-surr-repr'
+    SurrRepr = 'structure-interaction-surr-repr',
+    SurrNciRepr = 'structure-interaction-surr-nci-repr'
 }
 
-const TagSet: Set<Tags> = new Set([Tags.Group, Tags.ResidueSel, Tags.ResidueRepr, Tags.SurrSel, Tags.SurrRepr])
+const TagSet: Set<Tags> = new Set([Tags.Group, Tags.ResidueSel, Tags.ResidueRepr, Tags.SurrSel, Tags.SurrRepr, Tags.SurrNciRepr])
 
 export class StructureRepresentationInteractionBehavior extends PluginBehavior.WithSubscribers<StructureRepresentationInteractionProps> {
 
     private createResVisualParams(s: Structure) {
         return StructureRepresentation3DHelpers.createParams(this.plugin, s, {
-            repr: [BuiltInStructureRepresentations['ball-and-stick'], () => ({ sizeAspectRatio: 1 })],
-            size: [BuiltInSizeThemes.uniform, () => ({ value: 0.6 } )]
+            repr: [BuiltInStructureRepresentations['ball-and-stick'], () => ({ })],
+            size: [BuiltInSizeThemes.uniform, () => ({ })]
         });
     }
 
     private createSurVisualParams(s: Structure) {
         return StructureRepresentation3DHelpers.createParams(this.plugin, s, {
-            repr: [BuiltInStructureRepresentations['ball-and-stick'], () => ({ sizeAspectRatio: 1 })],
-            color: [BuiltInColorThemes['element-symbol'], () => ({ saturation: -3, lightness: 0.6 })],
-            size: [BuiltInSizeThemes.uniform, () => ({ value: 0.3 } )]
+            repr: [BuiltInStructureRepresentations['ball-and-stick'], () => ({ })],
+            color: [BuiltInColorThemes['element-symbol'], () => ({ })],
+            size: [BuiltInSizeThemes.uniform, () => ({ })]
+        });
+    }
+
+    private createSurNciVisualParams(s: Structure) {
+        return StructureRepresentation3DHelpers.createParams(this.plugin, s, {
+            repr: [BuiltInStructureRepresentations['interactions'], () => ({ })],
+            color: [BuiltInColorThemes['interaction-type'], () => ({ })],
+            size: [BuiltInSizeThemes.uniform, () => ({ })]
         });
     }
 
@@ -93,6 +102,11 @@ export class StructureRepresentationInteractionBehavior extends PluginBehavior.W
                 this.createSurVisualParams(cell.obj!.data), { tags: Tags.SurrRepr }).ref;
         }
 
+        if (!refs[Tags.SurrNciRepr]) {
+            refs[Tags.SurrNciRepr] = builder.to(refs['structure-interaction-surr-sel']!).apply(StateTransforms.Representation.StructureRepresentation3D,
+                this.createSurNciVisualParams(cell.obj!.data), { tags: Tags.SurrNciRepr }).ref;
+        }
+
         return { state, builder, refs };
     }