Skip to content

Commit

Permalink
add basic plate report for PICK plates
Browse files Browse the repository at this point in the history
  • Loading branch information
sajp committed Aug 13, 2012
1 parent 84e0354 commit 335b8ac
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions lib/LIMS2/Report/PICKPlate.pm
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__

0 comments on commit 335b8ac

Please sign in to comment.