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
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f911487
Fix #4958 - IGV button names and IGV MT overview link
dnil Oct 22, 2024
43df0c1
Merge branch 'main' into igv_button_name_agenda
dnil Oct 22, 2024
cf0a0e6
name settings DNA button
dnil Oct 22, 2024
73761ed
Merge branch 'main' into igv_button_name_agenda
dnil Oct 22, 2024
a96a1ae
Merge branch 'main' into igv_button_name_agenda
dnil Oct 23, 2024
2bc4769
Merge branch 'main' into igv_button_name_agenda
dnil Oct 28, 2024
821562a
Merge branch 'main' into igv_button_name_agenda
dnil Oct 30, 2024
b89a2ac
Merge branch 'main' into igv_button_name_agenda
northwestwitch Oct 30, 2024
dc8dee0
Merge branch 'main' into igv_button_name_agenda
dnil Nov 5, 2024
633159e
Merge branch 'main' into igv_button_name_agenda
northwestwitch Nov 5, 2024
5e97d92
Merge branch 'main' into igv_button_name_agenda
dnil Nov 5, 2024
f3de161
Merge branch 'main' into igv_button_name_agenda
dnil Nov 12, 2024
6e1dfb6
Merge branch 'main' into igv_button_name_agenda
dnil Nov 12, 2024
51bbf36
Merge branch 'main' into igv_button_name_agenda
northwestwitch Nov 12, 2024
ff5f766
Merge branch 'main' into igv_button_name_agenda
dnil Nov 12, 2024
665114c
Merge branch 'main' into igv_button_name_agenda
dnil Nov 13, 2024
3d825bb
Merge branch 'main' into igv_button_name_agenda
dnil Nov 13, 2024
9f6d294
Merge branch 'main' into igv_button_name_agenda
northwestwitch Nov 13, 2024
ce70f87
disable mt aln button on sidebar
dnil Nov 13, 2024
0931e0b
fix button roles and mt_bam logic
dnil Nov 14, 2024
5bfaca5
test formatting
dnil Nov 14, 2024
ac27869
use disable also on SV page
dnil Nov 14, 2024
1b74dff
end SMA buttons with disable clause
dnil Nov 14, 2024
c1de8e9
external tooltip
dnil Nov 14, 2024
4ffcaba
more disabled, external tooltips
dnil Nov 14, 2024
0b74a9a
Fix format on STR variantS IGV button
dnil Nov 14, 2024
9873327
Merge branch 'main' into igv_button_name_agenda
dnil Nov 14, 2024
33f8d60
Split the jinja code a little, more redundancy, easier logic statements
dnil Nov 15, 2024
6164a5a
ws SMA IGV
dnil Nov 15, 2024
d457357
actionbar ws
dnil Nov 15, 2024
881d680
Again, mt vars have their own bams.
dnil Nov 15, 2024
602e5e7
SMA...
dnil Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ About changelog [here](https://keepachangelog.com/en/1.0.0/)
- On genes panel page and gene panel PDF export, it's more evident which genes were newly introduced into the panel
- WTS outlier position copy button
- Update IGV.js to v3.0.9
- Names on IGV buttons, including an overview level IGV MT button
### Fixed
- Empty custom_images dicts in case load config do not crash
- Tracks missing alignment files are now properly skipped on generating IGV views



dnil marked this conversation as resolved.
Show resolved Hide resolved
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

## [4.90.1]
### Fixed
- Parsing Matchmaker Exchange's matches dates
Expand Down
79 changes: 37 additions & 42 deletions scout/server/blueprints/cases/templates/cases/case_sma.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,61 +30,56 @@
<div class="card col-md-12">
<h4 class="mt-3">Case: {{case.display_name}}</h4>
<div class="card-body">

<div class="row">
<div class="col-xs-12 col-md-12">{{ smn_individuals_table(case, institute, tissue_types) }}</div>
</div> <!-- end of div class row -->
<div class="row">
<div class="col-md-4">
{% if case.madeline_info and case.individuals|length > 1 %}
{{ pedigree_panel() }}
{% else %}
<p>No pedigree picture available.</p>
{% endif %}
</div>
<div class="col-md-8">
{{ synopsis_panel() }}
<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

</div> <!-- end of div class row -->
<div class="row">
<div class="col-md-4">
{% if case.madeline_info and case.individuals|length > 1 %}
{{ pedigree_panel() }}
{% else %}
<p>No pedigree picture available.</p>
{% endif %}
</div>
<div class="col-md-8">
{{ synopsis_panel() }}
<div class="panel-default">
{{ comments_panel(institute, case, current_user, comments) }}
</div>
</div> <!-- end of div class row -->
</div>
</div> <!-- end of div class row -->

<span class="d-flex">
{% if case.vcf_files.vcf_snv %}
<span class="me-3">
<form action="{{url_for('variants.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>
<span><button type="submit" class="btn btn-secondary btn-sm" target="_blank" rel="noopener" data-bs-toggle="tooltip" title="SNV and INDEL variants view filtered for the genes SMN1 and SMN2">SNVs</button></span>
</form>
</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

{% if case.vcf_files.vcf_snv %}
<span class="me-3">
<form action="{{url_for('variants.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>
<span><button type="submit" class="btn btn-secondary btn-sm" target="_blank" rel="noopener" data-bs-toggle="tooltip" title="SNV and INDEL variants view filtered for the genes SMN1 and SMN2">SNVs</button></span>
</form>
</span>
{% endif %}
{% if case.vcf_files.vcf_sv %}
<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

</form>
</span>
{% endif %}
{% if case.bam_files %}
<span class="me-3"><a class="btn btn-secondary btn-sm text-white" href="{{url_for('alignviewers.igv', institute_id=case['owner'], case_name=case['display_name'], chrom=region['smn1']['chrom'], start=region['smn1']['start'], stop=region['smn1']['end'] )}}" target="_blank">IGV viewer SMN1</a></span>
<span class="me-3"><a class="btn btn-secondary btn-sm text-white" href="{{url_for('alignviewers.igv', institute_id=case['owner'], case_name=case['display_name'], chrom=region['smn2']['chrom'], start=region['smn2']['start'], stop=region['smn2']['end'] )}}" target="_blank">IGV viewer SMN2</a></span>
{% else %}
<span class="me-3 text-muted">BAM file(s) missing</span>
{% endif %}
</div>
{% endif %}

<div class="row">
<div class="col-sm-12">{{activity_panel(events)}}</div>
</div>
<span class="me-3"><a class="btn btn-secondary btn-sm text-white" {% if not case.bam_files %}title="Alignment file(s) missing" data-bs-toggle="tooltip" disabled{% endif %} href="{{url_for('alignviewers.igv', institute_id=case['owner'], case_name=case['display_name'], chrom=region['smn1']['chrom'], start=region['smn1']['start'], stop=region['smn1']['end'] )}}" target="_blank">IGV DNA SMN1</a></span>
<span class="me-3"><a class="btn btn-secondary btn-sm text-white" {% if not case.bam_files %}title="Alignment file(s) missing" data-bs-toggle="tooltip" disabled{% endif %} href="{{url_for('alignviewers.igv', institute_id=case['owner'], case_name=case['display_name'], chrom=region['smn2']['chrom'], start=region['smn2']['start'], stop=region['smn2']['end'] )}}" target="_blank">IGV DNA SMN2</a></span>
</span>

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

<div class="col-sm-12">{{activity_panel(events)}}</div>
</div>

{{ modal_synopsis() }}
</div> <!-- end of card body -->
</div> <!-- end of card div-->
</div>
</div> <!-- end of div class col -->
{% endmacro %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,22 +197,29 @@
<span class="menu-collapsed">Genome build {{ case.genome_build }}</span>
</div>
</div>
<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">
<form action="{{url_for('alignviewers.igv', institute_id=case['owner'], case_name=case['display_name']) }}" target="_blank" rel="noopener">
<button role="submit" class="btn btn-xs form-control btn-secondary">I<span class="menu-collapsed">GV viewer</span></button>
<button role="submit" class="btn btn-xs form-control btn-secondary"
{% if not case.bam_files %}
title="Alignment file(s) missing" disabled="disabled"><span class="fa fa-times-circle fa-fw me-1"></span>
{% else %}><span class="fa fa-magnifying-glass fa-fw me-1"></span>
{% endif %}
<span class="menu-collapsed">IGV </span>D<span class="menu-collapsed">NA</span>
</button>
</form>
{% else %}
<span class="fa fa-times-circle fa-fw me-3"></span><span class="text-muted menu-collapsed">Alignment missing</span>
{% endif %}
</div>
{% if has_rna_tracks %}
</div>
<div href="#" class="bg-dark list-group-item d-inline-block text-white">
<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>
<form action="{{url_for('alignviewers.igv', institute_id=case['owner'], case_name=case['display_name'], chrom='M', start=1, stop=16569) }}" target="_blank" rel="noopener">
<button role="submit" class="btn btn-xs form-control btn-secondary" {% if not case.mt_bams %}title="Alignment file(s) missing" data-bs-toggle="tooltip"><span class="fa fa-times-circle fa-fw me-1"></span>{% else %}><span class="fa fa-magnifying-glass fa-fw me-1"></span>{% endif %}<span class="menu-collapsed">IGV </span>M<span class="menu-collapsed">T</span></button>
dnil marked this conversation as resolved.
Show resolved Hide resolved
</form>
</div>
{% endif %}
{% if has_rna_tracks %}
<div href="#" class="bg-dark list-group-item d-inline-block text-white">
<form action="{{url_for('alignviewers.sashimi_igv', institute_id=case['owner'], case_name=case['display_name']) }}" target="_blank" rel="noopener">
<button role="submit" class="btn btn-xs form-control btn-secondary" data-bs-toggle="tooltip" data-bs-placement="top" title="Available in build GRCh{{ case.rna_genome_build or '38' }}"><span class="fa fa-magnifying-glass fa-fw me-1"></span><span class="menu-collapsed">IGV </span>R<span class="menu-collapsed">NA</span></button>
</form>
</div>
{% endif %}
{% endmacro %}

{% macro rank_model(case) %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
{% macro splice_junctions_button(institute_id, case, variant_id, omics_variant_id) %}
{% if omics_variant_id %}
<a class="btn btn-sm btn-secondary text-white" href="{{url_for('alignviewers.sashimi_igv', institute_id=institute_id, case_name=case.display_name, omics_variant_id=omics_variant_id)}}" target="_blank"
data-bs-toggle="tooltip" data-bs-placement="top" title="Only available in build GRCh{{ case.rna_genome_build or '38' }}">RNA splicing</a>
data-bs-toggle="tooltip" data-bs-placement="top" title="Only available in build GRCh{{ case.rna_genome_build or '38' }}"><span class="fa fa-magnifying-glass fa-fw me-1"></span>IGV RNA</a>
{% else %}
<a class="btn btn-sm btn-secondary text-white" href="{{url_for('alignviewers.sashimi_igv', institute_id=institute_id, case_name=case.display_name, variant_id=variant_id)}}" target="_blank"
data-bs-toggle="tooltip" data-bs-placement="top" title="Only available in build GRCh{{ case.rna_genome_build or '38' }}">RNA splicing</a>
data-bs-toggle="tooltip" data-bs-placement="top" title="Only available in build GRCh{{ case.rna_genome_build or '38' }}"><span class="fa fa-magnifying-glass fa-fw me-1"></span>IGV RNA</a>
{% endif %}
{% endmacro %}

Expand Down
17 changes: 12 additions & 5 deletions scout/server/blueprints/variant/templates/variant/components.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,18 @@
{% macro alignments(institute, case, variant, current_user, config, igv_tracks, has_rna_tracks=False) %}
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between">
{% if variant.chromosome in ["MT","M"] and case.mt_bams or case.bam_files %}
<span><a class="btn btn-secondary btn-sm text-white" href="{{url_for('alignviewers.igv', institute_id=institute['_id'], case_name=case['display_name'], variant_id=variant['_id'])}}" target="_blank">IGV viewer</a></span>
{% else %}
<span class="text-muted">BAM file(s) missing</span>
{% endif %}

<span>
<a href="{{url_for('alignviewers.igv', institute_id=institute['_id'], case_name=case['display_name'], variant_id=variant['_id'])}}"
target="_blank"
role="button"
class="btn btn-secondary btn-sm text-white
{% if not (variant.chromosome in ["MT","M"] and case.mt_bams) or not case.bam_files %}
disabled" title="Alignment file(s) missing" data-bs-toggle="tooltip" aria-disabled="true"><span class="fa fa-times-circle fa-fw me-1"></span>
{% else %}"><span class="fa fa-magnifying-glass fa-fw me-1"></span>{% endif %}IGV
{% if variant.chromosome in ["MT","M"] %}MT{% else %}DNA{% endif %}
</a>
</span>
{% if variant.category == "str" %}
<div class="ms-1">
{{ reviewer_button(case,variant,case_groups,institute._id) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% from "utils.html" import comments_table, pedigree_panel %}
{% from "variants/components.html" import frequency_cell_general %}
{% from "variants/utils.html" import cell_rank, dismiss_variants_block, filter_form_footer, update_stash_filter_button_status, pagination_footer, pagination_hidden_div, str_filters %}
{% from "variant/buttons.html" import igv_button, reviewer_button%}
{% from "variant/buttons.html" import reviewer_button%}

{% block title %}
{{ super() }} - {{ institute.display_name }} - {{ case.display_name }} - STR variants
Expand Down
6 changes: 3 additions & 3 deletions scout/server/blueprints/variant/templates/variant/utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ <h6>Phenotype terms (HPO):</h6>
<div id="accordion">
<div class="row">
<div class="col-4 d-flex align-items-center">
<span><a data-bs-toggle="collapse" data-bs-parent="#accordion" href="#track_settings" class="text-secondary">Settings DNA <i class="fas fa-cogs text-secondary"></i></a></span>
<span><a data-bs-toggle="collapse" data-bs-parent="#accordion" href="#track_settings" class="text-secondary"><span class="fas fa-cogs text-secondary me-1"></span>Settings IGV DNA</a></span>
</div>
<div id="track_settings" class="col-8 collapse">
<form action="{{url_for('variant.update_tracks_settings')}}" method="POST">
Expand Down Expand Up @@ -347,8 +347,8 @@ <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"

<span><a class="btn btn-secondary btn-sm text-white" href="{{url_for('alignviewers.igv', institute_id=case['owner'], case_name=case['display_name'], variant_id=variant['_id'], chrom=chrom, start=align_start, stop=align_end) }}" target="_blank">IGV viewer</a></span>
{% if variant.is_mitochondrial and case.mt_bams %}
<span><a class="btn btn-secondary btn-sm text-white" href="{{url_for('alignviewers.igv', institute_id=case['owner'], case_name=case['display_name'], variant_id=variant['_id'], chrom=chrom, start=align_start, stop=align_end) }}" target="_blank"><span class="fa fa-magnifying-glass fa-fw me-1"></span>IGV MT</a></span>
{% else %}
- BAM file(s) missing
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@
{{ variant.position|human_longint|safe }}</span>
{{ reviewer_button(case,variant,case_groups,institute._id) }}
{% if case.bam_files %}
<a class="btn btn-secondary btn-sm text-white" href="{{url_for('alignviewers.igv', institute_id=institute['_id'], case_name=case['display_name'], variant_id=variant['_id'])}}" rel="noopener" target="_blank">IGV viewer</a>
<a class="btn btn-secondary btn-sm text-white" href="{{url_for('alignviewers.igv', institute_id=institute['_id'], case_name=case['display_name'], variant_id=variant['_id'])}}" rel="noopener" target="_blank"><span class="fa fa-magnifying-glass fa-fw me-1">IGV DNA</a>
{% else %}
<button title="BAM file(s) missing" class="btn btn-secondary btn-sm" disabled>IGV viewer</button>
<button title="BAM file(s) missing" class="btn btn-secondary btn-sm" disabled></span><span class="fa fa-times-circle fa-fw me-1"></span>IGV DNA</button>
{% endif %}

</td>
Expand Down
Loading