UofS-Pulse-Binfo / rawphenotypes

A Tripal module for storing raw phenotypic data. Specifically meant to help researchers contribute raw data, visualize summaries and download for further analysis.
2 stars 2 forks source link

Creates rawphenotypes germplasm field #88

Closed reynoldtan closed 2 years ago

reynoldtan commented 2 years ago

This PR will create a Custom Tripal Field that will add raw phenotypes download functionality to germplasm page. raw-germplasm-page-mockup

Metadata

Documentation:

Description

Dependencies

Testing?

Setup

  1. On a KP clone, update rawphenotypes module and switch branch to rawphenotypes-germplasm-field
  2. Clear cache (optional)
  3. Setup Tripal Field in Structure -> Tripal Content Types and click on Manage Fields operation for Germplasm Accession content type.
  4. Once in this page click +Check for new fields. This will ensure that the rawphenotypes germplasm field will be discovered. add-field
  5. Click Manage Display tab and set up the following items: A. A group titled Raw Phenotypes and set the format to Tripal Pane B. Under this group add an item clicking the + symbol preceding Germplasm Raw Phenotypes Field field-setup

NOTE: at the moment the cog icon to update id, classes and visibility option is causing an AJAX error leaving this field to be hidden by default (hide = yes).

  1. Search a germplasm - you can use the germplasm search in homepage for example CDC Robin AGL.

The Interface

  1. Test accessibility by changing the screen size of the browser while on germplasm page for CDC Robin AGL. Ensure that the field elements are still accessible.
  2. Test controls work - click on Raw Phenotypes definition and link to Download Page.
  3. Export Test: Select a Trait of interest and expand the select option for Location/Experiment. select
  4. Note some experiments are disabled when experiment is not assigned to the current user as specified in the warning on screen.
  5. When selecting an active location/experiment the document icon activates and clicking it will launch a new window to begin data export identical to the download features seen in Download Page of rawphenotypes.
  6. Allow module to fetch dataset and prepare export file. download
  7. Click file link to view result. The resulting phenotypes should be filtered to match the germplasm, experiment, location and trait.
ruobinLiu commented 2 years ago

For step #7: downloaded file contains germplasm, location and trait applied, but misses experiment. An additional trait, # of Seeds Planted (count), is always included by default. Screen Shot 2022-01-17 at 2 51 19 PM .

reynoldtan commented 2 years ago

Experiment column added to results image

ruobinLiu commented 2 years ago

I am now able to see the experiment column on my new dev fresh, PR works as expected. Great job šŸ‘

reynoldtan commented 2 years ago

Revised field formatter to use template file for the markup. I have kept all array construct - array() since it is used throughout the module and I have checked off item My code follows the code style of this project above. In my recent work of the module for Drupal 8/9 all instances of this array have been converted to the short array syntax.

reynoldtan commented 2 years ago

Revised the field instance and formatter to use cvterms as array keys. I have setup a cv name and named it in the same way as other cvs used by rawphenotypes (ie phenotype_measurement_units, phenotype_measurement_types etc.). I chose the name phenotype_customfield_terms and created the cv terms experiment, id, name, location, summary, experiment, user_experiment and trait to be used as keys. This cv will hold other terms in the future should raw phenotype custom field require other more terms.

reynoldtan commented 2 years ago

On it, I will setup the ALL option in the next commit šŸ‘

reynoldtan commented 2 years ago

image

I have added a filter by switch to allow export of phenotypes by either experiment or location + experiment. In addition to this option, users can download everything (all experiment user has permission to) in a trait + germplasm using the download all button preceding each trait. I also add expand table view and search trait to make finding a trait of interest less painful šŸ˜„ .

Tested

laceysanderson commented 2 years ago

I'm loving the new "Export everything in a trait + germplasm" button! Did a quick review on the new code since the last review and I think this is good :-)

I'm going to merge now but we won't update KP until July so nothing goes wrong right before the workshop ;-p