-
Notifications
You must be signed in to change notification settings - Fork 5
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
Back end support for pool metrics #224
Conversation
217fb67
to
0da7389
Compare
…between use of id_product in mlwh tables
…ynamic shorten some lines for flake8
import sort
0da7389
to
2b6ae77
Compare
lang_qc/db/helper/wells.py
Outdated
well = self.get_mlwh_well_by_product_id(id_product) | ||
if well: | ||
product_metrics = well.pac_bio_product_metrics | ||
if len(product_metrics) == 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One product might still have a tag and trigger demultiplexing. Let's change to a confition that chacks whether well.demultiplex_mode
value contains the Instrument
substring.
lang_qc/db/helper/wells.py
Outdated
products=[ | ||
SampleDeplexingStats( | ||
id_product=prod.id_pac_bio_product, | ||
tag1_name=prod.pac_bio_run.tag_identifier, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The product table might be not linked to the pac_bio_run
table. It is fine to have either nothing or n/a
, but @ces asks for a reason to be clearly displayed. I wonder whether a comment
field should be added to this object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose I should have a deliberately unlinked test case to go with this possibility.
Given that this is a data integrity problem, I wonder whether the right thing to do is to return an error to the client (say catch the exception in the controller) and render something like "data unlinked, inform NPG"? That's more immediately informative than leaving empty holes for them to guess at the significance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree
@@ -77,6 +80,44 @@ def get_mlwh_well_by_product_id( | |||
) | |||
).scalar_one_or_none() | |||
|
|||
def get_metrics_by_well_product_id( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other QC metrics in lang_qc/models/pacbio/qc_data.py
have class methods to self-populate themselves. It might be reasonable to move this code to such class method
…o determine whether to run stats or not.
Added a check for unlinked data.
No description provided.