-
Notifications
You must be signed in to change notification settings - Fork 0
MANE transcripts report #365
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5858da8
Something works apparently
5d64649
Small fixes
3bed5f4
Work in progress
9db297d
Simplify
1936018
Fix the non-demo page
da23b6f
Include also panel name in mane report
931de1b
Sort genes by symbol
4155309
Remove unused code
56afd0b
Add tests
636a2b2
Updated changelog
41985e2
Add missing docstrings
4faaa73
Final touch
d99a94a
Add loop also for each sample
99ddb6f
Fix missing MANE badges
83b1b14
Sort again by gene name
2569d5d
Round coverage to 2 decimals
106844c
Update src/chanjo2/templates/mane-overview.html
northwestwitch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
{% extends "base-layout.html" %} | ||
|
||
{% block css %} | ||
{{ super() }} | ||
<style> | ||
.badge { | ||
background-color: black; | ||
color: white; | ||
padding: 4px 8px; | ||
text-align: center; | ||
border-radius: 5px; | ||
float: right; | ||
} | ||
</style> | ||
{% endblock %} | ||
|
||
{% macro report_filters() %} | ||
<div class="accordion" id="filter-accordion"> | ||
<div class="accordion-item"> | ||
<h2 class="accordion-header" id="flush-headingOne"> | ||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseOne" aria-expanded="false" aria-controls="flush-collapseOne"> | ||
Customize | ||
</button> | ||
</h2> | ||
<div id="flush-collapseOne" class="accordion-collapse collapse" aria-labelledby="flush-headingOne" data-bs-parent="#accordionFlushExample"> | ||
<div class="accordion-body"> | ||
<!-- hidden fields passed from previous query --> | ||
<form name="customizeForm" action="{{url_for('mane_overview')}}" method="post"> | ||
<input type="hidden" name="build" value="GRCh38"/> | ||
<input type="hidden" name="interval_type" value="transcripts"/> | ||
<input type="hidden" name="samples" value="{{extras.samples|safe}}"/> | ||
|
||
<div class="row"> | ||
<div class="col-6"> | ||
<label class="form-label">Included genes (Comma separated list HGNC IDs, HGNC symbols or Ensembl IDs) | ||
<input class="form-control" type="text" name="hgnc_gene_ids" value="{{ extras.hgnc_gene_ids|join(', ') }}" placeholder="17284, 21022,.."> | ||
</label> | ||
</div> | ||
<div class="col-4"> | ||
<label class="form-label">Gene panel name to display | ||
<input class="form-control" id="panel_name" name="panel_name" type="text" placeholder="Skeletal dysplasia 3.2" value="{{ extras.panel_name or '' }}"> | ||
</label> | ||
</div> | ||
<div class="col-2"> | ||
<button class="btn btn-primary mt-4" type="submit">Update</button> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endmacro %} | ||
|
||
|
||
{% macro mane_stats_macro() %} | ||
<h2>MANE Transcripts coverage report</h2> | ||
{% if extras.panel_name %} | ||
<p>Based on gene panel: <strong>{{ extras.panel_name }}</strong></p> | ||
{% endif %} | ||
<br> | ||
{% for gene_id, samples_stats in mane_coverage_stats|sort(attribute='0') %} | ||
<tr> | ||
<td class="row"> | ||
<div class="panel-default"> | ||
<div class="panel-heading"> | ||
<strong>Gene {{ gene_id or samples_stats.gene.hgnc_id }}</strong> | ||
{% if samples_stats.transcript.mane_select %} | ||
<span class="badge">MANE Select: {{samples_stats.transcript.mane_select}}</span> | ||
{% endif %} | ||
{% if samples_stats.transcript.mane_plus_clinical %} | ||
<span class="badge">MANE Plus Clinical: {{samples_stats.transcript.mane_plus_clinical}}</span> | ||
{% endif %} | ||
|
||
</div> | ||
</div> | ||
<div class="table-responsive"> | ||
<table class="table table-bordered"> | ||
<thead> | ||
<th>Sample</th> | ||
<th>Mean coverage</th> | ||
{% for level, _ in levels.items() %} | ||
<th>Completeness {{ level }}x [%]</th> | ||
{% endfor %} | ||
</thead> | ||
<tbody> | ||
{% for data_tuple in samples_stats.stats %} | ||
<tr> | ||
<td>{{data_tuple[0]}}</td> | ||
<td>{{data_tuple[1]|round(2) }}</td> | ||
{% for level, _ in levels.items() %} | ||
<td>{{ (data_tuple[2][level] * 100)|round(2) }}</td> | ||
{% endfor %} | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
</td> | ||
</tr> | ||
<br> | ||
{% else %} | ||
No MANE transcripts found in database for the provided gene list. | ||
{% endfor %} | ||
{% endmacro %} | ||
|
||
{% block title %} | ||
<title>Chanjo2 MANE transcripts coverage overview</title> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
{{report_filters() }} | ||
{{ mane_stats_macro() }} | ||
{% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code identations seems off here and below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK on the editor though, weird!
I think I'll leave it as it is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be mixed tabs and spaces? (Anyway, not a big issue)