Skip to content

Commit

Permalink
fixed a long standing bug with the width of the cytoscape window
Browse files Browse the repository at this point in the history
  • Loading branch information
proost committed Feb 16, 2017
1 parent c28117f commit 1161ee5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
14 changes: 14 additions & 0 deletions planet/controllers/admin/controls.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,20 @@ def calculate_enrichment():
return redirect(url_for('admin.controls.index'))


@admin_controls.route('/delete_enrichment')
@login_required
def delete_enrichment():
"""
Controller to delete all existing GO enrichments
:return: Redirect to admin main screen
"""
CoexpressionCluster.delete_enrichment()

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


@admin_controls.route('/calculate_cluster_similarity/<int:gf_method_id>')
@login_required
def calculate_cluster_similarity(gf_method_id):
Expand Down
14 changes: 14 additions & 0 deletions planet/models/expression/coexpression_clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,20 @@ def calculate_enrichment(empty=True):
# print(i, "\t cluster: ", cluster.method_id, cluster.name)
cluster.__calculate_enrichment()

@staticmethod
def delete_enrichment():
"""
Removes all GO enrichment data from the database
:return:
"""
try:
db.session.query(ClusterGOEnrichment).delete()
db.session.commit()
except Exception as e:
db.session.rollback()
print(e)

@staticmethod
@benchmark
def calculate_similarities(gene_family_method_id=1, percentile_pass=0.95):
Expand Down
5 changes: 2 additions & 3 deletions planet/templates/admin/controls.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ <h3>Update</h3>
</div>

<h3>Co-expression clusters</h3>
<div class="btn-group">
<a class="btn btn-default" href="{{ url_for('admin_controls.calculate_enrichment') }}">GO enrichment</a>
</div>
<strong>Note:</strong> Calculating the GO enrichment will remove previous calculations from the database !
<a class="btn btn-default" href="{{ url_for('admin_controls.calculate_enrichment') }}">GO enrichment</a> <a class="btn btn-default" href="{{ url_for('admin_controls.delete_enrichment') }}">Delete enrichment</a>
<br />
<h4>Cluster Similarities</h4>
<div class="btn-group">
Expand Down

0 comments on commit 1161ee5

Please sign in to comment.