Custom DataTypes for file based assays | Anthony Corbett | 2013-04-09 09:17 | |||||||||||||||||||||
Status: Closed | |||||||||||||||||||||||
I'm currently writing a lot of file based assays to quickly allow experimental data to be enter into labkey with custom upload UIs, however, I do not want to constrain myself to only a file-based module assay solution; over time I may want to turn some of these into java based assays if the need for complexity arises. I'm worried that data migration might be an issue here, especially with regards to LSIDs and namespace prefixes for ExpData (the DataType namespace prefix). I have found that the file based assay ExpData objects can have their LSIDs created with two different namespace prefiexes: 1. AssayController's FileUploadAction defaults the namespace prefix (datatype) of new ExpData objects to be ModuleAssayProvider.RAW_DATA_TYPE ("RawAssayData"), it is given that the form bean for this action does not contain the assayId (protocol) so there would be no way to determine the assay provider and resolve a customized dataType. By adding in the possibility of specifying the assayId in the form, a custom dataType could be resolved and the RAW_DATA_TYPE could provide backwards compatibility. 2. AssayController's SaveAssayBatchAction (for inputs and outputs) creates new ExpData objects with the namespace prefix (datatype) of AbstractAssayProvider.RELATED_FILE_DATA_TYPE ("RelatedFiles"), this happens without regard to the assay design (protocol) for which the ExpData is being created for during the save. To help ease possible data migration between file based assays and java based assays would it be possible to add an appropriate element for [Assay]DataType to the ProviderType complex type defined in assayProvider.xsd? This way file based modules can declare their one DataTypes (and mappings to file types) per assay provider in the config.xml file: <ap:provider xmlns:ap="http://labkey.org/study/assay/xml"> <ap:name>Gel Card</ap:name> <ap:description>Gel Card measures titers for anti-A and anti-B antibodies in blood.</ap:description> <ap:dataType> <ap:namespacePrefix>GelCardImage</ap:namespacePrefix> <ap:role>Gel Card Image</ap:role> <ap:fileType> <ap:suffixes> <ap:suffix>.jpg</ap:suffix> <ap:suffix>.jpeg</ap:suffix> <ap:suffix>.tiff</ap:suffix> </ap:suffixes> <ap:defaultSuffix>.jpg</ap:defaultSuffix> </ap:fileType> </ap:dataType> </ap:provider> This new dataType xml bean can be converted to a DataType object and then can be used in the ModuleAssayProvider's constructor when calling super: public ModuleAssayProvider(String name, Module module, Resource basePath, ProviderType providerConfig) { super(name + "Protocol", name + "Run", DataType.fromXMLBean(providerConfig.getDataType())); this.name = name; this.module = module; this.basePath = basePath; init(providerConfig); } For backwards compatibility null from this configuration could be handled in the TSVAssayProvider and TsvDataHandler.DATA_TYPE could be used as it currently is as a default. Regards, Anthony Corbett |
|||||||||||||||||||||||
| |||||||||||||||||||||||