Jelajahi Sumber

Merge branch 'master' of https://github.com/molstar/molstar

David Sehnal 5 tahun lalu
induk
melakukan
3ad42fc7e0

+ 18 - 0
.github/workflows/lint.yml

@@ -0,0 +1,18 @@
+on:
+  push:
+  pull_request:
+
+jobs:
+  eslint:
+    name: eslint
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout@v1
+    - name: install node v12
+      uses: actions/setup-node@v1
+      with:
+        node-version: 12
+    - name: yarn install
+      run: yarn install
+    - name: eslint
+      uses: icrawl/action-eslint@v1

+ 1 - 1
data/rcsb-graphql/codegen.yml

@@ -1,4 +1,4 @@
-schema: https://data-beta.rcsb.org/graphql
+schema: https://data.rcsb.org/graphql
 documents: './src/mol-model-props/rcsb/graphql/symmetry.gql.ts'
 generates:
   './src/mol-model-props/rcsb/graphql/types.ts':

+ 1 - 1
package-lock.json

@@ -1,6 +1,6 @@
 {
   "name": "molstar",
-  "version": "0.6.4",
+  "version": "0.6.7",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "molstar",
-  "version": "0.6.4",
+  "version": "0.6.7",
   "description": "A comprehensive macromolecular library.",
   "homepage": "https://github.com/molstar/molstar#readme",
   "repository": {

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

@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
+ * Copyright (c) 2019-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
  *
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
  * @author Fred Ludlow <Fred.Ludlow@astx.com>
@@ -32,7 +32,7 @@ type GeometryProps = PD.Values<GeometryParams>
 
 const HydrogenBondsParams = {
     ...GeometryParams,
-    water: PD.Boolean(true, { description: 'Include water-to-water hydrogen bonds' }),
+    water: PD.Boolean(false, { description: 'Include water-to-water hydrogen bonds' }),
     sulfurDistanceMax: PD.Numeric(4.1, { min: 1, max: 5, step: 0.1 }),
 }
 type HydrogenBondsParams = typeof HydrogenBondsParams
@@ -174,9 +174,8 @@ function addUnitHydrogenAcceptors(structure: Structure, unit: Unit.Atomic, build
     }
 }
 
-
 function isWater(unit: Unit.Atomic, index: StructureElement.UnitIndex) {
-    return unit.model.atomicHierarchy.derived.residue.moleculeType[unit.elements[index]] === MoleculeType.Water
+    return unit.model.atomicHierarchy.derived.residue.moleculeType[unit.residueIndex[unit.elements[index]]] === MoleculeType.Water
 }
 
 function isBackbone(unit: Unit.Atomic, index: StructureElement.UnitIndex) {

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

@@ -94,7 +94,7 @@ function addMetalBinding(structure: Structure, unit: Unit.Atomic, builder: Featu
                     dative = true
                     ionic = true
                 }
-            } else if (element === Elements.S && 'CYS' === resname) {
+            } else if (element === Elements.S && (resname === 'CYS' || resname === 'MET')) {
                 dative = true
                 ionic = true
             } else if (element === Elements.N) {

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

@@ -24,7 +24,7 @@ export const InteractionsParams = {
     ...InteractionsIntraUnitParams,
     ...InteractionsInterUnitParams,
     unitKinds: getUnitKindsParam(['atomic']),
-    sizeFactor: PD.Numeric(0.15, { min: 0.01, max: 1, step: 0.01 }),
+    sizeFactor: PD.Numeric(0.2, { min: 0.01, max: 1, step: 0.01 }),
     visuals: PD.MultiSelect(['intra-unit', 'inter-unit'], PD.objectToOptions(InteractionsVisuals)),
 }
 export type InteractionsParams = typeof InteractionsParams

+ 1 - 1
src/mol-model-props/rcsb/assembly-symmetry.ts

@@ -47,7 +47,7 @@ export namespace AssemblySymmetry {
         Representation = 'rcsb-assembly-symmetry-3d'
     }
 
-    export const DefaultServerUrl = 'https://data-beta.rcsb.org/graphql'
+    export const DefaultServerUrl = 'https://data.rcsb.org/graphql'
 
     export function isApplicable(structure?: Structure): boolean {
         return (

+ 3 - 1
src/mol-model-props/rcsb/graphql/types.ts

@@ -1,7 +1,7 @@
 /* eslint-disable */
 export type Maybe<T> = T | null;
 
-// Generated in 2020-03-30T11:30:30-07:00
+// Generated in 2020-04-08T16:22:40-07:00
 
 /** All built-in and custom scalars, mapped to their actual values */
 export type Scalars = {
@@ -800,6 +800,8 @@ export type PdbxAuditRevisionCategory = {
 
 export type PdbxAuditRevisionDetails = {
   readonly data_content_type: Scalars['String'];
+  readonly description?: Maybe<Scalars['String']>;
+  readonly details?: Maybe<Scalars['String']>;
   readonly ordinal: Scalars['Int'];
   readonly provider?: Maybe<Scalars['String']>;
   readonly revision_ordinal: Scalars['Int'];

+ 3 - 0
src/mol-plugin-state/manager/loci-label.ts

@@ -15,6 +15,8 @@ export type LociLabel = JSX.Element | string
 export type LociLabelProvider = {
     label: (loci: Loci, repr?: Representation<any>) => LociLabel | undefined
     group?: (entry: LociLabel) => string
+    /** Labels from providers with higher priority are shown first */
+    priority?: number
 }
 
 export class LociLabelManager {
@@ -22,6 +24,7 @@ export class LociLabelManager {
 
     addProvider(provider: LociLabelProvider) {
         this.providers.push(provider);
+        this.providers.sort((a, b) => (b.priority || 0) - (a.priority || 0))
         this.isDirty = true
         this.showLabels()
     }

+ 6 - 1
src/mol-plugin-ui/controls.tsx

@@ -251,9 +251,14 @@ export class SelectionViewportControls extends PluginUIComponent {
         this.subscribe(this.plugin.behaviors.interaction.selectionMode, () => this.forceUpdate());
     }
 
+    onMouseMove = (e: React.MouseEvent) => {
+        // ignore mouse moves when no button is held
+        if (e.buttons === 0) e.stopPropagation()
+    }
+
     render() {
         if (!this.plugin.selectionMode) return null;
-        return <div className='msp-selection-viewport-controls'>
+        return <div className='msp-selection-viewport-controls' onMouseMove={this.onMouseMove}>
             <StructureSelectionActionsControls />
         </div>;
     }

+ 2 - 1
src/mol-plugin/behavior/dynamic/custom-props/rcsb/assembly-symmetry.ts

@@ -181,7 +181,8 @@ export const AssemblySymmetryPreset = StructureRepresentationPresetProvider({
         }
 
         const assemblySymmetry = await tryCreateAssemblySymmetry(plugin, structureCell);
-        const preset = await PresetStructureRepresentations.auto.apply(ref, { ...params, globalThemeName: Tag.Cluster as any }, plugin);
+        const globalThemeName = assemblySymmetry.isOk ? Tag.Cluster as any : undefined
+        const preset = await PresetStructureRepresentations.auto.apply(ref, { ...params, globalThemeName }, plugin);
 
         return { components: preset.components, representations: { ...preset.representations, assemblySymmetry } };
     }

+ 9 - 8
src/mol-plugin/behavior/dynamic/custom-props/rcsb/ui/assembly-symmetry.tsx

@@ -104,15 +104,16 @@ export class AssemblySymmetryControls extends CollapsableControls<{}, AssemblySy
             await this.plugin.builders.structure.insertStructureProperties(s.cell, params);
         }
 
-        const components = this.plugin.managers.structure.hierarchy.currentComponentGroups[0];
-        if (values.symmetryIndex === -1) {
-            const name = components[0]?.representations[0]?.cell.transform.params?.colorTheme.name;
-            if (name === AssemblySymmetry.Tag.Cluster) {
-                await this.plugin.managers.structure.component.updateRepresentationsTheme(components, { color: 'default' })
+        for (const components of this.plugin.managers.structure.hierarchy.currentComponentGroups) {
+            if (values.symmetryIndex === -1) {
+                const name = components[0]?.representations[0]?.cell.transform.params?.colorTheme.name;
+                if (name === AssemblySymmetry.Tag.Cluster) {
+                    await this.plugin.managers.structure.component.updateRepresentationsTheme(components, { color: 'default' })
+                }
+            } else {
+                tryCreateAssemblySymmetry(this.plugin, s.cell)
+                await this.plugin.managers.structure.component.updateRepresentationsTheme(components, { color: AssemblySymmetry.Tag.Cluster as any })
             }
-        } else {
-            tryCreateAssemblySymmetry(this.plugin, s.cell)
-            await this.plugin.managers.structure.component.updateRepresentationsTheme(components, { color: AssemblySymmetry.Tag.Cluster as any })
         }
     }
 

+ 2 - 1
src/mol-plugin/behavior/dynamic/representation.ts

@@ -186,7 +186,8 @@ export const DefaultLociLabelProvider = PluginBehavior.create({
                 label.push(lociLabel(loci))
                 return label.join('</br>')
             },
-            group: (label: LociLabel) => label.toString().replace(/Model [0-9]+/g, 'Models')
+            group: (label: LociLabel) => label.toString().replace(/Model [0-9]+/g, 'Models'),
+            priority: 100
         };
         register() { this.ctx.managers.lociLabels.addProvider(this.f); }
         unregister() { this.ctx.managers.lociLabels.removeProvider(this.f); }