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 28 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 @@ -21,6 +21,7 @@ About changelog [here](https://keepachangelog.com/en/1.0.0/)
- Display institute _id + display name on dashboard filters
- ClinVar category 8 has changed to "Conflicting classifications of pathogenicity" instead of "interpretations"
- Increased visibility of variant callers's "Pass" or "Filtered" on the following pages: SNV variants (cancer cases), SV variants (both RD and cancer cases)
- 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 skipped on generating IGV views
Expand All @@ -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


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" {% if not case.bam_files %}title="Alignment file(s) missing" data-bs-toggle="tooltip"{% endif %}><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"{% if not case.bam_files %} disabled{% endif %}>IGV DNA SMN1</a></span>
<span class="me-3" {% if not case.bam_files %}title="Alignment file(s) missing" data-bs-toggle="tooltip"{% endif %}><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"{% if not case.bam_files %} disabled{% endif %}>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" {% if not case.bam_files %} data-bs-toggle="tooltip" title="Alignment file(s) missing" {% endif %}>
<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 type="submit" class="btn btn-xs form-control btn-secondary"
{% if not case.bam_files %}
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 g</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 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>
</div>
<div href="#" class="bg-dark list-group-item d-inline-block text-white" {% if not case.mt_bams %} data-bs-toggle="tooltip" title="Alignment file(s) missing" {% endif %}>
<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 type="submit" class="btn btn-xs form-control btn-secondary"{% if not case.mt_bams %} 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>m<span class="menu-collapsed">tDNA</span></button>
</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 type="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
108 changes: 64 additions & 44 deletions scout/server/blueprints/variant/templates/variant/components.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,51 +66,71 @@
{% endmacro %}

{% 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 %}
{% if variant.category == "str" %}
<div class="ms-1">
{{ reviewer_button(case,variant,case_groups,institute._id) }}
</div>
{% endif %}
{% if has_rna_tracks %}
<div class="ms-1">
{{ splice_junctions_button(institute._id, case, variant._id) }}
</div>
{% endif %}
{% if variant.alamut_link %}
<div class="ms-1">
<a href="{{ variant.alamut_link }}" class="btn btn-sm btn-secondary" role="button" target="_blank" data-bs-toggle="tooltip" title="Alamut Visual (Plus) - Open variant - with genome g. coordinate">Alamut g.</a>
</div>
{% endif %}
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between">
{% if variant.is_mitochondrial and not case.mt_bams %}
<span data-bs-toggle="tooltip" title="Alignment file(s) missing">
<a href="{{url_for('alignviewers.igv', institute_id=institute['_id'], case_name=case['display_name'], variant_id=variant['_id'])}}"
target="_blank"
class="btn btn-secondary btn-sm text-white
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 %}
<span data-bs-toggle="tooltip" title="Alignment file(s) missing">
<a href="{{url_for('alignviewers.igv', institute_id=institute['_id'], case_name=case['display_name'], variant_id=variant['_id'])}}"
target="_blank"
class="btn btn-secondary btn-sm text-white
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 DNA
</a>
</span>
{% else %}
<span>
<a href="{{url_for('alignviewers.igv', institute_id=institute['_id'], case_name=case['display_name'], variant_id=variant['_id'])}}"
target="_blank"
class="btn btn-secondary btn-sm text-white"><span class="fa fa-magnifying-glass fa-fw me-1"></span>
IGV {% if variant.is_mitochondrial %}mt{% else %}g{% endif %}DNA
</a>
</span>
{% endif %}
{% if variant.category == "str" %}
<div class="ms-1">
{{ reviewer_button(case,variant,case_groups,institute._id) }}
</div>
{% endif %}
{% if has_rna_tracks %}
<div class="ms-1">
{{ splice_junctions_button(institute._id, case, variant._id) }}
</div>
{% endif %}
{% if variant.alamut_link %}
<div class="ms-1">
<a href="{{ variant.alamut_link }}" class="btn btn-sm btn-secondary" target="_blank" data-bs-toggle="tooltip" title="Alamut Visual (Plus) - Open variant - with genome g. coordinate">Alamut g.</a>
</div>
{% endif %}
{% for gene in variant.genes %}
<div class="d-flex flex-wrap ms-1">
{% if gene.alamut_link %}
<a href="{{ gene.alamut_link }}" class="btn btn-sm btn-secondary text-white" rel="noopener" referrerpolicy="no-referrer" target="_blank" data-bs-toggle="tooltip" title="Alamut Visual (Plus) - Open variant - with gene transcript c. coordinate">Alamut {{ gene.common.hgnc_symbol if gene.common else gene.hgnc_id }} c.</a>
{% endif %}
</div>
{% endfor %}
{% if config.chanjo_report %}
<div class="d-flex flex-wrap ms-1">
{% for gene in variant.genes %}
<div class="d-flex flex-wrap ms-1">
{% if gene.alamut_link %}
<a href="{{ gene.alamut_link }}" class="btn btn-sm btn-secondary text-white" rel="noopener" referrerpolicy="no-referrer" target="_blank" data-bs-toggle="tooltip" title="Alamut Visual (Plus) - Open variant - with gene transcript c. coordinate">Alamut {{ gene.common.hgnc_symbol if gene.common else gene.hgnc_id }} c.</a>
{% endif %}
</div>
<a class="btn btn-sm btn-secondary text-white" rel="noopener noreferrer" target="_blank" href="{{ url_for('report.gene', gene_id=gene.hgnc_id, sample_id=variant.samples|map(attribute='sample_id')|list) }}">
Gene coverage: {{ gene.common.hgnc_symbol if gene.common else gene.hgnc_id }}
</a>
{% endfor %}
{% if config.chanjo_report %}
<div class="d-flex flex-wrap ms-1">
{% for gene in variant.genes %}
<a class="btn btn-sm btn-secondary text-white" rel="noopener noreferrer" target="_blank" href="{{ url_for('report.gene', gene_id=gene.hgnc_id, sample_id=variant.samples|map(attribute='sample_id')|list) }}">
Gene coverage: {{ gene.common.hgnc_symbol if gene.common else gene.hgnc_id }}
</a>
{% endfor %}
</div>
{% endif %}
</li>
<li class="list-group-item">
<div>
{{ igv_track_selection(igv_tracks, current_user) }}
</div>
</li>
</ul>
</div>
{% endif %}
</li>
<li class="list-group-item">
<div>
{{ igv_track_selection(igv_tracks, current_user) }}
</div>
</li>
</ul>
{% endmacro %}

{% macro acmg_form(institute, case, variant, ACMG_OPTIONS, selected=None) %}
Expand Down Expand Up @@ -224,7 +244,7 @@
<div class="card-body mt-1 ms-3 mb-1" style="padding: 0;">
Matching tiered:&nbsp;
{% for tier, tiered_info in matching_tiered.items() %}
<a style="padding: 0;" class="btn btn-{{tiered_info.label}} btn-xs" data-bs-toggle="collapse" href="#collapse_{{tier}}" role="button" aria-expanded="false" aria-controls="collapseExample">
<a style="padding: 0;" class="btn btn-{{tiered_info.label}} btn-xs" data-bs-toggle="collapse" href="#collapse_{{tier}}" aria-expanded="false" aria-controls="collapseExample">
{{tier}} ({{tiered_info.links|length}}x)
</a>
<div class="collapse" id="collapse_{{tier}}">
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
Loading
Loading