Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Graph now searchable for gene family and interpro info from the graph…
… is used and not fetched on the fly again.
  • Loading branch information
proost committed Dec 22, 2015
1 parent 963efde commit d18d32f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions planet/controllers/search.py
Expand Up @@ -93,10 +93,10 @@ def search_json_genes(label):
for association in current_go.sequence_associations:
output.append(association.sequence_id)

current_interpro = Interpro.query.filter_by(label=label).first()
if current_interpro is not None:
for association in current_interpro.sequence_associations:
output.append(association.sequence_id)
# current_interpro = Interpro.query.filter_by(label=label).first()
# if current_interpro is not None:
# for association in current_interpro.sequence_associations:
# output.append(association.sequence_id)

return json.dumps(output)

Expand Down
6 changes: 5 additions & 1 deletion planet/static/js/planet_graph.js
Expand Up @@ -171,8 +171,12 @@ $("#cy-search").click(function(){
cy.nodes('[^compound]').each( function(i, node) {
if(node.data('gene_name').toLowerCase() === term ||
node.data('name').toLowerCase() === term ||
valid_genes.indexOf(node.data('gene_id')) > -1) {
(node.data('family_name') !== null && node.data('family_name').toLowerCase() === term) ||
(typeof node.data('interpro') !== 'undefined' && node.data('interpro').indexOf(term.toUpperCase()) > -1) ||
valid_genes.indexOf(node.data('gene_id')) > -1
) {
node.toggleClass('found');

}
});

Expand Down

0 comments on commit d18d32f

Please sign in to comment.