UofS-Pulse-Binfo / analyzedphenotypes

Tripal/Drupal support for analyzed phenotypic data including data loaders, exporters, trait pages and summaries on germplasm pages.
GNU General Public License v2.0
0 stars 1 forks source link

Decouple chart type from qualitative/quantitative #103

Closed laceysanderson closed 5 years ago

laceysanderson commented 5 years ago

Metadata

Documentation:

Description

Currently the chart type (i.e. violin vs. histogram) is controlled by whether the unit is qualitative or quantitative. For example, the data for stem pigmentation measured with a scale 1-3 (qualitative) will show as a histogram and the same trait measured with a greenseeker (quantitative) will show as a violin.

However, there are other cases where you may prefer one chart type over another. For example, if there is only a single site-year (histogram) or the data is clearly bimodal (Violin). Thus we need a way to decouple the chart type from the unit.

Dependencies

NONE

Testing?

  1. Switch to the branch on your development site.
  2. Run updates: Admin toolbar > House > Run Updates
  3. Check the database: SELECT * FROM analyzedphenotypes_collections;. The table should exist and be populated with one record for every unique trait/method/unit/project combination.
  4. Run `the following query. The chart_type should be multibar for qualitative traits and violin for quantitative.
    SELECT coll.*, prop.value as data_type 
    FROM analyzedphenotypes_collections coll 
    LEFT JOIN chado.cvtermprop prop ON prop.cvterm_id=coll.unit_id;
  5. Go to the trait distribution chart for a given data collection using the following URL template: [yoursite]/phenotypes/trait-distribution/[project_id]/[trait_id]/[method_id]/[unit_id]. Check the chart type matches that specified in the table.
  6. Change the chart_type in the table and check the chart type changes as well.
    UPDATE analyzedphenotypes_collections 
    SET chart_type='violin' 
    WHERE collection_id=5;
carolyncaron commented 5 years ago

This worked flawlessly on my development site 🎉