1 ######################################################################
3 # Search the phenome database and displays the results.
5 ######################################################################
13 use CXGN
::Page
::FormattingHelpers qw
/blue_section_html
18 use CXGN
::Search
::CannedForms
;
19 #################################################
21 # Start a new SGN page.
23 my $page=CXGN
::Page
->new("SGN gene search results","Naama");
26 print page_title_html
('Gene search results');
29 #create the search and query objects
30 my $search = CXGN
::Phenome
->new;
31 my $query = $search->new_query;
33 $search->page_size(10); #set 10 loci per page
38 my %params = $page->get_all_encoded_arguments;
39 my $any_name = $page->get_encoded_arguments("any_name");
42 $query->from_request(\
%params);
47 $query->order_by( locus_symbol
=> 'UPPER(&t)');
48 my $result = $search->do_search($query); #execute the search
53 while(my $r = $result->next_result) {
55 my ($allele_name, $allele_symbol, $phenotype) = ($r->[3], $r->[4], $r->[6]);
56 my $allele_obsolete = $r->[8];
58 my $phenotype= substr($r->[6],0,20);
64 #if (!$allele_obsolete) { #don't display obsolete alleles! #alleles shouldn't be obsolete now..
66 push @results, [map {$_} ($r->[14],
67 '<a href="/phenome/locus_display.pl?locus_id='.$r->[0].'">'.$r->[1].'</a>',
79 #build the HTML to output
80 my $pagination_html = $search->pagination_buttons_html( $query, $result );
83 my $results_html = <<EOH;
84 <div id="searchresults">
87 $results_html .= columnar_table_html
(headings
=> ['Organism',
99 $results_html .= <<EOH;
107 print blue_section_html
('Gene search results', ,sprintf('<span class="paginate_summary">%s matches </span>', $result->total_results,$result->time),$results_html);
109 print '<h4><span class="">No matches found</span></h4>';
112 print info_section_html
(title
=> 'Search again',
113 contents
=>CXGN
::Search
::CannedForms
::gene_search_form
($page,$query)