diff --git a/planet/controllers/expression_cluster.py b/planet/controllers/expression_cluster.py index dd8e570..63137ae 100644 --- a/planet/controllers/expression_cluster.py +++ b/planet/controllers/expression_cluster.py @@ -163,6 +163,14 @@ def avg_profile(cluster_id): return Response(json.dumps(avg_profile), mimetype='application/json') +@expression_cluster.route('/tooltip/') +@cache.cached() +def cluster_tooltip(cluster_id): + current_cluster = CoexpressionCluster.query.get(cluster_id) + + return render_template('tooltips/cluster.html', cluster=current_cluster) + + @expression_cluster.route('/ajax/interpro/') @cache.cached() def cluster_interpro_ajax(cluster_id): diff --git a/planet/controllers/expression_profile.py b/planet/controllers/expression_profile.py index 5c519e7..007a0ac 100644 --- a/planet/controllers/expression_profile.py +++ b/planet/controllers/expression_profile.py @@ -302,8 +302,7 @@ def export_expression_levels(): """ Will return a table with all (!) genes and their expression levels - :param species_id: internal ID of species to export - :return: + :return: either form with settings (on GET) or response with results (on POST) """ form = ExportConditionForm(request.form) form.populate_form() diff --git a/planet/templates/expression_heatmap.html b/planet/templates/expression_heatmap.html index 8943426..480ebf9 100644 --- a/planet/templates/expression_heatmap.html +++ b/planet/templates/expression_heatmap.html @@ -23,7 +23,9 @@
  • Results
  • {% if cluster %} -

    Heatmap: {{ cluster.name }} ({{ cluster.method.method }})

    +

    Heatmap: {{ cluster.name }} ({{ cluster.method.method }})

    {% import "macros/cluster_actions.html" as ca %}
    diff --git a/planet/templates/expression_profile_comparison.html b/planet/templates/expression_profile_comparison.html index 6c8bbb9..ce1fb77 100644 --- a/planet/templates/expression_profile_comparison.html +++ b/planet/templates/expression_profile_comparison.html @@ -17,7 +17,9 @@ {% if cluster %} -

    Profile comparison: {{ cluster.name }} ({{ cluster.method.method }})

    +

    Profile comparison: {{ cluster.name }} ({{ cluster.method.method }})

    {% import "macros/cluster_actions.html" as ca %}

    View as: {{ ca.cluster_actions(cluster.id, exclude=["profile"]) }}

    diff --git a/planet/templates/find_enriched_clusters.html b/planet/templates/find_enriched_clusters.html index 6a56bd3..f4b6162 100644 --- a/planet/templates/find_enriched_clusters.html +++ b/planet/templates/find_enriched_clusters.html @@ -43,7 +43,9 @@

    Search results

    {% if g.debug %}{{ c.cluster_id }}{% endif %} {{ c.cluster.method.network_method.species.name }} {{ c.cluster.method.method }} - {{ c.cluster.name }} + {{ c.cluster.name }} {{ c.enrichment|round(2) }} {{ (c.cluster_count*100/c.cluster_size)|round(2) }}% ({{c.cluster_count}}/{{c.cluster_size}}) {{ c.p_value|round(5) }} diff --git a/planet/templates/go.html b/planet/templates/go.html index 0e2cae9..4fcd007 100644 --- a/planet/templates/go.html +++ b/planet/templates/go.html @@ -58,7 +58,9 @@

    {{ go.label }}: {{ go.name }} ({{ go.readable_type } {% for cluster in clusters %} {% if cluster.corrected_p_value <= 0.05 %} - {{ cluster.cluster.name }} + {{ cluster.cluster.name }} {{ cluster.cluster.method.network_method.species.name }} {{ cluster.cluster_percentage|round(2) }} % {{ cluster.p_value|round(6) }} diff --git a/planet/templates/sequence.html b/planet/templates/sequence.html index f85e6f1..0ad6e38 100644 --- a/planet/templates/sequence.html +++ b/planet/templates/sequence.html @@ -136,7 +136,9 @@ {% for cluster in coexpression_clusters %} Cluster - {{ cluster.method.method }}: {{ cluster.name }} + {{ cluster.method.method }}: {{ cluster.name }} {{ ca.cluster_actions(cluster.id) }} {% endfor %} diff --git a/planet/templates/tooltips/cluster.html b/planet/templates/tooltips/cluster.html new file mode 100644 index 0000000..8fd3370 --- /dev/null +++ b/planet/templates/tooltips/cluster.html @@ -0,0 +1,11 @@ +
    +
    Species: {{ cluster.method.network_method.species.name }}
    +
    Method: {{ cluster.method.method }}
    +
    +
    Enriched GO terms (top 5):
    + {% for go_enrichment in (cluster.go_enrichment|sort(attribute='enrichment', reverse = True))[:5] %} + {{ go_enrichment.go.name }} ({{ go_enrichment.go.short_type }}){%- if not loop.last -%}, {%- endif -%} + {% else %} + No enriched GO terms available for this cluster + {% endfor %} +
    \ No newline at end of file