1 package SGN
::Feature
::LocusPages
;
3 use namespace
::autoclean
;
9 use SGN
::SiteFeatures
::CrossReference
;
11 extends
'SGN::Feature';
13 has
'+description' => (
14 default => 'Genetic loci',
18 my ( $self, $query ) = @_;
22 return ( $self->_name_xrefs( $query ),
23 #$self->_phenotype_xrefs( $query ),
28 my ( $self, $q ) = @_;
30 my $search = CXGN
::Phenome
->new;
31 my $query = $search->new_query;
32 $query->locus_obsolete(" = 'f' ");
33 $query->any_name("lower(&t) = ? ", lc $q );
34 my $result = $search->do_search($query);
36 # fetch at most 5 results, hashing by locus name
37 my %results = map { $_->[1] => $_ } reverse grep $_, map { $result->next_result } 1..5;
39 # make xrefs out of them
41 for my $locus_name ( sort keys %results ) {
42 my $r = $results{$locus_name};
44 my $text = qq|$r->[14] locus
$r->[2]|;
45 $text .= " ($locus_name)" unless $locus_name eq $r->[2];
47 push @xrefs, SGN
::SiteFeatures
::CrossReference
->new({
50 url
=> URI
->new( '/phenome/locus_display.pl?locus_id='.$r->[0] ),