Clinical-Genomics / scout

VCF visualization interface
https://clinical-genomics.github.io/scout
BSD 3-Clause "New" or "Revised" License
147 stars 43 forks source link

Fix PanelApp panel not saving genes with empty `EnsembleGeneIds` list #4647

Closed northwestwitch closed 3 weeks ago

northwestwitch commented 1 month ago

This PR adds a functionality or fixes a bug.

Note that there are some genes that are missing Ensembl IDs in PanelApp, for instance KCNJ18 (only by chance this gene is present only in build 38 in scout)

image

The problem is that scout relies on Ensembl gene - HGNC ID mappings to load the genes in PanelApp panels

Testing on cg-vm1 server (Clinical Genomics Stockholm) **Prepare for testing** 1. Make sure the PR is pushed and available on [Docker Hub](https://hub.docker.com/repository/docker/clinicalgenomics/scout-server-stage) 1. Fist book your testing time using the Pax software available at [https://pax.scilifelab.se/](https://pax.scilifelab.se). The resource you are going to call dibs on is `scout-stage` and the server is `cg-vm1`. 1. `ssh @cg-vm1.scilifelab.se` 1. `sudo -iu hiseq.clinical` 1. `ssh localhost` 1. (optional) Find out which scout branch is currently deployed on cg-vm1: `podman ps` 1. Stop the service with current deployed branch: `systemctl --user stop scout.target` 1. Start the scout service with the branch to test: `systemctl --user start scout@` 1. Make sure the branch is deployed: `systemctl --user status scout.target` 1. After testing is done, repeat procedure at [https://pax.scilifelab.se/](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 @hasta.scilifelab.se` 1. Book your testing time using the Pax software. `us; paxa -u -s hasta -r scout-stage`. You can also use the WSGI Pax app available at [https://pax.scilifelab.se/](https://pax.scilifelab.se). 1. (optional) Find out which scout branch is currently deployed on cg-vm1: `conda activate S_scout; pip freeze | grep scout-browser` 1. Deploy the branch to test: `bash /home/proj/production/servers/resources/hasta.scilifelab.se/update-tool-stage.sh -e S_scout -t scout -b ` 1. Make sure the branch is deployed: `us; scout --version` 1. 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: Try loading the panel 229 (all genes, also red ones) in scout using main branch and this branch (you should load genes in both builds first):

scout --demo load panel --panel-app --institute cust000 --panel-id 229 --panel-app-confidence red

Expected outcome:

Review:

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 75.00000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 84.62%. Comparing base (2112466) to head (f2a4ea4).

Files Patch % Lines
scout/parse/panel.py 50.00% 4 Missing :warning:
scout/load/panel.py 80.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #4647 +/- ## ========================================== - Coverage 84.63% 84.62% -0.01% ========================================== Files 310 310 Lines 18774 18788 +14 ========================================== + Hits 15889 15899 +10 - Misses 2885 2889 +4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

northwestwitch commented 1 month ago

Main branch:

image

This branch:

image image
northwestwitch commented 1 month ago

Well spotted - and good intuition - it really was a different thing! I'm hesitant about the solution, after having made many pained constructions trying to keep parse free from importing adapter. It's not that I really like the construction with a separate module of parser functions - the parser should be in a corresponding Loader Class - but it's what it looks like, and the spaghetti would get worse by importing adapter into it as well.

No, I agree, there is another solution, I'll propose it!

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

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

See analysis details on SonarCloud