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

Better ClinVar tooltips and added exclude clinsig status for SNVs filter #4993

Draft
wants to merge 37 commits into
base: main
Choose a base branch
from

Conversation

northwestwitch
Copy link
Member

This PR adds a functionality or fixes a bug.

New checkbox

image

Better tooltip

image

New tooltip

image

Note that this PR is only covering SNVs filters, I plan to add the exclude filter to the other categories in another PR (I think it's going to be easier to review this way)

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. how to test it, possibly with real cases/data

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

Review:

  • code approved by
  • tests executed by

@northwestwitch northwestwitch marked this pull request as draft November 4, 2024 09:24
Copy link

codecov bot commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.

Project coverage is 84.78%. Comparing base (a38bdf1) to head (f888651).

Files with missing lines Patch % Lines
scout/adapter/mongo/query.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4993      +/-   ##
==========================================
- Coverage   84.78%   84.78%   -0.01%     
==========================================
  Files         323      323              
  Lines       19432    19435       +3     
==========================================
+ Hits        16475    16477       +2     
- Misses       2957     2958       +1     

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


🚨 Try these New Features:

@northwestwitch northwestwitch marked this pull request as ready for review November 4, 2024 10:13
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.

Super with the tooltip!

Looks nice, but I have a few issues with the functionality?
First, the exclude now seems exclusive, e.g. removing variants without clinvar hits. That is not intended. One would like to whittle down the list of variants, say avoiding seeing the ones that are known Benign or Likely benign, but seeing the rest.

Exclusion filtering on my local still seems bugged?
Screenshot 2024-11-05 at 08 50 16
I'll give it the benefit of the doubt if it works on stage (I have been messing with setup quite a bit) but I think we are not quite there yet?

I also still haven't quite wrapped my head around what would be supposed to happen if you check exclude and high significance, but giving the high significance priority is needed for clincal filter, so all good.

scout/adapter/mongo/query.py Show resolved Hide resolved
scout/adapter/mongo/query.py Outdated Show resolved Hide resolved
@@ -113,6 +113,7 @@ class VariantFiltersForm(FlaskForm):
compound_follow_filter = BooleanField("Compounds follow filter")
cadd_inclusive = BooleanField("CADD inclusive")
clinsig = NonValidatingSelectMultipleField("ClinVar CLINSIG", choices=CLINSIG_OPTIONS)
clinsig_exclude = BooleanField("Exclude significance")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Optionally drop "significance"; should be as clear from context and tooltip.

tests/adapter/mongo/test_query.py Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
{"revstat": re.compile("|".join(trusted_revision_level))},
]
}
}
}
else:
LOG.debug("add CLINSIG filter for rank: %s" % ", ".join(str(query["clinsig"])))
clnsig_query = {"clnsig": {"$elemMatch": {"$or": elem_match_value}}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Keep missing value!

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I'll fix, thanks!

@northwestwitch northwestwitch marked this pull request as draft November 5, 2024 11:00

Returns:
clinsig_query(dict): a dictionary with clinsig key-values
def clinsig_query(self, query: dict) -> dict:
Copy link
Member Author

Choose a reason for hiding this comment

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

This function is only refactored, but it returns the same dict as before

@northwestwitch
Copy link
Member Author

I'll wait for this one until we have #5006 in place, because they are touching the same code

Copy link

sonarcloud bot commented Nov 22, 2024

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