Princeton-LSI-ResearchComputing / tracebase

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

Improvements to MSRunsLoader.get_msrun_sequence. #980

Closed hepcat72 closed 4 weeks ago

hepcat72 commented 1 month ago

Summary Change Description

This was the direction I started in WRT #976. I basically was cleaning up the get_msrun_sequence method and cleared up some of the if conditionals that did not previously distinguish between lines from the input file that had no sequence name versus mzXML file loads that were not present in the infile. In fact, then code originally was written to avoid potential errors from the sequence defaults provided on the commentd line if in fact the defaults were not actually needed (i.e. everything was provided with values in --infile).

While I was at it, I finished a half-assed attempt I had never completed due to a change in direction: and that was the ability to supply only some of the options: --instrument, --operator, --date, and --lc-protocol-name. I'd realized part-way through the original effort that it's pretty likely that for example, only the date was enough to uniquely identify a sequence. That's why I added an exception in this effort called MultipleRecordsReturned (which inherits from both InfileError and MultipleObjectsReturned).

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: