minor fixes
[sgn.git] / cgi-bin / phenome / allele_browser.pl
blobd1fc99de9ba2773e1494b84548155c72ba9b927e
1 use strict;
2 use warnings;
4 use CXGN::Scrap::AjaxPage;
6 my $doc = CXGN::Scrap::AjaxPage->new();
7 $doc->send_http_header();
8 my ($locus_id, $individual_id) = $doc->get_encoded_arguments("locus_id", "stock_id");
10 my $dbh = CXGN::DB::Connection->new();
12 my $allele_query = $dbh->prepare("SELECT DISTINCT(allele.allele_id), allele.allele_symbol, allele.allele_name, is_default FROM phenome.allele WHERE allele.obsolete = 'false' AND locus_id=? ORDER BY is_default DESC");
13 $allele_query->execute($locus_id);
15 my ($allele_id, $allele_symbol, $allele_name) = $allele_query->fetchrow_array();
16 my $available_alleles;
18 while($allele_id){
19 if($allele_symbol eq ""){
20 $allele_symbol = 'default';
22 $available_alleles .= "$allele_id*$allele_symbol|";
23 ($allele_id, $allele_symbol, $allele_name) = $allele_query->fetchrow_array();
26 print "$available_alleles";