Browse Source

default only aligned displayed

bioinsilico 2 years ago
parent
commit
23972f2a71

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "@rcsb/rcsb-saguaro-3d",
-  "version": "2.2.0-uniprot-msa.4",
+  "version": "2.2.0-uniprot-msa.5",
   "description": "RCSB Molstar/Saguaro Web App",
   "main": "build/dist/app.js",
   "files": [

+ 2 - 2
src/RcsbFvSequence/SequenceViews/RcsbView/PfvManagerFactoryImplementation/UniprotPfvComponents/UniprotRowTitleCheckbox.tsx

@@ -23,7 +23,7 @@ interface UniprotRowTitleCheckboxState {
 export class UniprotRowTitleCheckbox extends React.Component <UniprotRowTitleCheckboxInterface,UniprotRowTitleCheckboxState> {
 
     readonly state: UniprotRowTitleCheckboxState = {
-        checked: !this.props.disabled
+        checked: this.props.tag == "aligned"
     };
 
     private subscription: Subscription;
@@ -40,7 +40,7 @@ export class UniprotRowTitleCheckbox extends React.Component <UniprotRowTitleChe
 
     public componentDidUpdate(prevProps: Readonly<UniprotRowTitleCheckboxInterface>, prevState: Readonly<UniprotRowTitleCheckboxState>, snapshot?: any) {
         if(prevProps.disabled != this.props.disabled)
-            this.setState({checked:!this.props.disabled});
+            this.setState({checked:(!this.props.disabled && this.props.tag == "aligned")});
     }
 
     public componentWillUnmount() {

+ 14 - 5
src/RcsbFvStructure/StructureViewers/MolstarViewer/TrajectoryPresetProvider/AlignmentRepresentationPresetProvider.ts

@@ -126,6 +126,10 @@ export const AlignmentRepresentationPresetProvider = StructureRepresentationPres
             builder.buildRepresentation(update, comp, {
                 color: PLDDTConfidenceColorThemeProvider.isApplicable({ structure }) ? PLDDTConfidenceColorThemeProvider.name as ColorTheme.BuiltIn : "chain-id",
                 type: "cartoon"
+            }, {
+                initialState:{
+                    isHidden:true
+                }
             });
             await update.commit({ revertOnError: false });
             for(const expression of createSelectionExpressions(entryId)){
@@ -134,9 +138,9 @@ export const AlignmentRepresentationPresetProvider = StructureRepresentationPres
                 const comp = await plugin.builders.structure.tryCreateComponentFromExpression(
                     structureCell,
                     expression.expression,
-                    uniqid(`${entryId}${TagDelimiter.entity}${entityId}_${expression.tag}`),
+                    uniqid(`${entryId}${TagDelimiter.entity}${entityId}${TagDelimiter.assembly}${expression.tag}`),
                     {
-                        label: `${entryId}${TagDelimiter.entity}${entityId}-${expression.tag}`
+                        label: `${entryId}${TagDelimiter.entity}${entityId}${TagDelimiter.assembly}${expression.tag}`
                     });
                 //TODO This needs to be called after tryCreateComponentFromExpression
                 const { update, builder } = reprBuilder(plugin, {
@@ -146,14 +150,19 @@ export const AlignmentRepresentationPresetProvider = StructureRepresentationPres
                 });
                 builder.buildRepresentation(update, comp, {
                     type: expression.type
-                },expression.tag == "water" ? {
+                },{
                     initialState:{
                         isHidden:true
                     }
-                } : undefined);
+                });
                 await update.commit({ revertOnError: false });
             }
-
+            for (const c of plugin.managers.structure.hierarchy.currentComponentGroups){
+                for (const comp of c) {
+                    if(comp.representations[0].cell.state.isHidden)
+                        plugin.managers.structure.component.toggleVisibility(c);
+                }
+            }
         }
     });