Skip to content

Commit

Permalink
summaries partials and html updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Snicker7 committed Sep 13, 2022
1 parent 858a751 commit 546397a
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 93 deletions.
11 changes: 7 additions & 4 deletions CRISPRessoReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,13 @@ def fill_default(dictionary, key, default_type=list):
window_nuc_conv_plots=window_nuc_conv_plots,
nuc_conv_plots=nuc_conv_plots,
crispresso_data_path=crispresso_data_path,
summary_plot_names=summary_plots['names'],
summary_plot_titles=summary_plots['titles'],
summary_plot_labels=summary_plots['labels'],
summary_plot_datas=summary_plots['datas'],
report_data={
'names': summary_plots['names'],
'titles': summary_plots['titles'],
'labels': summary_plots['labels'],
'datas': summary_plots['datas'],
'crispresso_data_path': crispresso_data_path,
},
run_names=run_names,
sub_html_files=sub_html_files,
report_name=report_name,
Expand Down
46 changes: 13 additions & 33 deletions templates/batchReport.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,8 @@ <h5>Nucleotide percentages around guides</h5>
</div>
<div class='card-body'>
{% for plot_name in window_nuc_pct_quilts %}
<h5>{{summary_plot_titles[plot_name]}}</h5>
<a href="{{crispresso_data_path}}{{plot_name}}.pdf"><img src="{{crispresso_data_path}}{{plot_name}}.png" width='80%' ></a>
<label class="labelpadding">{{summary_plot_labels[plot_name]}}</label>
{% for (data_label,data_path) in summary_plot_datas[plot_name] %}
<p class="m-0"><small>Data: <a href="{{crispresso_data_path}}{{data_path}}">{{data_label}}</a> <a href="{{crispresso_data_path}}{{data_path}}" title="{{data_label}}" download> <span class="fas fa-download" data-toggle='tooltip' title='Download {{data_label}}'><span></a></small></p>
{% endfor %}
<h5>{{report_data['titles'][plot_name]}}</h5>
{{ render_partials('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }}
{% endfor %}
</div>
</div>
Expand All @@ -91,12 +87,8 @@ <h5>Nucleotide percentages in the entire amplicon</h5>
</div>
<div class='card-body'>
{% for plot_name in nuc_pct_quilts %}
<h5>{{summary_plot_titles[plot_name]}}</h5>
<a href="{{crispresso_data_path}}{{plot_name}}.pdf"><img src="{{crispresso_data_path}}{{plot_name}}.png" width='80%' ></a>
<label class="labelpadding">{{summary_plot_labels[plot_name]}}</label>
{% for (data_label,data_path) in summary_plot_datas[plot_name] %}
<p class="m-0"><small>Data: <a href="{{crispresso_data_path}}{{data_path}}">{{data_label}}</a> <a href="{{crispresso_data_path}}{{data_path}}" title="{{data_label}}" download> <span class="fas fa-download" data-toggle='tooltip' title='Download {{data_label}}'><span></a></small></p>
{% endfor %}
<h5>{{report_data['titles'][plot_name]}}</h5>
{{ render_partials('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }}
{% endfor %}
</div>
</div>
Expand All @@ -109,12 +101,8 @@ <h5>Conversion of target bases around guides</h5>
</div>
<div class='card-body'>
{% for plot_name in window_nuc_conv_plots %}
<h5>{{summary_plot_titles[plot_name]}}</h5>
<a href="{{crispresso_data_path}}{{plot_name}}.pdf"><img src="{{crispresso_data_path}}{{plot_name}}.png" width='80%' ></a>
<label class="labelpadding">{{summary_plot_labels[plot_name]}}</label>
{% for (data_label,data_path) in summary_plot_datas[plot_name] %}
<p class="m-0"><small>Data: <a href="{{crispresso_data_path}}{{data_path}}">{{data_label}}</a> <a href="{{crispresso_data_path}}{{data_path}}" title="{{data_label}}" download> <span class="fas fa-download" data-toggle='tooltip' title='Download {{data_label}}'><span></a></small></p>
{% endfor %}
<h5>{{report_data['titles'][plot_name]}}</h5>
{{ render_partials('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }}
{% endfor %}
</div>
</div>
Expand All @@ -127,29 +115,21 @@ <h5>Conversion of target bases in the entire amplicon</h5>
</div>
<div class='card-body'>
{% for plot_name in nuc_conv_plots %}
<h5>{{summary_plot_titles[plot_name]}}</h5>
<a href="{{crispresso_data_path}}{{plot_name}}.pdf"><img src="{{crispresso_data_path}}{{plot_name}}.png" width='80%' ></a>
<label class="labelpadding">{{summary_plot_labels[plot_name]}}</label>
{% for (data_label,data_path) in summary_plot_datas[plot_name] %}
<p class="m-0"><small>Data: <a href="{{crispresso_data_path}}{{data_path}}">{{data_label}}</a> <a href="{{crispresso_data_path}}{{data_path}}" title="{{data_label}}" download> <span class="fas fa-download" data-toggle='tooltip' title='Download {{data_label}}'><span></a></small></p>
{% endfor %}
<h5>{{report_data['titles'][plot_name]}}</h5>
{{ render_partials('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }}
{% endfor %}
</div>
</div>
{% endif %}

{% if summary_plot_names|length > 0 %}
{% for plot_name in summary_plot_names %}
{% if report_data['names']|length > 0 %}
{% for plot_name in report_data['names'] %}
<div class='card text-center mb-2'>
<div class='card-header'>
<h5>{{summary_plot_titles[plot_name]}}</h5>
<h5>{{report_data['titles'][plot_name]}}</h5>
</div>
<div class='card-body'>
<a href="{{crispresso_data_path}}{{plot_name}}.pdf"><img src="{{crispresso_data_path}}{{plot_name}}.png" width='80%' ></a>
<label class="labelpadding">{{summary_plot_labels[plot_name]}}</label>
{% for (data_label,data_path) in summary_plot_datas[plot_name] %}
<p class="m-0"><small>Data: <a href="{{crispresso_data_path}}{{data_path}}">{{data_label}}</a> <a href="{{crispresso_data_path}}{{data_path}}" title="{{data_label}}" download> <span class="fas fa-download" data-toggle='tooltip' title='Download {{data_label}}'><span></a></small></p>
{% endfor %}
{{ render_partials('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }}
</div>
</div>
{% endfor %}
Expand All @@ -168,7 +148,7 @@ <h5>{{summary_plot_titles[plot_name]}}</h5>

{# data bit for web version: #}
{#
<p class="m-0"><small>Data: <a href="{{crispresso_data_path}}{{data_path}}">{{data_label}}</a> <a href="{{crispresso_data_path}}{{data_path}}" title="{{data_label}}" download> <span class="fas fa-download" data-toggle='tooltip' title='Download {{data_label}}'><span></a></small></p>
<p class="m-0"><small>Data: <a href="{{report_data['crispresso_data_path']}}{{data_path}}">{{data_label}}</a> <a href="{{report_data['crispresso_data_path']}}{{data_path}}" title="{{data_label}}" download> <span class="fas fa-download" data-toggle='tooltip' title='Download {{data_label}}'><span></a></small></p>
#}
</div> {# jumbotron_content #} <!-- end jumbotron_content -->
</div> {# jumbrotron #} <!-- end jumbotron -->
Expand Down
52 changes: 16 additions & 36 deletions templates/multiReport.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h5>{{report_name}}</h5>
<div class='card-body p-0'>
<div class="list-group list-group-flush" style='max-height:80vh;overflow-y:auto'>
{% for run_name in run_names %}
<a href="{{crispresso_data_path}}{{sub_html_files[run_name]}}" class="list-group-item list-group-item-action">{{run_name}}</a>
<a href="{{report_data['crispresso_data_path']}}{{sub_html_files[run_name]}}" class="list-group-item list-group-item-action">{{run_name}}</a>
{% endfor %}
</div>
</div>
Expand All @@ -72,12 +72,8 @@ <h5>Nucleotide percentages around guides</h5>
</div>
<div class='card-body'>
{% for plot_name in window_nuc_pct_quilts %}
<h5>{{summary_plot_titles[plot_name]}}</h5>
<a href="{{crispresso_data_path}}{{plot_name}}.pdf"><img src="{{crispresso_data_path}}{{plot_name}}.png" width='80%' ></a>
<label class="labelpadding">{{summary_plot_labels[plot_name]}}</label>
{% for (data_label,data_path) in summary_plot_datas[plot_name] %}
<p class="m-0"><small>Data: <a href="{{crispresso_data_path}}{{data_path}}">{{data_label}}</a></small></p>
{% endfor %}
<h5>{{report_data['titles'][plot_name]}}</h5>
{{ render_partials('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }}
{% endfor %}
</div>
</div>
Expand All @@ -90,12 +86,8 @@ <h5>Nucleotide percentages in the entire amplicon</h5>
</div>
<div class='card-body'>
{% for plot_name in nuc_pct_quilts %}
<h5>{{summary_plot_titles[plot_name]}}</h5>
<a href="{{crispresso_data_path}}{{plot_name}}.pdf"><img src="{{crispresso_data_path}}{{plot_name}}.png" width='80%' ></a>
<label class="labelpadding">{{summary_plot_labels[plot_name]}}</label>
{% for (data_label,data_path) in summary_plot_datas[plot_name] %}
<p class="m-0"><small>Data: <a href="{{crispresso_data_path}}{{data_path}}">{{data_label}}</a></small></p>
{% endfor %}
<h5>{{report_data['titles'][plot_name]}}</h5>
{{ render_partials('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }}
{% endfor %}
</div>
</div>
Expand All @@ -108,12 +100,8 @@ <h5>Conversion of target bases around guides</h5>
</div>
<div class='card-body'>
{% for plot_name in window_nuc_conv_plots %}
<h5>{{summary_plot_titles[plot_name]}}</h5>
<a href="{{crispresso_data_path}}{{plot_name}}.pdf"><img src="{{crispresso_data_path}}{{plot_name}}.png" width='80%' ></a>
<label class="labelpadding">{{summary_plot_labels[plot_name]}}</label>
{% for (data_label,data_path) in summary_plot_datas[plot_name] %}
<p class="m-0"><small>Data: <a href="{{crispresso_data_path}}{{data_path}}">{{data_label}}</a></small></p>
{% endfor %}
<h5>{{report_data['titles'][plot_name]}}</h5>
{{ render_partials('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }}
{% endfor %}
</div>
</div>
Expand All @@ -126,29 +114,21 @@ <h5>Conversion of target bases in the entire amplicon</h5>
</div>
<div class='card-body'>
{% for plot_name in nuc_conv_plots %}
<h5>{{summary_plot_titles[plot_name]}}</h5>
<a href="{{crispresso_data_path}}{{plot_name}}.pdf"><img src="{{crispresso_data_path}}{{plot_name}}.png" width='80%' ></a>
<label class="labelpadding">{{summary_plot_labels[plot_name]}}</label>
{% for (data_label,data_path) in summary_plot_datas[plot_name] %}
<p class="m-0"><small>Data: <a href="{{crispresso_data_path}}{{data_path}}">{{data_label}}</a></small></p>
{% endfor %}
<h5>{{report_data['titles'][plot_name]}}</h5>
{{ render_partials('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }}
{% endfor %}
</div>
</div>
{% endif %}

{% if summary_plot_names|length > 0 %}
{% for plot_name in summary_plot_names %}
{% if report_data['names']|length > 0 %}
{% for plot_name in report_data['names'] %}
<div class='card text-center mb-2'>
<div class='card-header'>
<h5>{{summary_plot_titles[plot_name]}}</h5>
<h5>{{report_data['titles'][plot_name]}}</h5>
</div>
<div class='card-body' style='max-height:80vh;overflow-y:auto'>
<a href="{{crispresso_data_path}}{{plot_name}}.pdf"><img src="{{crispresso_data_path}}{{plot_name}}.png" width='80%' ></a>
<label class="labelpadding">{{summary_plot_labels[plot_name]}}</label>
{% for (data_label,data_path) in summary_plot_datas[plot_name] %}
<p class="m-0"><small>Data: <a href="{{crispresso_data_path}}{{data_path}}">{{data_label}}</a></small></p>
{% endfor %}
{{ render_partials('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }}
</div>
</div>
{% endfor %}
Expand Down Expand Up @@ -176,14 +156,14 @@ <h5>{{allele_modification_heatmap_plot_titles[heatmap_plot_name]}}</h5>
{{allele_modification_heatmap_plot_htmls[heatmap_plot_name]}}
<label class="labelpadding">{{allele_modification_heatmap_plot_labels[heatmap_plot_name]}}</label>
{% for (data_label, data_path) in allele_modification_heatmap_plot_datas[heatmap_plot_name] %}
<p class="m-0"><small>Data: <a href="{{crispresso_data_path}}{{data_path}}">{{data_label}}</a></small></p>
<p class="m-0"><small>Data: <a href="{{report_data['crispresso_data_path']}}{{data_path}}">{{data_label}}</a></small></p>
{% endfor %}
</div>
<div class="tab-pane fade" id="{{line_plot_name}}" role="tabpanel" aria-labelledby="{{modification_type}}-line-tab">
{{allele_modification_line_plot_htmls[line_plot_name]}}
<label class="labelpadding">{{allele_modification_line_plot_labels[line_plot_name]}}</label>
{% for (data_label, data_path) in allele_modification_line_plot_datas[line_plot_name] %}
<p class="m-0"><small>Data: <a href="{{crispresso_data_path}}{{data_path}}">{{data_label}}</a></small></p>
<p class="m-0"><small>Data: <a href="{{report_data['crispresso_data_path']}}{{data_path}}">{{data_label}}</a></small></p>
{% endfor %}
</div>
</div>
Expand Down Expand Up @@ -261,7 +241,7 @@ <h5>Summary Plots</h5>
<div class='card-body p-0'>
<div class="list-group list-group-flush" style='max-height:80vh;overflow-y:auto'>
{% for compact_plot in compact_plots_to_show %}
<a href="{{crispresso_data_path}}{{compact_plots_to_show[compact_plot]['href']}}" data-toggle="tooltip" title="{{compact_plot}}" class="list-group-item list-group-item-action p-0"><img src="{{crispresso_data_path}}{{compact_plots_to_show[compact_plot]['img']}}" width='100%' ></a>
<a href="{{report_data['crispresso_data_path']}}{{compact_plots_to_show[compact_plot]['href']}}" data-toggle="tooltip" title="{{compact_plot}}" class="list-group-item list-group-item-action p-0"><img src="{{report_data['crispresso_data_path']}}{{compact_plots_to_show[compact_plot]['img']}}" width='100%' ></a>
{% endfor %}
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions templates/pooledReport.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ <h5>{{report_name}}</h5>
</div>
{% endif %}

{% if summary_plot_names|length > 0 %}
{% for plot_name in summary_plot_names %}
{% if report_data['names']|length > 0 %}
{% for plot_name in report_data['names'] %}
<div class='card text-center mb-2'>
<div class='card-header'>
<h5 id="modification_summary_title">{{summary_plot_titles[plot_name]}}</h5>
<h5>{{report_data['titles'][plot_name]}}</h5>
</div>
<div class='card-body' style='max-height:80vh;overflow-y:auto'>
{{ render_partials('shared/partials/fig_summaries.html', plot_name=plot_name, summary_plot_htmls=summary_plot_htmls, crispresso_data_path=crispresso_data_path, summary_plot_labels=summary_plot_labels, summary_plot_datas=summary_plot_datas) }}
{{ render_partials('shared/partials/fig_summaries.html', report_data=report_data, plot_name=plot_name) }}
</div>
</div>
{% endfor %}
Expand All @@ -86,7 +86,7 @@ <h5 id="modification_summary_title">{{summary_plot_titles[plot_name]}}</h5>
</div>
{# data bit for web version: #}
{#
<p class="m-0"><small>Data: <a href="{{crispresso_data_path}}{{data_path}}">{{data_label}}</a> <a href="{{crispresso_data_path}}{{data_path}}" title="{{data_label}}" download> <span class="fas fa-download" data-toggle='tooltip' title='Download {{data_label}}'><span></a></small></p>
<p class="m-0"><small>Data: <a href="{{report_data['crispresso_data_path']}}{{data_path}}">{{data_label}}</a> <a href="{{report_data['crispresso_data_path']}}{{data_path}}" title="{{data_label}}" download> <span class="fas fa-download" data-toggle='tooltip' title='Download {{data_label}}'><span></a></small></p>
#}
</div> {# jumbotron_content #} <!-- end jumbotron_content -->
</div> {# jumbrotron #} <!-- end jumbotron -->
Expand Down
12 changes: 6 additions & 6 deletions templates/shared/partials/fig_summaries.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div id="fig_summary_{{plot_name}}">
{% if summary_plot_htmls[plot_name] %}
{{summary_plot_htmls[plot_name]|safe}}
{% if report_data['htmls'][plot_name] %}
{{report_data['htmls'][plot_name]|safe}}
{% else %}
<a href="{{crispresso_data_path}}{{plot_name}}.pdf"><img src="{{crispresso_data_path}}{{plot_name}}.png" width='100%' height='100%'></a>
<a href="{{report_data['crispresso_data_path']}}{{plot_name}}.pdf"><img src="{{report_data['crispresso_data_path']}}{{plot_name}}.png" width='100%' height='100%'></a>
{% endif %}
<label class="labelpadding">{{summary_plot_labels[plot_name]}}</label>
{% for (data_label,data_path) in summary_plot_datas[plot_name] %}
<p class="m-0"><small>Data: <a href="{{crispresso_data_path}}{{data_path}}">{{data_label}}</a></small></p>
<label class="labelpadding">{{report_data['labels'][plot_name]}}</label>
{% for (data_label,data_path) in report_data['datas'][plot_name] %}
<p class="m-0"><small>Data: <a href="{{report_data['crispresso_data_path']}}{{data_path}}">{{data_label}}</a></small></p>
{% endfor %}
</div>
Loading

0 comments on commit 546397a

Please sign in to comment.