2 package SGN
::Controller
::Reports
;
6 use SGN
::Model
::Cvterm
;
8 BEGIN { extends
'Catalyst::Controller' };
10 sub reports
: Path
('/reports') Args
(0) {
14 $c->stash->{template
} = '/reports/index.mas';
17 sub overview
: Path
('/reports/overview') Args
(0) {
21 my $schema = $c->dbic_schema("Bio::Chado::Schema");
22 my $people_schema = $c->dbic_schema("CXGN::People::Schema");
26 # Number of Germplasms
27 # Number of Germplasm with Pedigree
28 # Number of Germplasms with phenotyping information
29 # Number of Germplasm with Genotyping information
35 # Number of Spectra data
38 # Number of tissue samples
39 # Number of genotyping plates
40 # Number of genotyping protocols
44 # Number of Breeding programs
46 # Number of Phenotypes
48 # number of accessions
50 my $accession_type_id = SGN
::Model
::Cvterm
->get_cvterm_row($schema, 'accession', 'stock_property')->cvterm_id();
51 my $rs = $schema->resultset("Stock::Stock")->search( { type_id
=> $accession_type_id });
52 $stats{accession_count
} = $rs->count();
54 my $female_parent_type_id = SGN
::Model
::Cvterm
->get_cvterm_row($schema, 'female_parent', 'stock_relationship');
55 my $accession_with_pedigrees = $schema->resultset("Stock::Stock")->search( { type_id
=> $accession_type_id }, { join => 'object', '+select' => 'object.type_id', '+as' => 'relationship_type_id' });
58 $c->stash->{template
} = '/reports/overview.mas';