-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add basic plate report for PICK plates
- Loading branch information
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package LIMS2::Report::PICKPlate; | ||
|
||
use Moose; | ||
use namespace::autoclean; | ||
|
||
extends qw( LIMS2::ReportGenerator::Plate::SingleTargeted ); | ||
|
||
override plate_types => sub { | ||
return [ 'EP_PICK', 'SEP_PICK', 'XEP_PICK' ]; | ||
}; | ||
|
||
override _build_name => sub { | ||
my $self = shift; | ||
|
||
return 'Pick Plate ' . $self->plate_name; | ||
}; | ||
|
||
# Basic columns, will need to add more as these plate reports start | ||
# getting used. | ||
# Probaby need to add: | ||
# well primer bands | ||
# child wells | ||
# parent well | ||
# qc results | ||
override _build_columns => sub { | ||
my $self = shift; | ||
|
||
return [ | ||
$self->base_columns, | ||
"Cassette", "Recombinases", "Cell Line", | ||
]; | ||
}; | ||
|
||
override iterator => sub { | ||
my $self = shift; | ||
|
||
my $wells_rs = $self->plate->search_related( | ||
wells => {}, | ||
{ | ||
prefetch => [ | ||
'well_accepted_override', 'well_qc_sequencing_result' | ||
], | ||
order_by => { -asc => 'me.name' } | ||
} | ||
); | ||
|
||
return Iterator::Simple::iter sub { | ||
my $well = $wells_rs->next | ||
or return; | ||
|
||
my $process_cell_line = $well->ancestors->find_process( $well, 'process_cell_line' ); | ||
my $cell_line = $process_cell_line ? $process_cell_line->cell_line : ''; | ||
|
||
return [ | ||
$self->base_data( $well ), | ||
$well->cassette->name, | ||
join( q{/}, @{ $well->recombinases } ), | ||
$cell_line, | ||
]; | ||
}; | ||
}; | ||
|
||
__PACKAGE__->meta->make_immutable; | ||
|
||
1; | ||
|
||
__END__ |