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 #5075 - variant filters is redecorated #5076

Merged
merged 6 commits into from
Nov 26, 2024
Merged

Conversation

dnil
Copy link
Collaborator

@dnil dnil commented Nov 26, 2024

This PR adds a functionality or fixes a bug.

Testing on cg-vm1 server (Clinical Genomics Stockholm)

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. add multiple categories of annotations (e.g. causative, pin, comment, classification, evaluation) to a variant
  2. note the general case report crashing
  3. apply patch, and see report working

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

Review:

  • code approved by CR
  • tests executed by CR

Copy link

codecov bot commented Nov 26, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 84.80%. Comparing base (0487d56) to head (56ce00b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
scout/server/blueprints/variant/utils.py 80.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5076      +/-   ##
==========================================
- Coverage   84.81%   84.80%   -0.01%     
==========================================
  Files         323      323              
  Lines       19475    19484       +9     
==========================================
+ Hits        16517    16524       +7     
- Misses       2958     2960       +2     

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

Copy link
Member

@northwestwitch northwestwitch left a comment

Choose a reason for hiding this comment

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

💯

@@ -12,6 +12,8 @@ About changelog [here](https://keepachangelog.com/en/1.0.0/)
- Panel version check while editing the genes of a panel
- Display unknown filter tags as "danger" marked badges
- Open WTS variantS SNVs and SVs in new tabs
- Variant filters redecoration from multiple classifications crashes general case report

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Eh, we have always had two lines between the unreleased and released section? I guess we could change that if you like, but... 🤷‍♂️ Would say prettier have an automated opinion? 😸

Copy link
Member

Choose a reason for hiding this comment

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

Wasn't it one? That's why I keep fixing the changelogs 😆
Also because there is always one line in between the old releases

Copy link
Collaborator Author

@dnil dnil Nov 26, 2024

Choose a reason for hiding this comment

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

I always remove it for the release branch, but keep it in all the other PRs. 🤷‍♂️

Copy link
Member

Choose a reason for hiding this comment

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

We can continue like this: you add the line and I remove it! 🤣

)
for f in map(lambda x: x.lower(), variant_obj["filters"])
]
variant_filters = variant_obj["filters"]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
variant_filters = variant_obj["filters"]
variant_filters = variant_obj.get("filters",[])

Copy link
Member

Choose a reason for hiding this comment

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

Safer perhaps?


filters: List[Dict[str, str]] = []

for f in variant_filters:
Copy link
Member

@northwestwitch northwestwitch Nov 26, 2024

Choose a reason for hiding this comment

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

This works, but I like the idea of refactoring because when we have to start having these solutions it means we have some convoluted code before..

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Indeed. It would seem natural to pull the only-show-a-variant-once code in from the template to the controller, and then invoke the variant decorator only once per variant.

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 made an issue so we don't forget: #5078

Copy link
Member

Choose a reason for hiding this comment

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

Nice, I saw! 🚀

@dnil dnil merged commit 21e1283 into main Nov 26, 2024
25 checks passed
@dnil dnil deleted the fix_callers_redecoration branch November 26, 2024 13:56
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.

General report "novel" filter tags
3 participants