i-VRESSE / workflow-builder

Graphical interface to build a workflow file
https://i-vresse-workflow-builder.netlify.app/
Apache License 2.0
3 stars 2 forks source link

Number of HISD should not be shown at the easy level #122

Open amjjbonvin opened 1 year ago

amjjbonvin commented 1 year ago

At the easy level, for the topoaa parameters, the Number of HISD residue should not show since the default it automatic.

It appears when clicking on the + of the input molecule configuration. This should only be visible in manual mode.

sverhoeven commented 1 year ago

I think you mean manual mode is when the Automatic HIS protonation state (autohis) is false.

The Number of HISD will disappear once https://github.com/haddocking/haddock3/issues/369 is implemented.

To hide the hise and hisd array sub form when at easy level would require that the condition is coded up somewhere as now it is only described in the human readable description in defaults.yaml file.

To hide the hise and hisd array sub form when at expert/guru level and autohis=true we can use the JSON schema if-then-else conditional.

Playground example if-then-else Goto https://rjsf-team.github.io/react-jsonschema-form/ In JSON schema text area paste ```json { "type": "object", "properties": { "autohis": { "default": true, "title": "Automatic HIS protonation state", "description": "The protonation state of histidine (+1: HIS or 0: HISD/HISE) will be automatically set by HADDOCK", "$comment": "If set to true, HADDOCK will automatically define the protonation state of histidines ((+1: HIS or 0: HISD/HISE) by selecting the state leading to the lowest electrostatic energy", "type": "boolean" } }, "required": [], "additionalProperties": false, "if": { "properties": { "autohis": { "const": true } } }, "then": { "properties": { "mol": { "title": "Input molecule configuration", "$comment": "You can expand this parameter and associated sub-parameters to the other input molecules. For example, if you input three molecules, you can define mol1, mol2, and mol3 subparameters. Those not defined will be populated with the defaults.", "type": "array", "items": { "type": "object", "properties": { "prot_segid": { "default": "A", "title": "Segment ID", "description": "Segment ID assigned to this molecule", "$comment": "Segment ID assigned to this molecule in CNS. Used to distinguish different molecules", "type": "string", "minLength": 0, "maxLength": 4, "format": "chain" } }, "required": [], "additionalProperties": false }, "maxItemsFrom": "molecules" } } }, "else": { "properties": { "mol": { "title": "Input molecule configuration", "$comment": "You can expand this parameter and associated sub-parameters to the other input molecules. For example, if you input three molecules, you can define mol1, mol2, and mol3 subparameters. Those not defined will be populated with the defaults.", "type": "array", "items": { "type": "object", "properties": { "prot_segid": { "default": "A", "title": "Segment ID", "description": "Segment ID assigned to this molecule", "$comment": "Segment ID assigned to this molecule in CNS. Used to distinguish different molecules", "type": "string", "minLength": 0, "maxLength": 4, "format": "chain" }, "hisd": { "type": "array", "items": { "title": "HISD residue number", "description": "Residue number of the Histidine to be defined as HISD", "$comment": "Residue number of the Histidine to be defined as HISD", "type": "number", "maximum": 9999, "minimum": -9999, "format": "residue" } } }, "required": [], "additionalProperties": false }, "maxItemsFrom": "molecules" } } } } ``` In formdata text area paste ```json { "autohis": true, "mol": [ { "prot_segid": "A" } ] } ``` Toggle autohis checkbox to hide/show hisd array sub form.