Details
-
Sub-task
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
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