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

Truncate long HGVS descriptions on cancer SNVS and SNV pages #5183

Merged
merged 4 commits into from
Jan 20, 2025

Conversation

northwestwitch
Copy link
Member

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. 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

Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.46%. Comparing base (65630b3) to head (40860ef).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5183   +/-   ##
=======================================
  Coverage   84.46%   84.46%           
=======================================
  Files         327      327           
  Lines       19800    19800           
=======================================
  Hits        16725    16725           
  Misses       3075     3075           

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

@northwestwitch
Copy link
Member Author

northwestwitch commented Jan 20, 2025

Tested with this case, check the second page of the SNVs

Main branch

image image

This branch

image

image

@northwestwitch northwestwitch marked this pull request as ready for review January 20, 2025 08:59
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.

👍

@@ -235,10 +235,10 @@ <h6 class="card-header">Variant callers</h6>
<span class="text-muted">exon </span><strong>{{ primary_gene.exon }}</strong>
{% endif %}
{% if primary_transcript and primary_transcript.coding_sequence_name %}
{{ primary_transcript.coding_sequence_name | url_decode }}
{{ primary_transcript.coding_sequence_name | url_decode | truncate(50, True) }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

<a target="_blank" href="{{ url_for('variant.cancer_variant', institute_id=institute._id, case_name=case.display_name,
variant_id=variant._id, cancer='yes') }}">
{% if variant.first_rep_gene.hgvs_identifier %}
<div>{{ variant.first_rep_gene.hgvs_identifier }}</div>
<div>{{ (variant.first_rep_gene.hgvsp_identifier or '') |url_decode }}</div>
<div>{{ variant.first_rep_gene.hgvs_identifier|truncate(30, True) }}</div>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is better than current main on layout, but we should ideally have like a pretty print for these as well, e.g. giving coord and ins and/or del and the number of bp instead of the exact sequence of each if it goes over an annoying number of chars in total.

Copy link
Member Author

@northwestwitch northwestwitch Jan 20, 2025

Choose a reason for hiding this comment

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

Ideally it would be nice to have a common way for cancer and non-cancer variants (the HGVS of these are handled in an easier way). Here it is complicated by the first and second representative gene which can be missing also. Felt safer to keep the code basically the same and just truncate strings if they are long. Let's merge and revisit if we touch this code in the future

@northwestwitch northwestwitch merged commit df6f765 into main Jan 20, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Long protein strings in hgvs description on e.g. cancer variantS page, summary etc
2 participants