Skip to content

Commit

Permalink
Added low abundance warnings for specificity search
Browse files Browse the repository at this point in the history
  • Loading branch information
proost committed Sep 19, 2017
1 parent 02a3a6a commit 9edec97
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion planet/controllers/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from flask import g, Blueprint, flash, request, redirect, url_for, render_template, Response, current_app
from sqlalchemy import func
from sqlalchemy.sql import or_
from sqlalchemy.orm import joinedload

from planet import cache
from planet.forms.search_enriched_clusters import SearchEnrichedClustersForm
Expand Down Expand Up @@ -220,7 +221,13 @@ def search_specific_profiles():

species = Species.query.get_or_404(species_id)
method = ExpressionSpecificityMethod.query.get_or_404(method_id)
results = ExpressionSpecificity.query.filter(ExpressionSpecificity.method_id == method_id).filter(ExpressionSpecificity.score>=cutoff).filter(ExpressionSpecificity.condition == condition)
results = ExpressionSpecificity.query.\
filter(ExpressionSpecificity.method_id == method_id).\
filter(ExpressionSpecificity.score>=cutoff).\
filter(ExpressionSpecificity.condition == condition).\
options(
joinedload(ExpressionSpecificity.profile).undefer("profile")
)

return render_template("search_specific_profiles.html", results=results, species=species, method=method, condition=condition)

Expand Down
2 changes: 2 additions & 0 deletions planet/templates/search_specific_profiles.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ <h1><em>{{species.name}}</em> profiles specific for <strong>{{condition}}</stron
<th data-sort="float"><span class="sort-icon"></span><abbr title="Click to show help" href="{{ url_for('help.help_topic', topic='entropy') }}" data-target="#helpModal">Entropy</abbr> score</th>
<th data-sort="float"><span class="sort-icon"></span><abbr title="Click to show help" href="{{ url_for('help.help_topic', topic='tau') }}" data-target="#helpModal">Tau</abbr> score</th>
<th data-sort="float">Action</th>
<th>Info</th>
</tr>
</thead>
<tbody>
Expand All @@ -91,6 +92,7 @@ <h1><em>{{species.name}}</em> profiles specific for <strong>{{condition}}</stron
<td>{{ r.entropy|round(2) }}</td>
<td>{% if r.tau %}{{ r.tau|round(2) }}{% else %}<span class="text-muted">None</span>{% endif %}</td>
<td><a href="{{url_for('expression_profile.expression_profile_view', profile_id=r.profile_id)}}">view profile</a></td>
<td>{% if r.profile.low_abundance %}<span class="warning-message"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i></span>{% endif %}</td>
</tr>
{% endif %}
{% endfor %}
Expand Down

0 comments on commit 9edec97

Please sign in to comment.