Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
GO enrichment improvements
  • Loading branch information
proost committed Feb 16, 2017
1 parent b8c7097 commit bce67af
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions planet/controllers/admin/controls.py
Expand Up @@ -2,7 +2,7 @@
import os
from tempfile import mkstemp

from flask import Blueprint, Response, redirect, url_for, request, flash, abort, current_app
from flask import Blueprint, Markup, redirect, url_for, request, flash, abort, current_app
from flask_login import login_required

from planet import cache
Expand Down Expand Up @@ -740,9 +740,14 @@ def calculate_enrichment():
:return: Redirect to admin main screen
"""
CoexpressionCluster.calculate_enrichment()
try:
CoexpressionCluster.calculate_enrichment()
except Exception as e:
flash(Markup('An error occurred! Please ensure the file is <strong>correctly formatted</strong>' +
' and <strong>update the counts</strong> if necessary'), 'warning')
finally:
flash('Successfully calculated GO enrichment for co-expression clusters', 'success')

flash('Successfully calculated GO enrichment for co-expression clusters', 'success')
return redirect(url_for('admin.controls.index'))


Expand Down

0 comments on commit bce67af

Please sign in to comment.