Skip to content

Commit

Permalink
Forward now search for transcripts or genes, as preparaiton for #34. …
Browse files Browse the repository at this point in the history
…The timeout for the blast is increased, as a temporary patch for #28
  • Loading branch information
homonecloco committed Jul 12, 2018
1 parent 2ccd501 commit 871bb6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 3 additions & 5 deletions app/assets/javascripts/application.js
Expand Up @@ -234,12 +234,10 @@ ready = (function() {

// Adding a new column to the results table (with a time delay to let the content to be generated first and then changed)
$(document).ready(function($) {
console.log("Searching for results")
setTimeout(function(){
console.log("inside timeout")
// Adding the header of the column
$('#sequenceserver').contents().find('thead').eq(0).find('th').eq(1).after('<th class="text-left">Expression search</th>')

$('#sequenceserver').contents().find('thead').eq(0).find('th').eq(1).after('<th class="text-left">Expression</th><th class="text-left"></th>')
// Adding the data of the column
// ***Constructing the link(adding the gene set)
var geneSet = '';
Expand All @@ -257,9 +255,9 @@ ready = (function() {
var geneName = $(this).find('td').eq(1).children().text();
var link = "genes/forward?submit=Search&gene=" + geneName + "&gene_set=" + geneSet + "&search_by=";
var secondColResTable = $(this).find('td').eq(1);
secondColResTable.after("<td> <a href='" + link + "transcript' target=\"_top\">Expression</a> </td>");
secondColResTable.after("<td> <a href='" + link + "gene' target=\"_top\">gene</a></td><td> <a href='" + link + "transcript' target=\"_top\">transcript</a> </td>");
});
}, 3000);
}, 20000); //RHRG: This timout is a bit arbitrary. As it is now, it doesn't show the table first. We need to find a betteer trigger.
});

});
Expand Down
1 change: 1 addition & 0 deletions app/controllers/genes_controller.rb
Expand Up @@ -47,6 +47,7 @@ def forwardCommon
@gene_set = GeneSet.find_by(:name => params[:gene_set]) if params[:gene_set]
session[:heatmap] = false
@gene, @search_by = GenesHelper.findGeneName gene_name, @gene_set
@search_by = params[:search_by] if ["gene", "transcript"].include? params[:search_by]
session[:name] = @search_by == "gene" ? @gene.gene : @gene.name
session[:search_by] = @search_by
session[:gene_set_id] = @gene_set.id
Expand Down

0 comments on commit 871bb6f

Please sign in to comment.