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

Fix RNA uploads/delivery message draft #4145

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Fix RNA uploads/delivery message draft #4145

wants to merge 13 commits into from

Conversation

islean
Copy link
Contributor

@islean islean commented Jan 23, 2025

Description

Closes #4115. The main change is that we filter on the RNA case's collaborators, rather than its samples' but it also merges the logic in the upload flow and the delivery message flow, where different parts of the code was used to link the RNA case to its DNA cases.

Added

Changed

  • The RNA uploads to Scout use the query logic found in the ReadHandler
  • More robust error raising in the ReadHandler for when there are multiple matching DNA samples or when no subject id is passed.

Fixed

How to prepare for test

  • Ssh to relevant server (depending on type of change)
  • Use stage: us
  • Paxa the environment: paxa
  • Install on stage (example for Hasta):
    bash /home/proj/production/servers/resources/hasta.scilifelab.se/update-tool-stage.sh -e S_cg -t cg -b fix-rna-uploads -a

How to test

  • Do ...

Expected test outcome

  • Check that ...
  • Take a screenshot and attach or copy/paste the output.

Review

  • Tests executed by
  • "Merge and deploy" approved by
    Thanks for filling in who performed the code review and the test!

This version is a

  • MAJOR - when you make incompatible API changes
  • MINOR - when you add functionality in a backwards compatible manner
  • PATCH - when you make backwards compatible bug fixes or documentation/instructions

Implementation Plan

  • Document in ...
  • Deploy this branch on ...
  • Inform to ...

@islean islean marked this pull request as ready for review January 28, 2025 12:03
@islean islean requested a review from a team as a code owner January 28, 2025 12:03
cg/store/api/data_classes.py Show resolved Hide resolved
cg/store/crud/read.py Show resolved Hide resolved
@diitaz93 diitaz93 self-requested a review January 28, 2025 12:26
Copy link
Contributor

@Vince-janv Vince-janv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof. At least the we use the same logic now 😅 Well done

cg/meta/upload/scout/uploadscoutapi.py Show resolved Hide resolved
cg/store/crud/read.py Show resolved Hide resolved
cg/store/api/data_classes.py Show resolved Hide resolved
Comment on lines +1696 to +1698
dna_samples_cases_analysis_query: Query = (
sample_query.join(Sample.links).join(CaseSample.case).join(Analysis)
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that we difenie these queries in cg/store/base.py. Also,maybe this function can be used instead _get_join_analysis_sample_family_query?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think BSV fought with this quite a bit in her PR and it might be that the behaviour was slightly different. Given that this is not something I have written, I would prefer not changing it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still defining it in base would enhance reusability and avoid code duplication

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But none of them add to an already existing query? Why should it be there?

cg/store/crud/read.py Outdated Show resolved Hide resolved
cg/store/crud/read.py Show resolved Hide resolved
cg/store/crud/read.py Show resolved Hide resolved
cg/store/crud/read.py Outdated Show resolved Hide resolved
cg/store/crud/read.py Show resolved Hide resolved
Copy link
Contributor

@diitaz93 diitaz93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good 👍

Copy link

@islean
Copy link
Contributor Author

islean commented Jan 29, 2025

Upload linking works ✅

[isak.ohlsson@hasta:2025-01-29] [S_base] $ cg upload rna-junctions-to-scout --dry-run sharpbulldog
----------------- UPLOAD -----------------
----------------- UPLOAD RNA JUNCTIONS TO SCOUT -----------------------
Uploading splice junctions bed file for sample ACC5701A14DS800C0M in case alerthawk in Scout.
Uploaded splice junctions bed file for sample ACC5701A14DS800C0M in case alerthawk.
Upload splice junctions bed file finished!
Uploading RNA coverage bigwig file for sample ACC5701A14DS800C0M in case alerthawk in Scout.
Uploaded bigwig coverage file for sample ACC5701A14DS800C0M in case alerthawk.
Upload RNA coverage bigwig file finished!
[isak.ohlsson@hasta:2025-01-29] [S_base] $

@clingen-sthlm clingen-sthlm deployed to stage January 29, 2025 15:49 Active
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.

Avoid cross collaboration RNA uploads
4 participants