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 show matching causatives #4412

Merged
merged 26 commits into from
Feb 8, 2024
Merged

Fix show matching causatives #4412

merged 26 commits into from
Feb 8, 2024

Conversation

northwestwitch
Copy link
Member

@northwestwitch northwestwitch commented Feb 8, 2024

This PR adds a functionality or fixes a bug.

Test with these variants:

Solved case --> https://scout-stage.scilifelab.se/cust002/F0015136

Variant not shown in:

Prepare for testing

  1. Make sure the PR is pushed and available on Docker Hub
  2. Fist book your testing time using the Pax software available at https://pax.scilifelab.se/. The resource you are going to call dibs on is scout-stage and the server is cg-vm1.
  3. ssh <USER.NAME>@cg-vm1.scilifelab.se
  4. sudo -iu hiseq.clinical
  5. ssh localhost
  6. (optional) Find out which scout branch is currently deployed on cg-vm1: podman ps
  7. Stop the service with current deployed branch: systemctl --user stop scout.target
  8. Start the scout service with the branch to test: systemctl --user start scout@<this_branch>
  9. Make sure the branch is deployed: systemctl --user status scout.target
  10. After testing is done, repeat procedure at https://pax.scilifelab.se/, which will release the allocated resource (scout-stage) to be used for testing by other users.
Testing on hasta server (Clinical Genomics Stockholm)

Prepare for testing

  1. ssh <USER.NAME>@hasta.scilifelab.se
  2. Book your testing time using the Pax software. us; paxa -u <user> -s hasta -r scout-stage. You can also use the WSGI Pax app available at https://pax.scilifelab.se/.
  3. (optional) Find out which scout branch is currently deployed on cg-vm1: conda activate S_scout; pip freeze | grep scout-browser
  4. Deploy the branch to test: bash /home/proj/production/servers/resources/hasta.scilifelab.se/update-tool-stage.sh -e S_scout -t scout -b <this_branch>
  5. Make sure the branch is deployed: us; scout --version
  6. After testing is done, repeat the paxa procedure, which will release the allocated resource (scout-stage) to be used for testing by other users.

How to test:

  1. Deploy current main branch on stage and make sure the matching causatives are not shown in the 2 cases mentioned above
  2. Switch to this branch and the matching causatives show be shown instead

Expected outcome:
The functionality should be working
Take a screenshot and attach or copy/paste the output.

Review:

  • code approved by DN
  • tests executed by CR

@northwestwitch northwestwitch changed the title Print a couple of debug messages Fix show matching causatives Feb 8, 2024
Copy link

codecov bot commented Feb 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7e2b1ea) 84.70% compared to head (6122610) 84.69%.

❗ Current head 6122610 differs from pull request most recent head 14b49e9. Consider uploading reports for the commit 14b49e9 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4412      +/-   ##
==========================================
- Coverage   84.70%   84.69%   -0.01%     
==========================================
  Files         310      310              
  Lines       18413    18412       -1     
==========================================
- Hits        15596    15594       -2     
- Misses       2817     2818       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@northwestwitch northwestwitch marked this pull request as ready for review February 8, 2024 10:18
@alkc
Copy link
Collaborator

alkc commented Feb 8, 2024

Sorry. x_x

@northwestwitch
Copy link
Member Author

northwestwitch commented Feb 8, 2024

Sorry. x_x

I also feel immediately guilty when it's code I've touched.. And given that I've touched most of the code in scout I feel always guilty (and in general I am guilty) 🤣

@@ -1397,13 +1397,7 @@ def _matching_causatives(
The subset of all secondary findings found in default gene panels
)
"""
matching_causatives_filter = list(
set(other_causatives_filter + other_causatives_in_default_panels_filter)
Copy link
Member Author

@northwestwitch northwestwitch Feb 8, 2024

Choose a reason for hiding this comment

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

In the specific case of the bug other_causatives_filter = [] because there are no panels in the safe search for the institute:

image

other_causatives_in_default_panels_filter comes from this function:
https://github.com/Clinical-Genomics/scout/blob/413d8301c84b4d070578ab53b7aed6a3ccb3f093/scout/server/blueprints/cases/controllers.py#L389C34-L389C64

I believe that that function is returning the list of genes in the case default panels, which is too limiting for searching for matching causatives in all cases of the institute

Copy link
Collaborator

@dnil dnil left a comment

Choose a reason for hiding this comment

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

🥇

matching_causatives = store.case_matching_causatives(
case_obj=case_obj, limit_genes=matching_causatives_filter
)
matching_causatives = store.case_matching_causatives(case_obj=case_obj)
Copy link
Collaborator

Choose a reason for hiding this comment

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

🥇 In the end it is safer and probably faster really with current indexes.

We conclude it was deviously hard to see, and a bit of the classic Python “[] is False” issue.
In this case a non-transitive version of it were give_me_them([]) + give_me_them([1, 2]) != give_me_them([] +[1, 2]).

In summary, we were likely without matching causatives outside the default panel from Oct. 😞 At any rate, don't blame yourself @alkc - we looked at the PR as well without realising, and it did not easily reproduce on local when I tested.

@@ -570,7 +570,7 @@ def case_matching_causatives(self, case_obj, limit_genes=None):
0:4
] # example: [ "17", "7577559", "G" "A"]

for variant_type in ["clinical", "reseach"]:
for variant_type in ["clinical", "research"]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

🐛 🐛 🐛

CHANGELOG.md Outdated
@@ -27,6 +27,7 @@ About changelog [here](https://keepachangelog.com/en/1.0.0/)
- Rename `Clinical significanc` to `Germline classification` in ClinVar submissions exported files
- Rename `Comment on clinical significance` to `Comment on classification` in ClinVar submissions exported files
- Show matching partial causatives on variant page
- Matching causatives query
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably add a slightly meatier explanation, including more exactly what was wrong and perhaps a date-range as well. The functionality is mostly for extra safety and speed, there is a world where we kind of rely on it to pick up less obvious phenotypes.

Copy link

sonarcloud bot commented Feb 8, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@northwestwitch northwestwitch merged commit 1e4a09a into main Feb 8, 2024
20 checks passed
@northwestwitch northwestwitch deleted the fix_matching_causatives branch February 19, 2024 09:38
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.

Matching causative not shown
4 participants