Princeton-LSI-ResearchComputing / tracebase

Mouse Metabolite Tracing Data Repository for the Rabinowitz Lab
MIT License
4 stars 1 forks source link

Added an all missing treatments exception #930

Closed hepcat72 closed 6 months ago

hepcat72 commented 6 months ago

Summary Change Description

The excel file template creation is implemented such that if a user supplies an existing study sheet, it will add samples to that file. The samples haven't been added yet, but as a part of that template, it also pre-populates the treatments and tissues like we currently have in the previous template. When adding to an existing study doc however, there's the possibility that Tissues or treatments referenced in the Animals and Samples sheets might be missing. Thus, these exceptions were modified/added:

Since the plan is to attach errors directly to cells in the spreadsheets in the form of comments, I changed how MissingTissues exceptions were structured. Instead of containing a summary of all tissues missing from 1 file, each exception is created for a single cell in a sheet of 1 file. And AllMissingTissues was changed to contain a list of those individual cell exceptions.

Treatments was handled in the same way.

This entire effort just took a couple hours this morning, including tests, so it was quick.

Affected Issues/Pull Requests

Review Notes

See comments in-line.

Checklist

This pull request will be merged once the following requirements are met. The author and/or reviewers should uncheck any unmet requirements:

hepcat72 commented 6 months ago

While missing Tissues is certainly a problem (they will need to be added before data can be loaded), treatments are typically supplied along with the animal/sample sheet and aren't assumed to be in the database. I'm not sure I follow the logic of raising exceptions for them when we are adding samples to an existing sheet.

The mechanism for adding the samples will be the same. I'm thinking of it in 2 ways:

Yes, adding tissues is not the direct goal, but going through quickly adding them means that doing the same thing for samples and treatments will be nearly plug and play.