Browse Source

make chainMode explicit

Sebastian Bittrich 3 năm trước cách đây
mục cha
commit
572f27f325
4 tập tin đã thay đổi với 26 bổ sung3 xóa
  1. 4 0
      CHANGELOG.md
  2. 2 2
      src/viewer/helpers/preset.ts
  3. 6 0
      src/viewer/helpers/selection.ts
  4. 14 1
      src/viewer/index.html

+ 4 - 0
CHANGELOG.md

@@ -2,6 +2,10 @@
 
 [Semantic Versioning](https://semver.org/)
 
+## [1.9.2] - 2021-10-15
+### Bug fixes
+- removed implicit 'chain-mode', must be explicitly requested by setting 'extendToChain' to true as part of the part
+
 ## [1.9.1] - 2021-10-14
 ### Bug fixes
 - More robust 'chain-mode' check in feature preset

+ 2 - 2
src/viewer/helpers/preset.ts

@@ -258,8 +258,8 @@ export const RcsbPreset = TrajectoryHierarchyPresetProvider({
 
         if ((p.kind === 'feature' || p.kind === 'feature-density') && structure?.obj) {
             let loci = targetToLoci(p.target, structure!.obj.data);
-            // if target is only defined by chain: then don't force first residue
-            const chainMode = Object.keys(p.target).length === 1 && !!p.target.label_asym_id;
+            // if requested: then don't force first residue
+            const chainMode = !!p.target.extendToChain;
             // HELP-16678: check for rare case where ligand is not present in requested assembly
             if (loci.elements.length === 0 && !!p.assemblyId) {
                 // switch to Model (a.k.a. show coordinates independent of assembly)

+ 6 - 0
src/viewer/helpers/selection.ts

@@ -21,6 +21,12 @@ export type Target = {
      * the source CIF file.
      */
     readonly struct_oper_id?: string
+    /**
+     * Extend selection to whole chain, by default only the first residue is selected. This is used by the
+     * oligoInteraction preset in rcsb-sierra, which should focus the whole oligo chain. Not wanted for the
+     * ligandInteraction preset, which would otherwise focus alternative conformations and symmetry mates.
+     */
+    readonly extendToChain?: boolean
 }
 
 export type Range = {

+ 14 - 1
src/viewer/index.html

@@ -293,7 +293,20 @@
                     props: {
                         kind: 'feature',
                         target: {
-                            label_asym_id: 'E'
+                            label_asym_id: 'E',
+                            extendToChain: true
+                        }
+                    }
+                },
+                {
+                    id: '1BCS',
+                    // this should focus on 1 of 2 (!) ARGs in chain G
+                    info: 'ligand: COMPLEX OF THE WHEAT SERINE CARBOXYPEPTIDASE, CPDW-II, WITH THE MICROBIAL PEPTIDE ALDEHYDE INHIBITOR, CHYMOSTATIN, AND ARGININE AT 100 DEGREES KELVIN\n',
+                    props: {
+                        kind: 'feature',
+                        assemblyId: '1',
+                        target: {
+                            label_asym_id: 'F'
                         }
                     }
                 },