Skip to content

Commit

Permalink
Merge branch 'devel' of github.com:htgt/LIMS2-WebApp into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
af11-sanger committed Feb 26, 2015
2 parents 464b30e + 9342afd commit bf477d5
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
16 changes: 16 additions & 0 deletions lib/LIMS2/Model/Schema/Result/Well.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,22 @@ sub parent_crispr {
}
## use critic

sub parent_crisprs {
my $self = shift;

my @crisprs;
my $ancestors = $self->ancestors->depth_first_traversal( $self, 'in' );
if ( defined $ancestors ) {
while( my $ancestor = $ancestors->next ) {
if ( $ancestor->plate->type_id eq 'CRISPR' ) {
push @crisprs, $ancestor;
}
}
}
return @crisprs;
}
## use critic

## no critic(RequireFinalReturn)
## This returns the final set (single or paired) of CRISPR_V parents
## It will stop traversing if it hits a CRISPR_V grandparent,
Expand Down
14 changes: 13 additions & 1 deletion lib/LIMS2/WebApp/Controller/PublicReports.pm
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,19 @@ sub _stash_well_genotyping_info {
try {
#needs to be given a method for finding genes
my $data = $well->genotyping_info( sub { $c->model('Golgi')->find_genes( @_ ); } );
$c->stash( data => $data );
my @crispr_data;

my @crisprs = $well->parent_crisprs;
foreach my $crispr_well ( @crisprs ) {
my $process_crispr = $crispr_well->process_output_wells->first->process->process_crispr;
if ( $process_crispr ) {
my $crispr_data_hash = $process_crispr->crispr->as_hash;
$crispr_data_hash->{crispr_well} = $crispr_well->as_string;
push @crispr_data, $crispr_data_hash;
}
}

$c->stash( data => $data, crispr_data => \@crispr_data );
}
catch {
#get string representation if its a lims2::exception
Expand Down
26 changes: 26 additions & 0 deletions root/site/publicreports/well_genotyping_info.tt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,32 @@
</tr>
</table>

<h3>Crispr Information ([% IF crispr_data.size == 1 %]1 crispr[% ELSE %][% crispr_data.size %] crisprs[% END %])</h3>
[% FOR crispr IN crispr_data %]
<table id="genotyping_table2" class="table table-bordered table-condensed table-striped">
<tr>
<th>Crispr ID</th>
<td>[% crispr.id %]</td>
</tr>
<tr>
<th>CRISPR Well</th>
<td>[% crispr.crispr_well %]</td>
</tr>
<tr>
<th>Sequence</th>
<td class="alignment">[% crispr.seq %]</td>
</tr>
<tr>
<th>Locus</th>
<td>[% crispr.locus.chr_name %]:[% crispr.locus.chr_start %]-[% crispr.locus.chr_end %]</td>
</tr>
<tr>
<th>PAM Right</th>
<td>[% crispr.pam_right %]</td>
</tr>
</table>
[% END %]

<h3>First Allele</h3>
<table id="genotyping_table2" class="table table-bordered table-condensed table-striped">
<tr>
Expand Down

0 comments on commit bf477d5

Please sign in to comment.