Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
laceysanderson opened this issue May 15, 2017 · 3 comments
Open

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

laceysanderson opened this issue May 15, 2017 · 3 comments
Assignees

Comments

@laceysanderson
Copy link
Member

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
Copy link
Member

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
Copy link
Member Author

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
Copy link
Member Author

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

reynoldtan added a commit that referenced this issue May 29, 2017
- Added a select box to select genus.

- Updated projects table to show project Genus (2nd column). In the
event project has no genus set, warning or notice will be posted.

- Updated hook validate and hook submit to include genus when adding a
project.
reynoldtan added a commit that referenced this issue May 29, 2017
- Added a check to ensure project has a genus set before loading a page.
reynoldtan added a commit that referenced this issue May 29, 2017
…sm - Issue #12 Stock name lookup

- Allow admin to alter genus only when project has no data associated
to it.

- Limit stock validation to just the stocks in a given genus.
reynoldtan added a commit that referenced this issue May 29, 2017
- Linked AGILE to Lens as default genus.
reynoldtan added a commit that referenced this issue May 29, 2017
- Reorganized hook_form(), hook_validate and hook_submit() in
rawpheno.admin.form.inc file.
- Added code to link AGILE to Lens in hook_update().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants