diff --git a/conekt/controllers/heatmap.py b/conekt/controllers/heatmap.py index dd19562..66d7fc7 100644 --- a/conekt/controllers/heatmap.py +++ b/conekt/controllers/heatmap.py @@ -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/.json') diff --git a/conekt/models/expression/cross_species_profile.py b/conekt/models/expression/cross_species_profile.py index bd430d6..93f5cfc 100644 --- a/conekt/models/expression/cross_species_profile.py +++ b/conekt/models/expression/cross_species_profile.py @@ -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 diff --git a/conekt/templates/expression_heatmap.html b/conekt/templates/expression_heatmap.html index 219d81d..a3c5bf0 100644 --- a/conekt/templates/expression_heatmap.html +++ b/conekt/templates/expression_heatmap.html @@ -43,15 +43,25 @@

Heatmap: ( Experimental feature, still under development)

+ {% elif tree %} +

Comparative Heatmap for {{ tree.label }}

{% else %}

Heatmap

{% endif %} {% if zlog == 1 %}

(Values are log2 transformed ratios of a genes expression in a sample divided by the mean expression level)

{% elif raw == 1 %} -

(Showing raw values)

+ {% if tree %} +

(Showing raw values, normalize by row)

+ {% else %} +

(Showing raw values)

+ {% endif%} {% else %} -

(Values are normalized against highest expression of the row)

+ {% if tree %} +

(Values are normalized against highest expression of the row, show raw values)

+ {% else %} +

(Values are normalized against highest expression of the row)

+ {% endif %} {% endif %}
diff --git a/conekt/templates/tree.html b/conekt/templates/tree.html index f9a13ad..ac8b0b8 100644 --- a/conekt/templates/tree.html +++ b/conekt/templates/tree.html @@ -50,7 +50,8 @@

Tree Methods

  • {{ tree.label }}
  • {{ tree.label }}: {{ tree.method.description }}

    -

    Tree for gene family {{ tree.family.name }}

    +

    Tree for gene family {{ tree.family.name }}. + View expression as heatmap: raw | row-normalized

    {% if tree.phyloxml %}