Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
amjjbonvin opened this issue Nov 30, 2022 · 1 comment
Open

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

amjjbonvin opened this issue Nov 30, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@amjjbonvin
Copy link

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.

@amjjbonvin amjjbonvin added the enhancement New feature or request label Nov 30, 2022
@sverhoeven
Copy link
Member

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

The Number of HISD will disappear once haddocking/haddock3#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

{
  "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

{
  "autohis": true,
  "mol": [
    {
      "prot_segid": "A"
    }
  ]
}

Toggle autohis checkbox to hide/show hisd array sub form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants