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

Stock Names Look-up should be restricted to an organism. #12

Open laceysanderson opened 7 years ago

laceysanderson commented 7 years ago

We need to check that when the stock_id for a given row is looked up, we restrict the query to the organism. Currently, if you try to load data for any of the breeding program crosses, the system returns validation telling you they are not unique when in fact they are -by organism.

Each phenotyping project should only collect data for a single organism. Therefore, we can solve this bug by saving the organism for a project in the projectprop table and then looking it up when validating or loading a raw phenotype dataset. We should add form elements to the admin manage projects interface to allow setting of the organism.

reynoldtan commented 7 years ago

Question: When inserting a row to projectprop, I've use cvterm genus, and together with project id and the organism value make up a record. In uninstall hook, when deleting any module related records, I've used the project id and the genus cvterm_id to delete. However, I feel like I might inadvertently delete rows used by other module that uses genus cvterm and same project id.

Would it be safer if I create a cv term rawphenotypes_genus in the same way as rawphenotypes_measurements for traits? this way I can be sure to safely delete only the rows with this cvterm.

Please advice.

laceysanderson commented 7 years ago

The approach you've taken for inserting the project property is perfect. Just don't delete this information on module uninstall. Even without raw phenotypes, the project validly contains data related to that organism. Thus there is no need to remove that information.

On a more general note, modules should never delete information from Chado on uninstall. This is a Tripal rule and ensures that the data in Chado which can be being used by systems other then Tripal is always left intact.

laceysanderson commented 7 years ago

13 has been merged so you can work on this one again.