3 SGN::Controller::Variant
7 Controller for pages related to genotype markers (those stored in nd_protocolprop
8 and summarized in the marker materialized view).
12 package SGN
::Controller
::Variant
;
16 use CXGN
::Marker
::SearchMatView
;
18 BEGIN { extends
'Catalyst::Controller' }
24 # PATH: /variant/{variant_name}/details
25 # - Get variant details
26 # - Stash the variant's marker information
27 # - Display variant detail page
29 sub get_variant_details
: Chained
('get_variant') PathPart
('details') :Args
(0) {
30 my ( $self, $c ) = @_;
31 my $schema = $c->dbic_schema("Bio::Chado::Schema");
32 my $variant_name = $c->stash->{variant_name
};
35 my $msearch = CXGN
::Marker
::SearchMatView
->new(bcs_schema
=> $schema);
36 my $variant_details = $msearch->query({ variant
=> $variant_name });
37 my $markers = $variant_details->{'variants'}->{$variant_name};
41 $c->stash->{template
} = "generic_message.mas";
42 $c->stash->{message
} = "<strong>No Markers Found</strong> for variant $variant_name<br />You can view and search for markers from the <a href='/search/variants'>Marker Search Page</a>";
46 $c->stash->{markers
} = $markers;
47 $c->stash->{template
} = '/markers/genotyped/variant_details.mas';
52 # PATH: /variant/{variant_name}
53 # - Stash variant_name
55 sub get_variant
: Chained
('/') PathPart
('variant') :CaptureArgs
(1) {
56 my ( $self, $c, $variant ) = @_;
57 $c->stash->{variant_name
} = $variant;