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 #4958 - IGV button names and IGV MT overview link #4976

Merged
merged 32 commits into from
Nov 15, 2024
Merged

Conversation

dnil
Copy link
Collaborator

@dnil dnil commented Oct 22, 2024

This PR changes the names on IGV buttons (to IGV DNA, IGV RNA, IGV MT), avoiding the "viewer" tautology and the use of "splicing" when we also have full RNA alignments. Also adds an IGV MT overview button from the collapsible toolbar. Also added a magnifying glass icon for existing data, and use the ring-X icon consistently for missing data.

Partly by following the style on one page, I reverted to disable and tooltip to indicate missing alignments. The tooltips are not really available without viewing source on disabled buttons in the current bootstrap. It would be possible to get them displayed by moving them to regular html title tooltips, or a separate js tooltip class, setting pointer-events: none; to avoid the bootstrap pointer block, if we feel this is important.
Screenshot 2024-10-22 at 09 26 40
Screenshot 2024-10-22 at 09 54 16
Screenshot 2024-10-22 at 08 57 35
Screenshot 2024-10-22 at 08 57 16

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 Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.76%. Comparing base (91887a9) to head (602e5e7).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4976   +/-   ##
=======================================
  Coverage   84.76%   84.76%           
=======================================
  Files         320      320           
  Lines       19359    19359           
=======================================
  Hits        16410    16410           
  Misses       2949     2949           

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

@dnil dnil added the Frontend label Oct 22, 2024
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.

Nice! Simpler for the users, which will be pleased.

A couple of minor things:

  1. For consistency, would be nice to deactivate the MT button when the mt_bam are missing (see my comment on the case sidebar)
  2. Add a tooltip on variant page, explaining the the DNA button us deactivated because the bam files are missing:
image

CHANGELOG.md Show resolved Hide resolved
@northwestwitch
Copy link
Member

Let me know when you are ready for another review on this one @dnil. I was thinking that perhaps we can merge this and create a new release with what we have today?

@dnil dnil mentioned this pull request Nov 14, 2024
22 tasks
@dnil
Copy link
Collaborator Author

dnil commented Nov 14, 2024

Nice! Simpler for the users, which will be pleased.

A couple of minor things:

  1. For consistency, would be nice to deactivate the MT button when the mt_bam are missing (see my comment on the case sidebar)
  2. Add a tooltip on variant page, explaining the the DNA button us deactivated because the bam files are missing:

Good points! Both should now be addressed; happy for a new review when you have time!

@northwestwitch
Copy link
Member

I've been testing only with demo samples for now and noticed that with the demo RD case, which has mito bams for the individuals, if you go on a mt variant, then alignments are not available:

image

It's not the expected behavior I guess? I'll continue testing!

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.

Still some issues with the double boolean when the variant is an MT variant. I would simplify the code so it's more readable, even if you repeat the code button twice (the if and the else), check my comment!

@@ -29,6 +30,7 @@ About changelog [here](https://keepachangelog.com/en/1.0.0/)
- STRs variants export
- ClinVar submission enquiry status for all submissions after the latest


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

@@ -355,11 +355,17 @@ <h6>Phenotype terms (HPO):</h6>
{% endif %}
</div>
<div class="col-3">
{% if variant.is_mitochondrial and case.mt_bams or case.bam_files %}
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps to keep it simple one could keep the original if and else (which were working) and in the case of else put the code for a button which is deactivated and has the tooltip. Because honestly it would be easier to maintain..

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, though that will be a bit redundant. I would prefer not to keep this statement, as it is very hard to read. Jinja dont really make there operator priority super clear, and it lacks parenthesis to disambiguate
(variant.is_mitochondrial and case.mt_bams) or case.bam_files from variant.is_mitochondrial and (case.mt_bams or case.bam_files)

Copy link
Member

Choose a reason for hiding this comment

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

Sure, though that will be a bit redundant. I would prefer not to keep this statement, as it is very hard to read. Jinja dont really make there operator priority super clear, and it lacks parenthesis to disambiguate (variant.is_mitochondrial and case.mt_bams) or case.bam_files from variant.is_mitochondrial and (case.mt_bams or case.bam_files)

You can also keep it as it was:

else: "No alignments available"

@dnil
Copy link
Collaborator Author

dnil commented Nov 15, 2024

Ok, here goes - a bit more redundant html, but the logic is easier and actually works for all the views and missing/not missing combos instead. You win some and loose some. 😉

<div class="panel-default">
{{ comments_panel(institute, case, current_user, comments) }}
</div>
<div class="col-xs-12 col-md-12">{{ smn_individuals_table(case, institute, tissue_types) }}</div>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ws

</span>
{% endif %}
{% if case.vcf_files.vcf_sv %}
<span class="d-flex">
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ws

<span class="me-3">
<form action="{{url_for('variants.sv_variants', institute_id=institute._id, case_name=case.display_name) }}">
<input type="hidden" id="hgnc_symbols" name="hgnc_symbols" value="SMN1, SMN2"></input>
<input type="hidden" id="gene_panels" name="gene_panels" value="['']"></input>
<button type="submit" class="btn btn-secondary btn-sm" target="_blank" rel="noopener" data-bs-toggle="tooltip" title="Structural variants view filtered for the genes SMN1 and SMN2">SVs</button></span>
<button type="submit" class="btn btn-secondary btn-sm" target="_blank" rel="noopener" data-bs-toggle="tooltip" title="Structural variants view filtered for the genes SMN1 and SMN2">SVs</button>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

formatting error fix en passant

<div class="col-sm-12">{{activity_panel(events)}}</div>
</div>
<span class="me-3"
{% if not case.bam_files %}title="Alignment file(s) missing" data-bs-toggle="tooltip"{% endif %}>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We could loop these, but there will only ever be two.


{{ modal_synopsis() }}
<div class="row">
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

same actual order as before

{% else %}
- BAM file(s) missing
{% endif %}
{% if variant.is_mitochondrial and not case.mt_bams %}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

a little repetitive, but an easier read

Copy link
Member

Choose a reason for hiding this comment

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

I like it, redability is important

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.

Works great now! 👍🏻

<div href="#" class="bg-dark list-group-item d-inline-block text-white">
{% if case.bam_files %}
<div href="#" class="bg-dark list-group-item d-inline-block text-white"
{% if not case.bam_files %} data-bs-toggle="tooltip" title="Alignment file(s) missing" {% endif %}>
Copy link
Member

Choose a reason for hiding this comment

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

👍🏻

{% else %}
- BAM file(s) missing
{% endif %}
{% if variant.is_mitochondrial and not case.mt_bams %}
Copy link
Member

Choose a reason for hiding this comment

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

I like it, redability is important

<form action="{{url_for('alignviewers.sashimi_igv', institute_id=case['owner'], case_name=case['display_name']) }}" target="_blank" rel="noopener">
<button role="submit" data-bs-toggle="tooltip" data-bs-placement="top" title="Available in build GRCh{{ case.rna_genome_build or '38' }}" class="btn btn-xs form-control btn-secondary">R<span class="menu-collapsed">NA splicing</span></button>
</div>
<div href="#" class="bg-dark list-group-item d-inline-block text-white"
Copy link
Member

Choose a reason for hiding this comment

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

Nice, this way it's much clearer what can be viewed in IGV!

image

@@ -76,7 +76,7 @@
disabled" title="Alignment file(s) missing" data-bs-toggle="tooltip" aria-disabled="true"><span class="fa fa-times-circle fa-fw me-1"></span>IGV mtDNA
</a>
</span>
{% elif not case.bam_files %}
{% elif not case.bam_files and not variant.is_mitochondrial %}
Copy link
Member

Choose a reason for hiding this comment

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

💯

Copy link

sonarcloud bot commented Nov 15, 2024

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 SonarQube Cloud

@dnil
Copy link
Collaborator Author

dnil commented Nov 15, 2024

Ok, let's go.

Demo case with mtDNA alignments and RNA tracks

On RD mt SNV

Screenshot 2024-11-15 at 10 44 23

On RD gDNA SNV

Screenshot 2024-11-15 at 10 47 53

On STR view

Screenshot 2024-11-15 at 10 48 46

On MEI view

Screenshot 2024-11-15 at 10 50 34

On SMA view

Screenshot 2024-11-15 at 11 03 28

On overview

Screenshot 2024-11-15 at 10 46 22

Test case with gDNA alignment

Screenshot 2024-11-15 at 11 06 01
Screenshot 2024-11-15 at 11 05 42
Screenshot 2024-11-15 at 11 05 32
Screenshot 2024-11-15 at 11 05 11
Screenshot 2024-11-15 at 11 04 52
Screenshot 2024-11-15 at 11 04 40

Somatic demo, mtDNA only

Screenshot 2024-11-15 at 11 08 39
Screenshot 2024-11-15 at 11 08 24
Screenshot 2024-11-15 at 11 08 13

@dnil dnil merged commit 7c68883 into main Nov 15, 2024
25 checks passed
@dnil dnil deleted the igv_button_name_agenda branch November 15, 2024 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IGV Viewer Scout
2 participants