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

Fix determination of qualitative vs. quantitative #79

Closed laceysanderson closed 5 years ago

laceysanderson commented 5 years ago

Metadata

Documentation:

Description

This PR adds automated testing to ensure the type of method is set properly. It also changes the default type to quantitative.

Dependencies

None

Testing?

  1. Create a project (Admin » Add Tripal Content » Project)
  2. Create germplasm for your file
    $species = 'databasica';
    for ($i=1; $i <= 15; $i++) {
    $stock = [
     'name' => 'GERM'.$i,
     'uniquename' => 'ID:'.$i,
     'type_id' => ['name' => 'SNP'],
     'organism_id' => ['species' => $species],
    ];
    $stock = chado_insert_record(
    'stock',
     $stock
    );
    }
  3. Configure the module for your organism (Administration » Tripal » Extensions » Analyzed Phenotypes » Configuration) by selecting at least a "Trait Vocabulary" and "Associated DB". Which you choose doesn't matter for testing purposes other then to ensure the trait is added to the vocabulary when loaded. Documentation: https://analyzedphenotypes.readthedocs.io/en/latest/admin_guide/configuration.html
  4. Upload a test file (Administration » Tripal » Extensions » Analyzed Phenotypes » Upload Phenotypic Data). Documentation: https://analyzedphenotypes.readthedocs.io/en/latest/user_guide/loading.html
  5. Check the type for the methods you uploaded using the following query:
    SELECT value
    FROM chado.cvtermprop
    WHERE 
    cvterm_id IN (SELECT cvterm_id FROM chado.cvterm WHERE name='YOUR UNIT HERE') AND
    type_id IN (SELECT cvterm_id FROM chado.cvterm WHERE name='additionalType');

NOTE: qualitative/quantitative are attached to the unit. In order to be detected as qualitative, a unit must have the word Scale in it; all other traits should be quantitative.

reynoldtan commented 5 years ago

My scale unit was correctly identified as qualitative trait, however, my other traits I set to metris with values 5.3, 2.2, 4.9 and 2.6 were set to qualitative as well. I was expecting it to be quantitative?

here is my data file. Screen Shot 2019-05-01 at 11 09 37 AM

laceysanderson commented 5 years ago

I just double checked and it works perfectly. metris is a common unit I've used in the past so maybe it re-used an existing unit in your case. Could you try again with a unique unit? You can ensure the unit doesn't already exist by using SELECT * FROM chado.cvterm WHERE name='YOUR UNIT HERE'; before you load your test data.

laceysanderson commented 5 years ago

Confirmed it works on Reynold's test site with his data. There was a problem with the clone he was working on originally which is unrelated to this PR. As such I'm merging this simple change.