From a7f1f23403dd099d8ffa4eb61921e83f158596de Mon Sep 17 00:00:00 2001 From: Peter Keen Date: Thu, 30 Jul 2015 14:05:10 +0100 Subject: [PATCH 1/9] v0.329 Improved genoverse views 0.329 2015-07-22 10:45:33 Europe/London Sponsor front page sub-report updated: - Added splice_acceptor calls to the frameshift counts - het clones make a green project checkpoint - failed project always turn red most recent checkpoint --- Changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changes b/Changes index 6b70294331..3b08075f57 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,6 @@ {{$NEXT}} + +0.329 2015-07-30 13:30:02 Europe/London Improved genoverse views Fixed bug in crispr damage QC view Added primer generation to crispr import From 3dd3b15648829c7f14ceda34f0054efdac140660 Mon Sep 17 00:00:00 2001 From: Peter Keen Date: Thu, 30 Jul 2015 14:49:55 +0100 Subject: [PATCH 2/9] v0.330 --- Changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changes b/Changes index 3b08075f57..188f89af18 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ {{$NEXT}} +0.330 2015-07-30 14:07:01 Europe/London + 0.329 2015-07-30 13:30:02 Europe/London Improved genoverse views Fixed bug in crispr damage QC view From 8d047f8f97c432cec170f1e770276a64c29c6474 Mon Sep 17 00:00:00 2001 From: af11_sanger Date: Wed, 5 Aug 2015 15:04:08 +0100 Subject: [PATCH 3/9] v0.331 Het summary report added Vector QC plasmid maps added to result view Assembly plate QC verified status flag added --- Changes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Changes b/Changes index 188f89af18..3883697b64 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,11 @@ {{$NEXT}} +0.331 2015-08-05 14:26:27 Europe/London + + Het summary report added + Vector QC plasmid maps added to result view + Assembly plate QC verified status flag added + 0.330 2015-07-30 14:07:01 Europe/London 0.329 2015-07-30 13:30:02 Europe/London From 7ac8619c4ce10ed448209346d0b8667823509597 Mon Sep 17 00:00:00 2001 From: Peter Keen Date: Mon, 10 Aug 2015 16:45:25 +0100 Subject: [PATCH 4/9] Removed debugging tool from script --- Changes | 1 + lib/LIMS2/WebApp/Controller/User/Crisprs.pm | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Changes b/Changes index 3883697b64..a5ccbff04a 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,5 @@ {{$NEXT}} +Het summary update 0.331 2015-08-05 14:26:27 Europe/London diff --git a/lib/LIMS2/WebApp/Controller/User/Crisprs.pm b/lib/LIMS2/WebApp/Controller/User/Crisprs.pm index 65e3d5acfe..3f611e46e3 100644 --- a/lib/LIMS2/WebApp/Controller/User/Crisprs.pm +++ b/lib/LIMS2/WebApp/Controller/User/Crisprs.pm @@ -463,7 +463,6 @@ sub wge_crispr_importer :Path( '/user/wge_crispr_importer' ) : Args(0) { $c->stash( success_msg => "Successfully imported the following WGE ids:\n" . join ', ', map { $_->{wge_id} } @output ); } - $c->stash( crispr => \@output, ); From 8ca30abc1bf110e87aba5fe24046ab78b3a70183 Mon Sep 17 00:00:00 2001 From: Peter Keen Date: Mon, 10 Aug 2015 17:25:49 +0100 Subject: [PATCH 5/9] v0.332 --- Changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changes b/Changes index a5ccbff04a..4f86a11e63 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,6 @@ {{$NEXT}} + +0.332 2015-08-10 16:50:10 Europe/London Het summary update 0.331 2015-08-05 14:26:27 Europe/London From 2780719656e831b1ca774ad0e7c1d4ddfa799577 Mon Sep 17 00:00:00 2001 From: Tiago Grego Date: Wed, 12 Aug 2015 14:12:48 +0100 Subject: [PATCH 6/9] v0.332 Front page report wide view update Extra methods to check region around primers --- Changes | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Changes b/Changes index 4f86a11e63..89bb63bbc6 100644 --- a/Changes +++ b/Changes @@ -1,7 +1,13 @@ {{$NEXT}} +0.332 2015-08-12 13:36:44 Europe/London + + Front page report wide view update + Extra methods to check region around primers + 0.332 2015-08-10 16:50:10 Europe/London -Het summary update + + Het summary update 0.331 2015-08-05 14:26:27 Europe/London @@ -12,10 +18,11 @@ Het summary update 0.330 2015-07-30 14:07:01 Europe/London 0.329 2015-07-30 13:30:02 Europe/London -Improved genoverse views -Fixed bug in crispr damage QC view -Added primer generation to crispr import -QC run summary changed to handle similar designs + + Improved genoverse views + Fixed bug in crispr damage QC view + Added primer generation to crispr import + QC run summary changed to handle similar designs 0.329 2015-07-22 10:45:33 Europe/London From 5cff5cf390af3a7cdb0c369c65c94860c467028f Mon Sep 17 00:00:00 2001 From: Tiago Grego Date: Wed, 12 Aug 2015 14:58:45 +0100 Subject: [PATCH 7/9] v0.333 Front page report wide view update Extra methods to check region around primers --- Changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changes b/Changes index 89bb63bbc6..7877122239 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,6 @@ {{$NEXT}} -0.332 2015-08-12 13:36:44 Europe/London +0.333 2015-08-12 14:15:23 Europe/London Front page report wide view update Extra methods to check region around primers From b5d425ddaa2ca88a3dc2364cf0a4b03f843a9b18 Mon Sep 17 00:00:00 2001 From: Peter Keen Date: Fri, 21 Aug 2015 10:59:19 +0100 Subject: [PATCH 8/9] Added search crisprs by sequence and validation tags to public reports --- lib/LIMS2/WebApp/Controller/PublicReports.pm | 37 +++- lib/LIMS2/WebApp/Controller/User/Crisprs.pm | 50 ++++- root/lib/navigation.tt | 2 +- .../publicreports/well_genotyping_info.tt | 29 +++ root/site/user/crisprs/search_crisprs.tt | 184 +++++++++++++++++- root/site/user/crisprs/view_crispr_pair.tt | 6 +- root/static/js/primer_validation_state.js | 9 + 7 files changed, 298 insertions(+), 19 deletions(-) diff --git a/lib/LIMS2/WebApp/Controller/PublicReports.pm b/lib/LIMS2/WebApp/Controller/PublicReports.pm index 22a4040ac7..b0f11509ae 100644 --- a/lib/LIMS2/WebApp/Controller/PublicReports.pm +++ b/lib/LIMS2/WebApp/Controller/PublicReports.pm @@ -5,8 +5,10 @@ use Try::Tiny; use Data::Printer; use LIMS2::Model::Util::EngSeqParams qw( generate_well_eng_seq_params ); use LIMS2::Model::Util::CrisprESQCView qw(crispr_damage_type_for_ep_pick); +use LIMS2::Model::Util::Crisprs qw( crisprs_for_design ); use List::MoreUtils qw( uniq ); use namespace::autoclean; +use feature 'switch'; BEGIN { extends 'Catalyst::Controller'; } @@ -48,7 +50,7 @@ sub cre_knockin_project_status : Path( '/public_reports/cre_knockin_project_stat $c->stash( template => 'publicreports/await_report.tt', report_name => 'Cre_KnockIn_Project_Status', - report_id => $report_id + report_id => $report_id, ); return; @@ -115,9 +117,6 @@ sub allele_dump : Path( '/public_reports/allele_dump' ) : Args(0) { return; } - - - =head2 index =cut @@ -540,18 +539,31 @@ sub _stash_well_genotyping_info { } $data->{child_barcodes} = $well->distributable_child_barcodes; my @crispr_data; - my @crisprs = $well->parent_crispr_wells; 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 ); + my @crispr_pair_schema = $c->model('Golgi')->schema->resultset('CrisprPair')->search({ left_crispr_id => $crispr_data[0]->{id}})->all; + my $crispr_pair = $c->model('Golgi')->retrieve_crispr_pair( { id => $crispr_pair_schema[0]->{_column_data}->{id} } ); + $crispr_pair = $crispr_pair->as_hash; + + my $crispr_primers = $data->{primers}->{crispr_primers}; + my $match; + foreach my $set (values %$crispr_primers) + { + foreach my $primer(@$set){ + $match = search_primers($primer->{seq}, $crispr_pair->{crispr_primers}); + $primer->{is_validated} = $match->{is_validated}; + $primer->{is_rejected} = $match->{is_rejected}; + } + } + $c->stash( data => $data, crispr_data => \@crispr_data); } catch { #get string representation if its a lims2::exception @@ -560,7 +572,16 @@ sub _stash_well_genotyping_info { return; } - +sub search_primers { + my ($seq, $validation_primers) = @_; + foreach my $valid_primer(@$validation_primers) + { + if ($seq eq $valid_primer->{primer_seq}){ + return $valid_primer; + } + } + return; +} =head2 public_gene_report Public gene report, only show targeted clone details: diff --git a/lib/LIMS2/WebApp/Controller/User/Crisprs.pm b/lib/LIMS2/WebApp/Controller/User/Crisprs.pm index 3f611e46e3..fe105efe12 100644 --- a/lib/LIMS2/WebApp/Controller/User/Crisprs.pm +++ b/lib/LIMS2/WebApp/Controller/User/Crisprs.pm @@ -49,7 +49,6 @@ sub search_crisprs : Path( '/user/search_crisprs' ) : Args(0) { $c->stash->{$item} = $value; } } - my $crispr_entity; if($c->req->param('search_by_lims2_id')){ my $params = { @@ -74,7 +73,9 @@ sub search_crisprs : Path( '/user/search_crisprs' ) : Args(0) { $c->stash->{error_msg} = "Failed to find WGE crispr in LIMS2: $e"; } } - + elsif($c->req->param('search_by_sequence')){ + sequence_search($self, $c); + } if($crispr_entity){ my $redirect_path = _path_for_crispr_entity($crispr_entity); $c->res->redirect( $c->uri_for($redirect_path) ); @@ -235,7 +236,6 @@ sub crispr_ucsc_blat : PathPart('blat') Chained('crispr') : Args(0) { =cut sub crispr_pair : PathPart('user/crispr_pair') Chained('/') CaptureArgs(1) { my ( $self, $c, $crispr_pair_id ) = @_; - $c->assert_user_roles( 'read' ); my $species_id = $c->request->param('species') || $c->session->{selected_species}; @@ -276,7 +276,6 @@ sub crispr_pair : PathPart('user/crispr_pair') Chained('/') CaptureArgs(1) { =cut sub view_crispr_pair : PathPart('view') Chained('crispr_pair') Args(0) { my ( $self, $c ) = @_; - my $crispr_pair = $c->stash->{cp}; my $off_target_summary = Load( $crispr_pair->off_target_summary ); my $cp_data = $crispr_pair->as_hash; @@ -692,6 +691,49 @@ sub generate_on_import { return; } +sub sequence_search { + my ($self, $c) = @_; + my $sequence = $c->req->param('sequence'); + $sequence = uc $sequence; + my $count = length($sequence); + if ( $count > 23) { + $c->stash->{info_msg} = "Please provide 23 or less base sequence, you provided ". $count; + return; + } + elsif ( $sequence =~ qr/^[ACTG]+$/ ){ + my $species = $c->session->{selected_species}; + + my @crisprs = $c->model('Golgi')->schema->resultset('Crispr')->search({ + seq => {'like', "%".$sequence."%"}, + species_id => $species, + }, + { + distinct => 1, + columns => [qw/ + id + seq + species_id + /], + } + ); + if (@crisprs){ + $c->stash( + crispr => \@crisprs, + original => $sequence, + ); + } + else { + $c->stash->{info_msg} = "No crispr were found with the sequence pattern: ". $sequence; + } + return + } + else { + $c->stash->{info_msg} = "Not a valid sequence, please check for invalid bases."; + return; + } + +} + __PACKAGE__->meta->make_immutable; 1; diff --git a/root/lib/navigation.tt b/root/lib/navigation.tt index 6d60db1ed2..c156204c6c 100644 --- a/root/lib/navigation.tt +++ b/root/lib/navigation.tt @@ -82,7 +82,7 @@
  • - Find Crisprs by ID + Find Crisprs
  • diff --git a/root/site/publicreports/well_genotyping_info.tt b/root/site/publicreports/well_genotyping_info.tt index d74b42c590..228274380f 100644 --- a/root/site/publicreports/well_genotyping_info.tt +++ b/root/site/publicreports/well_genotyping_info.tt @@ -205,6 +205,10 @@ [% primer.name %] [% primer.seq %] + [% END %] [% END %] @@ -266,3 +270,28 @@
    + + + diff --git a/root/site/user/crisprs/search_crisprs.tt b/root/site/user/crisprs/search_crisprs.tt index 3d175073b4..e9bbc233e0 100755 --- a/root/site/user/crisprs/search_crisprs.tt +++ b/root/site/user/crisprs/search_crisprs.tt @@ -16,4 +16,186 @@

    - \ No newline at end of file + + +
    + Search by Sequence + +

    + +
    + +[% IF crispr %] +
    + View Crisprs + + + + + + + + + + [% FOREACH entity IN crispr %] + + + + + + [% END %] + +
    Crispr IDSpeciesSequence
    [% entity.id %][% entity.species_id %][% entity.seq %]
    +
    + +[% END %] + + + + diff --git a/root/site/user/crisprs/view_crispr_pair.tt b/root/site/user/crisprs/view_crispr_pair.tt index cc252c8ca4..1dead20084 100644 --- a/root/site/user/crisprs/view_crispr_pair.tt +++ b/root/site/user/crisprs/view_crispr_pair.tt @@ -135,12 +135,8 @@ $(document).ready(function() { $(".validation-state-cell").each(function(){ //(cell, api_url, object_id_param, object_id, primer_type, is_validated) - addPrimerValidationState( + addPrimerValidationLabel( $(this), - "[% c.uri_for('/user/toggle_crispr_primer_validation_state') %]", - 'crispr_key', - '[% cp.id %]' + '(crispr_pair)', - $(this).data('primer-name'), $(this).data('validated') ); }); diff --git a/root/static/js/primer_validation_state.js b/root/static/js/primer_validation_state.js index 59b3c0b812..c2d6bcf17d 100755 --- a/root/static/js/primer_validation_state.js +++ b/root/static/js/primer_validation_state.js @@ -54,3 +54,12 @@ function addPrimerValidationState(cell, api_url, object_id_param, object_id, pri cell.append(not_valid_label); } } + +function addPrimerValidationLabel(cell, is_validated){ + if(is_validated == 1){ + cell.append(valid_label); + } + else{ + cell.append(not_valid_label); + } +} From a1267a26ce52d9ec696c2aaa7cb8c5ea97895194 Mon Sep 17 00:00:00 2001 From: Peter Keen Date: Fri, 21 Aug 2015 12:14:51 +0100 Subject: [PATCH 9/9] v0.334 Search crisprs by sequence feature added Crispr primer validation checks added to public reports --- Changes | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Changes b/Changes index 7877122239..a2dcd2e575 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ {{$NEXT}} +0.334 2015-08-21 11:32:40 Europe/London + Search crisprs by sequence feature added + Crispr primer validation checks added to public reports + 0.333 2015-08-12 14:15:23 Europe/London Front page report wide view update