Uploaded image for project: 'Airavata'
  1. Airavata
  2. AIRAVATA-2596 Django: Experiment views
  3. AIRAVATA-2994

Experiment input editors: transformations

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Django Portal
    • None

    Description

      Add the ability to add transformations to input editors through input metadata, validations (AIRAVATA-2762) and dependencies (AIRAVATA-2761).

       The schema I'm thinking of is

      {
        "editor": {
          "transformations": [
            {
              "type": "regex-replace",
              "value": ["\s+", "", ""]
            },
            ...
          ]
        }
      }
      

      A list of transformations can be specified. They will be applied in order to the input value whenever it changes.

      The type must be implemented by a Transformation class (something like how the ValidatorFactory works).

      Example: transform

      >101M:A|PDBID|CHAIN|SEQUENCE
      MVLSEGEWQLVLHVWAKVEADVAGHGQDILIRLFKSHPETLEKFDRVKHLKTEAEMKASEDLKKHGVTVLTALGAILKKK
      GHHEAELKPLAQSHATKHKIPIKYLEFISEAIIHVLHSRHPGNFGADAQGAMNKALELFRKDIAAKYKELGYQG
      

      into

      MVLSEGEWQLVLHVWAKVEADVAGHGQDILIRLFKSHPETLEKFDRVKHLKTEAEMKASEDLKKHGVTVLTALGAILKKKGHHEAELKPLAQSHATKHKIPIKYLEFISEAIIHVLHSRHPGNFGADAQGAMNKALELFRKDIAAKYKELGYQG
      

      That is, remove the initial header line and remove all newlines.

      Other notes:

      • transformations should be applied before validations
      • need to add a transform(value) method to InputDataObjectType. transform() should apply transformations and return the transformed value. If there are no transformations then transform() should just return the given value

      Attachments

        Activity

          People

            marcuschristie Marcus Christie
            marcuschristie Marcus Christie
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: