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

Small event projection #4659

Closed dnil closed 3 weeks ago

dnil commented 3 weeks ago

This PR adds a functionality or fixes a bug.

I added a very simple hiding functionality for matching causatives. They will now only show (and compute) on the case page if requested.

Screenshot 2024-06-04 at 13 16 59

And clicking it: Screenshot 2024-06-04 at 13 17 07

I'm sure this could be rather smoothly done in js as well with a request to fill in that part of the document and does the compute in a new api endpoint. But simple can be good. Thoughts?

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:

  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:

dnil commented 3 weeks ago

Checked again, and I can't help think the most salient thing is one huge db query with a a couple of different $in: my_large_variant_or_gene_list. Ill see if we can't do it a bit less often..

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 55.55556% with 8 lines in your changes missing coverage. Please review.

Project coverage is 84.49%. Comparing base (8c6ddc4) to head (aa5c119).

Files Patch % Lines
scout/server/blueprints/cases/controllers.py 46.66% 8 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #4659 +/- ## ========================================== - Coverage 84.62% 84.49% -0.13% ========================================== Files 310 310 Lines 18789 18798 +9 ========================================== - Hits 15900 15884 -16 - Misses 2889 2914 +25 ```

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

dnil commented 3 weeks ago

While it doesn't solve the slowness of loading the page when looking for matching causatives, I feel this solution might be a good compromise to load the page when causatives don't have to be shown. I guess not all users would like it, but perhaps we could try it and see the feedback we get?

Thank you for the review! Ill ask around a little today and try to form a final opinion.

As I mentioned in my comments I would make that hide_matching variable a boolean.

Yes, that would be more natural, in the best of worlds. Its pragmatic. šŸ˜ May I say be my guest and refactor that separately if you feel strongly about it? šŸ˜Š It is nerve wrecking to get that to work in all situations, mostly since flask and jinja treat bools differently (false vs False and the browser needs to play along with "false" /"False") - see comment.

Other thing that could be improved is adding some spacing on the left to text in this panel (it's like this on main like now):

Yes! And I was thinking maybe to add a little chevron or sth to indicate there is stuff to "fold out" under it?

northwestwitch commented 3 weeks ago

Thank you for the review! Ill ask around a little today and try to form a final opinion.

šŸ‘šŸ»

As I mentioned in my comments I would make that hide_matching variable a boolean.

Yes, that would be more natural, in the best of worlds. Its pragmatic. šŸ˜ May I say be my guest and refactor that separately if you feel strongly about it? šŸ˜Š It is nerve wrecking to get that to work in all situations, mostly since flask and jinja treat bools differently (false vs False and the browser needs to play along with "false" /"False") - see comment.

I've pushed some code that seems to work, see how you like it. Feel free to revert if you don't.

Other thing that could be improved is adding some spacing on the left to text in this panel (it's like this on main like now):

Yes! And I was thinking maybe to add a little chevron or sth to indicate there is stuff to "fold out" under it?

Sounds great!

dnil commented 3 weeks ago

Thank you for the review! Ill ask around a little today and try to form a final opinion.

šŸ‘šŸ»

As I mentioned in my comments I would make that hide_matching variable a boolean.

Yes, that would be more natural, in the best of worlds. Its pragmatic. šŸ˜ May I say be my guest and refactor that separately if you feel strongly about it? šŸ˜Š It is nerve wrecking to get that to work in all situations, mostly since flask and jinja treat bools differently (false vs False and the browser needs to play along with "false" /"False") - see comment.

I've pushed some code that seems to work, see how you like it. Feel free to revert if you don't.

Ok, I'll definitely test it out with a couple of browsers since you took the time: I think it has potential! But not entirely sure having to go via ast to keep it kind of bool is better than passing a string. šŸ˜„

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

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

See analysis details on SonarCloud

dnil commented 3 weeks ago

Looks good on stage as well: Screenshot 2024-06-05 at 12 12 39