Browse Source

rename BestDatabaseSequenceMapping -> SIFTSMapping

dsehnal 3 years ago
parent
commit
c4b4f2e3b1

+ 13 - 13
src/mol-model-props/sequence/themes/best-database-mapping.ts → src/mol-model-props/sequence/themes/sifts-mapping.ts

@@ -15,19 +15,19 @@ import { CustomProperty } from '../../common/custom-property';
 import { SIFTSMapping } from '../sifts-mapping';
 
 const DefaultColor = Color(0xFAFAFA);
-const Description = 'Assigns a color based on best dababase sequence mapping.';
+const Description = 'Assigns a color based on SIFTS mapping.';
 
 // same colors for same accessions
 const globalAccessionMap = new Map<string, number>();
 
-export const BestDatabaseSequenceMappingColorThemeParams = {
+export const SIFTSMappingColorThemeParams = {
     ...getPaletteParams({ type: 'colors', colorList: 'set-1' }),
 };
-export type BestDatabaseSequenceMappingColorThemeParams = typeof BestDatabaseSequenceMappingColorThemeParams
-export function getBestDatabaseSequenceMappingColorThemeParams(ctx: ThemeDataContext) {
-    return BestDatabaseSequenceMappingColorThemeParams; // TODO return copy
+export type SIFTSMappingColorThemeParams = typeof SIFTSMappingColorThemeParams
+export function getSIFTSMappingColorThemeParams(ctx: ThemeDataContext) {
+    return SIFTSMappingColorThemeParams; // TODO return copy
 }
-export function BestDatabaseSequenceMappingColorTheme(ctx: ThemeDataContext, props: PD.Values<BestDatabaseSequenceMappingColorThemeParams>): ColorTheme<BestDatabaseSequenceMappingColorThemeParams> {
+export function SIFTSMappingColorTheme(ctx: ThemeDataContext, props: PD.Values<SIFTSMappingColorThemeParams>): ColorTheme<SIFTSMappingColorThemeParams> {
     let color: LocationColor;
 
     if (ctx.structure) {
@@ -70,7 +70,7 @@ export function BestDatabaseSequenceMappingColorTheme(ctx: ThemeDataContext, pro
     }
 
     return {
-        factory: BestDatabaseSequenceMappingColorTheme,
+        factory: SIFTSMappingColorTheme,
         granularity: 'group',
         preferSmoothing: true,
         color,
@@ -79,13 +79,13 @@ export function BestDatabaseSequenceMappingColorTheme(ctx: ThemeDataContext, pro
     };
 }
 
-export const BestDatabaseSequenceMappingColorThemeProvider: ColorTheme.Provider<BestDatabaseSequenceMappingColorThemeParams, 'best-sequence-database-mapping'> = {
-    name: 'best-sequence-database-mapping',
-    label: 'Best Database Sequence Mapping',
+export const SIFTSMappingColorThemeProvider: ColorTheme.Provider<SIFTSMappingColorThemeParams, 'sifts-mapping'> = {
+    name: 'sifts-mapping',
+    label: 'SIFTS Mapping',
     category: ColorTheme.Category.Residue,
-    factory: BestDatabaseSequenceMappingColorTheme,
-    getParams: getBestDatabaseSequenceMappingColorThemeParams,
-    defaultValues: PD.getDefaultValues(BestDatabaseSequenceMappingColorThemeParams),
+    factory: SIFTSMappingColorTheme,
+    getParams: getSIFTSMappingColorThemeParams,
+    defaultValues: PD.getDefaultValues(SIFTSMappingColorThemeParams),
     isApplicable: (ctx: ThemeDataContext) => !!ctx.structure?.models.some(m => SIFTSMapping.Provider.isApplicable(m)),
     ensureCustomProperties: {
         attach: async (ctx: CustomProperty.Context, data: ThemeDataContext) => {

+ 1 - 1
src/mol-plugin/behavior/dynamic/custom-props.ts

@@ -11,6 +11,6 @@ export { AccessibleSurfaceArea } from './custom-props/computed/accessible-surfac
 export { Interactions } from './custom-props/computed/interactions';
 export { SecondaryStructure } from './custom-props/computed/secondary-structure';
 export { ValenceModel } from './custom-props/computed/valence-model';
-export { BestDatabaseSequenceMapping } from './custom-props/sequence/best-database-mapping';
+export { SIFTSMapping as BestDatabaseSequenceMapping } from './custom-props/sequence/sifts-mapping';
 
 export { CrossLinkRestraint } from './custom-props/integrative/cross-link-restraint';

+ 6 - 6
src/mol-plugin/behavior/dynamic/custom-props/sequence/best-database-mapping.ts → src/mol-plugin/behavior/dynamic/custom-props/sequence/sifts-mapping.ts

@@ -6,16 +6,16 @@
 
 import { OrderedSet } from '../../../../../mol-data/int';
 import { SIFTSMapping as BestDatabaseSequenceMappingProp } from '../../../../../mol-model-props/sequence/sifts-mapping';
-import { BestDatabaseSequenceMappingColorThemeProvider } from '../../../../../mol-model-props/sequence/themes/best-database-mapping';
+import { SIFTSMappingColorThemeProvider } from '../../../../../mol-model-props/sequence/themes/sifts-mapping';
 import { Loci } from '../../../../../mol-model/loci';
 import { StructureElement } from '../../../../../mol-model/structure';
 import { ParamDefinition as PD } from '../../../../../mol-util/param-definition';
 import { PluginBehavior } from '../../../behavior';
 
-export const BestDatabaseSequenceMapping = PluginBehavior.create<{ autoAttach: boolean, showTooltip: boolean }>({
-    name: 'best-sequence-database-mapping-prop',
+export const SIFTSMapping = PluginBehavior.create<{ autoAttach: boolean, showTooltip: boolean }>({
+    name: 'sifts-mapping-prop',
     category: 'custom-props',
-    display: { name: 'Best Database Sequence Mapping' },
+    display: { name: 'SIFTS Mapping' },
     ctor: class extends PluginBehavior.Handler<{ autoAttach: boolean, showTooltip: boolean }> {
         private provider = BestDatabaseSequenceMappingProp.Provider;
 
@@ -39,13 +39,13 @@ export const BestDatabaseSequenceMapping = PluginBehavior.create<{ autoAttach: b
 
         register(): void {
             this.ctx.customModelProperties.register(this.provider, this.params.autoAttach);
-            this.ctx.representation.structure.themes.colorThemeRegistry.add(BestDatabaseSequenceMappingColorThemeProvider);
+            this.ctx.representation.structure.themes.colorThemeRegistry.add(SIFTSMappingColorThemeProvider);
             this.ctx.managers.lociLabels.addProvider(this.labelProvider);
         }
 
         unregister() {
             this.ctx.customModelProperties.unregister(this.provider.descriptor.name);
-            this.ctx.representation.structure.themes.colorThemeRegistry.remove(BestDatabaseSequenceMappingColorThemeProvider);
+            this.ctx.representation.structure.themes.colorThemeRegistry.remove(SIFTSMappingColorThemeProvider);
             this.ctx.managers.lociLabels.removeProvider(this.labelProvider);
         }
     },