ソースを参照

tweaks for dnatco confal pyramids

- added Michal and Jiří as contributors
- add preset to annotation group
- legend for color theme
- add as extension to viewer
Alexander Rose 4 年 前
コミット
11c7024edd

+ 3 - 1
package.json

@@ -80,7 +80,9 @@
     "Alexander Rose <alexander.rose@weirdbyte.de>",
     "David Sehnal <david.sehnal@gmail.com>",
     "Sebastian Bittrich <sebastian.bittrich@rcsb.org>",
-    "Ludovic Autin <autin@scripps.edu>"
+    "Ludovic Autin <autin@scripps.edu>",
+    "Michal Malý <michal.maly@ibt.cas.cz>",
+    "Jiří Černý <jiri.cerny@ibt.cas.cz>"
   ],
   "license": "MIT",
   "devDependencies": {

+ 2 - 0
src/apps/viewer/index.ts

@@ -24,6 +24,7 @@ import { PluginState } from '../../mol-plugin/state';
 import { DownloadDensity } from '../../mol-plugin-state/actions/volume';
 import { PluginLayoutControlsDisplay } from '../../mol-plugin/layout';
 import { BuiltInTrajectoryFormat } from '../../mol-plugin-state/formats/trajectory';
+import { DnatcoConfalPyramids } from '../../extensions/dnatco';
 
 require('mol-plugin-ui/skin/light.scss');
 
@@ -32,6 +33,7 @@ export { setProductionMode, setDebugMode } from '../../mol-util/debug';
 
 const Extensions = {
     'cellpack': PluginSpec.Behavior(CellPack),
+    'dnatco-confal-pyramids': PluginSpec.Behavior(DnatcoConfalPyramids),
     'pdbe-structure-quality-report': PluginSpec.Behavior(PDBeStructureQualityReport),
     'rcsb-assembly-symmetry': PluginSpec.Behavior(RCSBAssemblySymmetry),
     'rcsb-validation-report': PluginSpec.Behavior(RCSBValidationReport)

+ 1 - 1
src/extensions/dnatco/confal-pyramids/behavior.ts

@@ -18,7 +18,7 @@ import { ParamDefinition as PD } from '../../../mol-util/param-definition';
 export const DnatcoConfalPyramidsPreset = StructureRepresentationPresetProvider({
     id: 'preset-structure-representation-confal-pyramids',
     display: {
-        name: 'Confal Pyramids',
+        name: 'Confal Pyramids', group: 'Annotation',
         description: 'Schematic depiction of conformer class and confal value.',
     },
     isApplicable(a) {

+ 8 - 0
src/extensions/dnatco/confal-pyramids/color.ts

@@ -13,6 +13,8 @@ import { ColorTheme } from '../../../mol-theme/color';
 import { ThemeDataContext } from '../../../mol-theme/theme';
 import { Color } from '../../../mol-util/color';
 import { ParamDefinition as PD } from '../../../mol-util/param-definition';
+import { TableLegend } from '../../../mol-util/legend';
+import { iterableToArray } from '../../../mol-data/util';
 
 const DefaultColor = Color(0xCCCCCC);
 const Description = 'Assigns colors to confal pyramids';
@@ -160,6 +162,12 @@ export function ConfalPyramidsColorTheme(ctx: ThemeDataContext, props: PD.Values
         color,
         props,
         description: Description,
+        legend: TableLegend(iterableToArray(ColorMapping.entries()).map(([conformer, color]) => {
+            return [conformer, color] as [string, Color];
+        }).concat([
+            [ 'Error', ErrorColor ],
+            [ 'Unknown', DefaultColor ]
+        ]))
     };
 }