Skip to content

Commit

Permalink
Comparative profiles too, from phylo trees
Browse files Browse the repository at this point in the history
  • Loading branch information
proost committed Nov 29, 2017
1 parent 82b9f84 commit 9f7aff0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
5 changes: 2 additions & 3 deletions conekt/controllers/heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,11 @@ def heatmap_comparative_tree(tree_id, option='raw'):

heatmap_data = CrossSpeciesExpressionProfile().get_heatmap(*sequence_ids, option=option)

print(heatmap_data)

return render_template("expression_heatmap.html", order=heatmap_data['order'],
profiles=heatmap_data['heatmap_data'],
zlog=1 if option == 'zlog' else 0,
raw=1 if option == 'raw' else 0)
raw=1 if option == 'raw' else 0,
tree=tree)


@heatmap.route('/inchlib/j/<cluster_id>.json')
Expand Down
2 changes: 1 addition & 1 deletion conekt/models/expression/cross_species_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def get_heatmap(self, *sequence_ids, option='raw'):
'sequence_id': d['sequence_id'],
'name': d['sequence_name'],
'shortest_alias': d['shortest_alias'],
'values': {k: v if v is not None else '-' for k,v in d['profile'][key].items()}
'values': {k: v if v is not None else '-' for k, v in d['profile'][key].items()}
})

return output
14 changes: 12 additions & 2 deletions conekt/templates/expression_heatmap.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,25 @@ <h1>Heatmap: <strong><a href="{{ url_for('expression_cluster.expression_cluster_
<span class="text-muted">(<i class="fa fa-flask" aria-hidden="true"></i> <em>Experimental feature, still under development</em>)</span></p>
</div>
</div>
{% elif tree %}
<h1>Comparative Heatmap for <a href="{{ url_for('tree.tree_view', tree_id=tree.id) }}">{{ tree.label }}</a></h1>
{% else %}
<h1>Heatmap</h1>
{% endif %}
{% if zlog == 1 %}
<p class="text-muted" >(Values are log<sub>2</sub> transformed ratios of a genes expression in a sample divided by the mean expression level)</p>
{% elif raw == 1 %}
<p class="text-muted" >(Showing raw values)</p>
{% if tree %}
<p class="text-muted" >(Showing raw values, normalize by <a href="{{ url_for('heatmap.heatmap_comparative_tree', tree_id=tree.id, option='row') }}">row</a>)</p>
{% else %}
<p class="text-muted" >(Showing raw values)</p>
{% endif%}
{% else %}
<p class="text-muted" >(Values are normalized against highest expression of the row)</p>
{% if tree %}
<p class="text-muted" >(Values are normalized against highest expression of the row, show <a href="{{ url_for('heatmap.heatmap_comparative_tree', tree_id=tree.id, option='raw') }}">raw</a> values)</p>
{% else %}
<p class="text-muted" >(Values are normalized against highest expression of the row)</p>
{% endif %}
{% endif %}
<div class="row">
<div class="col-lg-12">
Expand Down
3 changes: 2 additions & 1 deletion conekt/templates/tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ <h1><strong><em>Tree Methods</em></strong></h1>
<li><strong>{{ tree.label }}</strong></li>
</ol>
<h1>{{ tree.label }}: <strong>{{ tree.method.description }}</strong></h1>
<p>Tree for gene family <a href="{{ url_for('family.family_view', family_id=tree.family.id) }}">{{ tree.family.name }}</a></p>
<p>Tree for gene family <a href="{{ url_for('family.family_view', family_id=tree.family.id) }}">{{ tree.family.name }}</a>.
<span class="pull-right">View expression as heatmap: <a href="{{ url_for('heatmap.heatmap_comparative_tree', tree_id=tree.id, option='raw') }}">raw</a> <span class="text-muted">|</span> <a href="{{ url_for('heatmap.heatmap_comparative_tree', tree_id=tree.id, option='row') }}">row-normalized</a></span></p>
{% if tree.phyloxml %}
<div class="row">
<div class="col-lg-12">
Expand Down

0 comments on commit 9f7aff0

Please sign in to comment.