From 30e01c07f7d6412b582fe72522c1fc01b93d4cb0 Mon Sep 17 00:00:00 2001
From: Alexander Rose <alex.rose@rcsb.org>
Date: Thu, 9 Jan 2020 17:34:29 -0800
Subject: [PATCH] add interactions repr to surroundings behavior
---
.../computed/interactions/hydrogen-bonds.ts | 4 +--
.../computed/interactions/interactions.ts | 2 +-
.../structure-representation-interaction.ts | 28 ++++++++++++++-----
3 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/src/mol-model-props/computed/interactions/hydrogen-bonds.ts b/src/mol-model-props/computed/interactions/hydrogen-bonds.ts
index d16a672f2..697b187e3 100644
--- a/src/mol-model-props/computed/interactions/hydrogen-bonds.ts
+++ b/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
diff --git a/src/mol-model-props/computed/interactions/interactions.ts b/src/mol-model-props/computed/interactions/interactions.ts
index 82acd663d..36e147b95 100644
--- a/src/mol-model-props/computed/interactions/interactions.ts
+++ b/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()
diff --git a/src/mol-plugin/behavior/dynamic/selection/structure-representation-interaction.ts b/src/mol-plugin/behavior/dynamic/selection/structure-representation-interaction.ts
index 7a050088b..c1640a82e 100644
--- a/src/mol-plugin/behavior/dynamic/selection/structure-representation-interaction.ts
+++ b/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 };
}
--
GitLab