Ticket #159 (closed enhancement: fixed)
|Reported by:||business@…||Owned by:||s.h.sikkema@…|
Description (last modified by business@…) (diff)
We need to implement the querying functionality as specified in the mockups on https://wiki.nbic.nl/index.php/DbNPFeatures#User_Interface_to_query_both_metadata_and_omics_data.
This is a big task, that we need to do in iterations. The first task, which is also what is needed for the DSP most at this stage, is to be able to export a study assay with a combination of the metadata and the measurement data from the module. In the DSP case, those are metabolomics peaks, but since the query REST interface that has to be implemented is general, we might as well program it general so that it will also work with other modules. We will for this ticket however test with the metabolomics module.
So to be clear, the outcome of the wizard should be an Excel file with for every sample in a certain assay, some metadata information and measurement information from the clean data module in which the assay data resides.
This functionality should reside under a new menu called 'Assays', and it should be named 'Export data to Excel'. When you click this, you should get a wizard with the following steps:
First step: Select assay
- Dropdown: Select study (if a person is not logged in, redirect to login first, see View studies page how to do that)
- Dropdown dependent on chosen study: Select assay
After first step: check if assay exists, clean data module is reachable, and actually has data for that assay, if not display an error message.
Second step: Which metadata to include
- Checkbox: Subject data (optionally: show checkboxes for all fields that actually contain data for any sample, you can determine this by checking for all sample.parentSubject.giveFields() field if (sample.parentSubject.getField(field)) (hint: have a look at study/show, that one also only shows fields which actually have data)
- Checkbox: Sampling Event data (optionally: show checkboxes for all Sampling Event fields that contain any data for sample.parentEvent)
- Checkbox: Event data (also here optionally give the possibility to tick only specific fields) --> you can get the events by iterating over Sample.parentEventGroup.events
- Checkbox: Sample data (same here)
- Checkbox: Sample metadata from assay module (check if there is any via the REST method getSampleMetadataFields() of the assay module, in this testcase the metabolomics module)
Note: Sample parentEvent, parentSubject and parentEventGroup are nullable, so in case e.g. no subject is available for any sample, you can totally gray out Subject information.
All of these options should be on by default, the most likely case is that the user just wants a dump of all available information.
Third step: which assay data to include
This step requires some more calls to the assay module (in this testcase, the metabolomics module). At this point, call getMeasurements(assayToken) to determine which measurements were done in the assay.
Initially, just present the user with two choices here:
- Optionbox: Get all [getMeasurements().count] measurements
- Optionbox: Get a specific measurement: [dropdown with all measurements]
Final step: display confirmation
In this step, display the first five resulting rows of the Excel file. If there are more than 5 measurements in the assay module, also only show the first five columns.
The rows in this table obviously are all the samples in the assay.
The columns in the table are:
- Sample name (always the first column)
- Sample group (Sample.parentEventGroup.name) (if given for any sample)
- Optionally, if specified, additional GSCF Sample properties
- Optionally, if specified, additional assay module sample properties
- Optionally, if specified, GSCF Subject properties
- Optionally, if specified, GSCF Sampling Event properties
- Optionally, if specified, GSCF Event properties
- Then, the specified measurements from the assay module (all or just one) --> you can get this data by calling getMeasurementData()