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

Back end support for pool metrics #224

Merged
merged 18 commits into from
Jun 14, 2024

Conversation

nerdstrike
Copy link
Collaborator

No description provided.

@nerdstrike nerdstrike force-pushed the render_product_metrics branch from 217fb67 to 0da7389 Compare May 23, 2024 16:21
@nerdstrike nerdstrike force-pushed the render_product_metrics branch from 0da7389 to 2b6ae77 Compare June 5, 2024 08:23
@nerdstrike nerdstrike marked this pull request as ready for review June 5, 2024 08:24
@mgcam mgcam self-requested a review June 5, 2024 12:34
well = self.get_mlwh_well_by_product_id(id_product)
if well:
product_metrics = well.pac_bio_product_metrics
if len(product_metrics) == 1:
Copy link
Member

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/models/pacbio/qc_data.py Show resolved Hide resolved
products=[
SampleDeplexingStats(
id_product=prod.id_pac_bio_product,
tag1_name=prod.pac_bio_run.tag_identifier,
Copy link
Member

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.

Copy link
Collaborator Author

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.

Copy link
Member

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

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

@mgcam mgcam merged commit 6516d9b into wtsi-npg:devel Jun 14, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants