Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'devel' of github.com:htgt/LIMS2-WebApp into process_tree

  • Loading branch information...
commit 574958598eef9c37dda8168ace9a833eec975df2 2 parents 0998388 + cc16240
@dparrysmith dparrysmith authored
View
9 Changes
@@ -1,5 +1,14 @@
{{$NEXT}}
+0.054 2013-02-28 10:45:42 Europe/London
+
+ Added DesignVectors report
+
+0.053 2013-02-26 16:13:34 Europe/London
+
+ Copy Plate backend added
+ Final Pick process and plate type added
+
0.052 2013-02-21 09:52:15 Europe/London
GenesToElectroporate report now generated from summaries table
View
287 lib/LIMS2/Model/Plugin/GenotypingQC.pm
@@ -15,154 +15,115 @@ requires qw( schema check_params throw );
sub pspec_update_genotyping_qc_data{
return {
- csv_fh => { validate => 'file_handle' },
+ csv_fh => { validate => 'file_handle' },
created_by => { validate => 'existing_user' },
};
}
sub update_genotyping_qc_data{
- my ($self, $params) = @_;
+ my ($self, $params) = @_;
- my $val_params = $self->check_params( $params, $self->pspec_update_genotyping_qc_data );
- my $data = parse_csv_file( $val_params->{csv_fh});
+ my $val_params = $self->check_params( $params, $self->pspec_update_genotyping_qc_data );
+ my $data = parse_csv_file( $val_params->{csv_fh});
- my @assay_types = sort map { $_->id } $self->schema->resultset('GenotypingResultType')->all;
- my @required_data = qw(copy_number copy_number_range);
- my @primer_bands = qw(tr_pcr lr_pcr gr3 gr4 gf3 gf4);
+ my @assay_types = sort map { $_->id } $self->schema->resultset('GenotypingResultType')->all;
+ my @primer_bands = qw(tr_pcr lr_pcr gr3 gr4 gf3 gf4);
my @messages;
# Build a hash of all valid col names so we can report anything not recognized
my $recognized = $self->_valid_column_names(\@assay_types, \@primer_bands);
my $not_recognized = {};
- my $counter;
- foreach my $datum (@$data){
- $counter++;
+ my $counter;
+ foreach my $datum (@$data){
+ $counter++;
# Store unrecognized columns to report to user
-# Perlcritic rejects use of grep in a void context and recommends a for loop
-# grep { $not_recognized->{$_} = 1 } grep { not $recognized->{$_} } keys %$datum;
+ # Perlcritic rejects use of grep in a void context and recommends a for loop
+ # grep { $not_recognized->{$_} = 1 } grep { not $recognized->{$_} } keys %$datum;
my @nr = grep { not $recognized->{$_} } keys %$datum;
foreach my $nr_datum ( @nr ) {
$not_recognized->{$nr_datum} = 1;
}
- unless ($datum->{well_name}){
- die "No well name provided for line $counter";
- }
+ unless ($datum->{well_name}){
+ die "No well name provided for line $counter";
+ }
- # split well name and retrieve well
- my ($plate_name,$well_name) = ( $datum->{well_name} =~ /^(.*)_([A-Z]\d{2})$/g );
- my $search_params = { plate_name => $plate_name, well_name => $well_name };
+ # split well name and retrieve well
+ my ($plate_name,$well_name) = ( $datum->{well_name} =~ /^(.*)_([A-Z]\d{2})$/g );
+ my $search_params = { plate_name => $plate_name, well_name => $well_name };
my $well = $self->retrieve_well( $search_params )
or $self->throw(NotFound => { entity_class => 'Well', search_params => $search_params });
push @messages, "Well ".$datum->{well_name}.":";
- # update targeting_pass and chromosome_fail if provided
- foreach my $overall qw(targeting_pass targeting-puro_pass chromosome_fail){
- if (my $result = $datum->{$overall}){
+ # update targeting_pass and chromosome_fail if provided
+ foreach my $overall qw(targeting_pass targeting-puro_pass chromosome_fail){
+ if (my $result = $datum->{$overall}){
# Change targeting-puro (targeting minus puro) to targeting_puro
# for consistency with naming of db tables
my $table = $overall;
$table =~ s/targeting-puro/targeting_puro/;
- # Tidy up result input values
- $result =~ s/\s*//g;
- $result = lc($result) unless $result eq "Y";
-
- my $method = "update_or_create_well_".$table;
- my ($result, $message) = $self->$method({
- well_id => $well->id,
- result => $result,
- created_by => $val_params->{created_by},
- });
- push @messages, "- ".$message;
- }
- }
-
- # for each assay type see if we have pass/call
- # if we do and pass/call == na or fa then create/update with no values
- # for other pass/call values create/update result with all available data (confidence is optional)
- foreach my $assay (@assay_types){
- if (my $call = $datum->{$assay."_pass"}){
- my ($result, $message);
-
- # Tidy up call input values
- $call =~ s/\s*//g;
- $call = lc($call);
-
- if ($call eq "na" or $call eq "fa"){
- # Update call - any existing copy number etc will be removed from db
- ($result, $message) = $self->update_or_create_well_genotyping_result({
- well_id => $well->id,
- genotyping_result_type_id => $assay,
- call => $call,
- created_by => $val_params->{created_by},
- });
- }
- else{
- # Check we have required fields
- my %new_values;
- foreach my $field (@required_data){
- defined( $new_values{$field} = $datum->{$assay."_$field"} )
- or die "No $assay $field value found for ".$well->name;
- }
- # confidence is optional
- if (defined (my $conf = $datum->{$assay."_confidence"}) ){
- $new_values{'confidence'} = $conf;
- }
-
- ($result, $message) = $self->update_or_create_well_genotyping_result({
- well_id => $well->id,
- genotyping_result_type_id => $assay,
- call => $call,
- created_by => $val_params->{created_by},
- %new_values,
- })
- }
- push @messages, "- ".$message;
- }
- }
-
- # Handle well primer band status
- foreach my $primer (@primer_bands){
- my $value = $datum->{$primer};
- if (defined $value){
- die "Invalid data \"$value\" provided for well ".$datum->{well_name}." $primer" unless $value eq "yes";
-
- # FIXME: need an update or create method
+ # Tidy up result input values
+ $result =~ s/\s*//g;
+ $result = lc($result) unless $result eq "Y";
+
+ my $method = "update_or_create_well_".$table;
+ my ($result, $message) = $self->$method({
+ well_id => $well->id,
+ result => $result,
+ created_by => $val_params->{created_by},
+ });
+ push @messages, "- ".$message;
+ }
+ }
+ # for each assay type see if we have pass/call
+ # if we do and pass/call == na or fa then create/update with no values
+ # for other pass/call values create/update result with all available data (confidence is optional)
+ foreach my $assay (@assay_types){
+ create_assay($self, $datum, $val_params, $assay, $well, \@messages);
+ }
+
+ # Handle well primer band status
+ foreach my $primer (@primer_bands){
+ my $value = $datum->{$primer};
+ if (defined $value){
+ die "Invalid data \"$value\" provided for well ".$datum->{well_name}." $primer" unless $value eq "yes";
+
+ # FIXME: need an update or create method
# update_or_create_well_primer_band now implemented and this code should be updated to use it
- $self->create_well_primer_bands({
- well_id => $well->id,
- primer_band_type => $primer,
- pass => 1,
- created_by => $val_params->{created_by},
- });
-
- push @messages, "- Created $primer primer band with pass";
- }
- }
- }
+ $self->create_well_primer_bands({
+ well_id => $well->id,
+ primer_band_type => $primer,
+ pass => 1,
+ created_by => $val_params->{created_by},
+ });
+
+ push @messages, "- Created $primer primer band with pass";
+ }
+ }
+ }
if (keys %$not_recognized){
- unshift @messages, "The following unrecognized columns were ignored: "
- .join ", ", sort keys %$not_recognized;
+ unshift @messages, "The following unrecognized columns were ignored: "
+ .join ", ", sort keys %$not_recognized;
}
- return \@messages;
+ return \@messages;
}
sub _valid_column_names{
- my ($self, $assay_types, $primer_bands) = @_;
+ my ($self, $assay_types, $primer_bands) = @_;
- # Overall results including primer bands
+ # Overall results including primer bands
my %recognized = map { $_ => 1 } qw(well_name targeting_pass targeting-puro_pass chromosome_fail),
@$primer_bands;
# Assay specific results
foreach my $assay (@$assay_types){
- foreach my $colname qw( pass confidence copy_number copy_number_range){
- $recognized{$assay."_".$colname} = 1;
- }
+ foreach my $colname qw( pass confidence copy_number copy_number_range){
+ $recognized{$assay."_".$colname} = 1;
+ }
}
return \%recognized;
}
@@ -174,6 +135,54 @@ sub _valid_column_names{
# a commit.
+sub create_assay{
+ my ($self, $datum, $val_params, $assay, $well, $messages ) = @_;
+
+ my @required_data = qw(copy_number copy_number_range);
+ if (my $call = $datum->{$assay."_pass"}){
+ my ($result, $message);
+
+ # Tidy up call input values
+ $call =~ s/\s*//g;
+ $call = lc($call);
+
+ if ($call eq "na" or $call eq "fa"){
+ # Update call - any existing copy number etc will be removed from db
+ ($result, $message) = $self->update_or_create_well_genotyping_result({
+ well_id => $well->id,
+ genotyping_result_type_id => $assay,
+ call => $call,
+ created_by => $val_params->{created_by},
+ });
+ }
+ else{
+ # Check required field's values are number and default blank values to zero
+ my %new_values;
+ foreach my $field (@required_data){
+ defined( $new_values{$field} = $datum->{$assay."_$field"} )
+ or $new_values{$field} = 0;
+ $self->throw( Validation => "$assay $field must be a number for well ".$well->name)
+ unless $new_values{$field} =~ /^\d+(\.\d+)?$/;
+ }
+
+ # confidence is optional
+ if (defined (my $conf = $datum->{$assay."_confidence"}) ){
+ $new_values{'confidence'} = $conf;
+ }
+
+ ($result, $message) = $self->update_or_create_well_genotyping_result({
+ well_id => $well->id,
+ genotyping_result_type_id => $assay,
+ call => $call,
+ created_by => $val_params->{created_by},
+ %new_values,
+ })
+ }
+ push @$messages, "- ".$message;
+ }
+return 1;
+}
+
sub pspec_update_genotyping_qc_value {
return {
well_id => { validate => 'integer' },
@@ -204,7 +213,7 @@ sub update_genotyping_qc_value {
};
# The more generic assay, call, copy_number, copy_range, confidence call is easier to handle.
- my $vp = $self->check_params( $params, $self->pspec_update_genotyping_qc_value );
+ my $vp = $self->check_params( $params, $self->pspec_update_genotyping_qc_value );
my $assay_name = $vp->{'assay_name'};
my $assay_value = $vp->{'assay_value'};
@@ -258,9 +267,9 @@ sub well_assay_update{
my $update_method = 'update_or_create_well_' . $assay_name;
my $well_assay_tag = $self->$update_method({
- created_by => $user,
- result => $assay_value,
- well_id => $well_id,
+ created_by => $user,
+ result => $assay_value,
+ well_id => $well_id,
});
return $well_assay_tag;
@@ -286,8 +295,8 @@ sub primer_band_update {
$well_primer_band = $self->update_or_create_well_primer_bands({
primer_band_type => $assay_name,
pass => $assay_value,
- created_by => $user,
- well_id => $well_id,
+ created_by => $user,
+ well_id => $well_id,
});
}
return $well_primer_band;
@@ -325,41 +334,41 @@ sub get_genotyping_qc_browser_data {
# SQL query requires plate id as input
my $sql_query = <<'SQL_END';
with wd as (
- select p.id "Plate ID"
- , p.name "plate"
- , w.name "well"
- , w.id "Well ID"
- , wgt.genotyping_result_type_id
- , wgt.call
- , wgt.copy_number
- , wgt.copy_number_range
- , wgt.confidence
- from plates p, wells w
+ select p.id "Plate ID"
+ , p.name "plate"
+ , w.name "well"
+ , w.id "Well ID"
+ , wgt.genotyping_result_type_id
+ , wgt.call
+ , wgt.copy_number
+ , wgt.copy_number_range
+ , wgt.confidence
+ from plates p, wells w
left join well_genotyping_results wgt
- on wgt.well_id = w.id
- where p.name = ?
- and w.plate_id = p.id
- order by w.name, wgt.genotyping_result_type_id )
+ on wgt.well_id = w.id
+ where p.name = ?
+ and w.plate_id = p.id
+ order by w.name, wgt.genotyping_result_type_id )
select wd."Plate ID", wd."plate", wd."Well ID", wd."well", wd.genotyping_result_type_id, wd.call,
- wd.copy_number, wd.copy_number_range, wd.confidence,
- well_chromosome_fail.result "Chr fail",
- well_targeting_pass.result "Tgt pass",
- well_targeting_puro_pass.result "Puro pass",
- well_primer_bands.primer_band_type_id "Primer band type",
- well_primer_bands.pass "Primer pass?"
+ wd.copy_number, wd.copy_number_range, wd.confidence,
+ well_chromosome_fail.result "Chr fail",
+ well_targeting_pass.result "Tgt pass",
+ well_targeting_puro_pass.result "Puro pass",
+ well_primer_bands.primer_band_type_id "Primer band type",
+ well_primer_bands.pass "Primer pass?"
from wd
left outer
- join well_chromosome_fail
- on wd."Well ID" = well_chromosome_fail.well_id
+ join well_chromosome_fail
+ on wd."Well ID" = well_chromosome_fail.well_id
left outer
- join well_targeting_pass
- on wd."Well ID" = well_targeting_pass.well_id
+ join well_targeting_pass
+ on wd."Well ID" = well_targeting_pass.well_id
left outer
- join well_targeting_puro_pass
- on wd."Well ID" = well_targeting_puro_pass.well_id
+ join well_targeting_puro_pass
+ on wd."Well ID" = well_targeting_puro_pass.well_id
left outer
- join well_primer_bands
- on wd."Well ID" = well_primer_bands.well_id
+ join well_primer_bands
+ on wd."Well ID" = well_primer_bands.well_id
order by wd."Well ID"
SQL_END
View
41 lib/LIMS2/Model/Plugin/Well.pm
@@ -2,7 +2,6 @@ package LIMS2::Model::Plugin::Well;
use strict;
use warnings FATAL => 'all';
-
use Moose::Role;
use Hash::MoreUtils qw( slice_def );
use Hash::Merge qw( merge );
@@ -13,6 +12,7 @@ use LIMS2::Model::ProcessGraph;
use LIMS2::Model::Util::EngSeqParams qw( fetch_design_eng_seq_params fetch_well_eng_seq_params add_display_id);
use LIMS2::Model::Util::RankQCResults qw( rank );
use LIMS2::Model::Util::DataUpload qw( parse_csv_file );
+use LIMS2::Model::Util::CreateProcess qw( create_process_aux_data_recombinase );
use Try::Tiny;
requires qw( schema check_params throw retrieve log trace );
@@ -1028,6 +1028,7 @@ sub create_well_genotyping_result {
slice_def $validated_params,
qw( call genotyping_result_type_id copy_number copy_number_range confidence created_by_id created_at )
});
+ $self->has_dre_been_applied ($validated_params);
}
return $genotyping_result;
}
@@ -1066,6 +1067,7 @@ sub update_or_create_well_genotyping_result {
$update_request->{confidence} = undef;
}
$genotyping_result->update( $update_request );
+ $self->has_dre_been_applied ($validated_params);
$message = "Genotyping result for ".$validated_params->{genotyping_result_type_id}
." updated from ".$previous." to ".$genotyping_result->call;
}
@@ -1078,8 +1080,12 @@ sub update_or_create_well_genotyping_result {
# The assay parameter to update is not a 'call', so no ranking needs to be applied
my $assay_field_slice = { slice_def( $validated_params, qw/ copy_number copy_number_range confidence / )};
my ( $assay_field, $assay_value ) = each %{$assay_field_slice};
- my $previous = $genotyping_result->$assay_field // 'undefined';
+
+ my $previous = defined ($genotyping_result->$assay_field) ? $genotyping_result->$assay_field : 'undefined';
+# my $previous = $genotyping_result->$assay_field // 'undefined';
+
$genotyping_result->update( $update_request );
+ $self->has_dre_been_applied ($validated_params);
$message = 'Genotyping result for ' . $validated_params->{genotyping_result_type_id} . '/' . $assay_field
. ' updated from ' . $previous . ' to ' . $genotyping_result->$assay_field;
}
@@ -1091,6 +1097,7 @@ sub update_or_create_well_genotyping_result {
slice_def $validated_params,
qw( call genotyping_result_type_id copy_number copy_number_range confidence created_by_id created_at )
});
+ $self->has_dre_been_applied ($validated_params);
$message = "Genotyping result for ".$validated_params->{genotyping_result_type_id}
." created with result ".$genotyping_result->call;
}
@@ -1129,11 +1136,41 @@ sub delete_well_genotyping_result {
my $genotyping_result = $self->retrieve_well_genotyping_result( $params );
$genotyping_result->delete;
+ $self->has_dre_been_applied($params);
$self->log->debug( 'Well genotyping_results deleted for well ' . $genotyping_result->well_id );
return;
}
+sub has_dre_been_applied {
+# params have always been validated before entering this method
+ my ( $self, $params ) = @_;
+
+ my $well = $self->retrieve_well( {slice_def $params, qw( plate_name well_name id)} );
+ return unless (! $well->is_double_targeted);
+ my @process = $well->parent_processes;
+ return unless scalar(@process) == 1 or (! well->is_double_targeted);
+
+ if ($well->cassette->cre and $params->{genotyping_result_type_id} eq 'puro' and $well->plate->type_id eq 'EP_PICK') {
+ # check for existing dre recombinase
+ my $dre_process = $process[0]->search_related('process_recombinases', {'recombinase_id' => 'Dre'})->first;
+ if (($params->{call} =~ 'pass') && ! defined($dre_process)) {
+ # add dre to wells parent process
+ my %recombinase_params = (
+ plate_name => $well->plate->name,
+ well_name => $well->name,
+ recombinase => ['Dre'],
+ );
+ create_process_aux_data_recombinase( $self, \%recombinase_params, $process[0] );
+ }
+ elsif ( ( ! ($params->{call} =~ 'pass')) and $dre_process) {
+ # remove dre from parent process
+ $dre_process->delete;
+ }
+ }
+ return 1;
+}
+
1;
__END__
View
2  lib/LIMS2/Model/Util/CreateProcess.pm
@@ -554,7 +554,7 @@ sub create_process_aux_data_recombinase {
"recombinase process should have 1 or more recombinases"
) unless @{ $validated_params->{recombinase} };
- my $rank = $process->process_recombinases->count + 1;
+ my $rank = ( $process->process_recombinases->get_column('rank')->max || 0 ) + 1;
foreach my $recombinase ( @{ $validated_params->{recombinase} } ) {
if ($process->process_recombinases->find( { 'recombinase_id' => $recombinase } )){
View
1  lib/LIMS2/WebApp/Controller/API/PlateWell.pm
@@ -298,6 +298,7 @@ sub well_genotyping_qc_PUT{
}
); # end transaction
# and finish here.
+
my $new_data = $c->model('Golgi')->retrieve_well({ id => $well_id})->all_genotyping_qc_data(
$model,
$c->session->{selected_species}
View
4 root/site/user/browsedesigns/list_designs_compact.tt
@@ -43,7 +43,7 @@
[% IF d.oligos_fasta %]
<form style="margin: 0; padding: 0;" id="UCSC_BLAT" enctype="multipart/form-data" method="post" action="http://genome.ucsc.edu/cgi-bin/hgBlat" name="UCSC_BLAT" target="_blank">
<input type="hidden" name="org" value="Mouse" />
- <input type="hidden" name="db" value="mm9" />
+ <input type="hidden" name="db" value="mm10" />
<input type="hidden" name="type" value="DNA" />
<input type="hidden" name="sort" value="query,score" />
<input type="hidden" name="output" value="hyperlink" />
@@ -62,4 +62,4 @@
</tbody>
</table>
-[%- INCLUDE 'pagination.tt' pageset = pageset %]
+[%- INCLUDE 'pagination.tt' pageset = pageset %]
View
2  root/site/user/browsedesigns/view_design.tt
@@ -83,7 +83,7 @@
[% IF design.oligos_fasta %]
<form id="UCSC_BLAT" enctype="multipart/form-data" method="post" action="http://genome.ucsc.edu/cgi-bin/hgBlat" name="UCSC_BLAT" target="_blank">
<input type="hidden" name="org" value="Mouse" />
- <input type="hidden" name="db" value="mm9" />
+ <input type="hidden" name="db" value="mm10" />
<input type="hidden" name="type" value="DNA" />
<input type="hidden" name="sort" value="query,score" />
<input type="hidden" name="output" value="hyperlink" />
View
10 t/50-model-plugin-genotypingqc.t
@@ -7,7 +7,6 @@ BEGIN {
use Log::Log4perl qw( :easy );
Log::Log4perl->easy_init( $FATAL );
}
-
use LIMS2::Test;
use Test::Most;
use Try::Tiny;
@@ -16,6 +15,7 @@ use File::Temp ':seekable';
note( "Testing Genotyping QC data update");
{
+
ok my $test_file = File::Temp->new or die('Could not create temp test file ' . $!);
my $plate = "SEP0006";
@@ -48,11 +48,11 @@ note( "Testing Genotyping QC data update");
ok my $chr_fail = model->retrieve_well_chromosome_fail($well_params), "chromosome fail exists";
is $chr_fail->result, "3", "chromosome fail == 3";
- # test assay result upload with missing data
+ # test assay result upload with invalid data
ok my $test_file2 = File::Temp->new or die('Could not create temp test file ' . $!);
- $test_file2->print(join ",", "well_name", "loxp_pass", "loxp_copy_number");
+ $test_file2->print(join ",", "well_name", "loxp_pass", "loxp_copy_number, loxp_copy_number_range");
$test_file2->print("\n");
- $test_file2->print(join ",", $plate."_".$well, "pass" , "2.1" );
+ $test_file2->print(join ",", $plate."_".$well, "pass" , "2.1", 'Failed' );
my $name2 = $test_file2->filename;
$test_file2->close;
@@ -60,7 +60,7 @@ note( "Testing Genotyping QC data update");
throws_ok{
model->update_genotyping_qc_data({ csv_fh => $fh2, created_by => 'test_user@example.org' })
- }qr/No loxp .* value found/;
+ }qr/must be a number for well/;
# test assay result upload with complete data
ok my $test_file3 = File::Temp->new or die('Could not create temp test file ' . $!);
View
45 t/50-model-plugin-well.t
@@ -14,6 +14,7 @@ use Try::Tiny;
use DateTime;
use Data::Dumper;
use YAML::Any qw(DumpFile);
+use Hash::MoreUtils qw( slice_def );
my $well_data= test_data( 'well.yaml' );
@@ -390,7 +391,7 @@ lives_ok {
genotyping_result_type_id => 'loacrit',
call => 'fa',
created_by => 'test_user@example.org' };
-
+
ok my $result = model->create_well_genotyping_result( $result_input ) , 'genotyping_results fa call - created successfully' ;
is $result->call, 'fa', 'new result has expected call';
is $result->genotyping_result_type_id, 'loacrit', 'new result has expected assay type';
@@ -409,7 +410,7 @@ lives_ok {
is $genotyping_result->call, 'pass', '..updated call attribute is now pass';
is $genotyping_result->copy_number, '2.4', '..updated copy_number attribute is now 2.4';
is $genotyping_result->copy_number_range, '0.2', '..updated copy_number_range is now 0.2';
-
+
ok $genotyping_result = model->update_or_create_well_genotyping_result( { plate_name => 'MOHFAQ0001_A_2' , well_name => 'D04',
genotyping_result_type_id => 'loacrit',
call => 'fail',
@@ -435,7 +436,7 @@ lives_ok {
ok $chromosome_fail = model->update_or_create_well_chromosome_fail( { plate_name => 'MOHFAQ0001_A_2' , well_name => 'D04', result => '4' , created_by => 'test_user@example.org' } ), 'can update chromosome fail well result';
is $chromosome_fail->result, '4', '..updated result is now 4';
-
+
lives_ok {
model->delete_well_chromosome_fail( { plate_name =>'MOHFAQ0001_A_2', well_name => 'D04' } )
} 'delete well chromosome fail result';
@@ -449,6 +450,44 @@ lives_ok {
is $well->id, $new_chromosome_fail->well_id , '.. and chromosome_fail result is for right well';
}
+{
+ note( "has_dre_been_applied" );
+
+ my $params = { plate_name =>'1000', well_name => 'A01', genotyping_result_type_id => 'puro', call => 'fail' };
+ ok model->has_dre_been_applied( $params ), 'remove Dre to well for Cre project';
+ my @recombinases = model->retrieve_well({ plate_name =>'1000', well_name => 'A01' })->recombinases;
+ foreach my $rec (@{$recombinases[0]}){
+ isnt $rec, 'Dre', '.. does not have Dre recombinase';
+ }
+
+ $params = { plate_name =>'1000', well_name => 'A01', genotyping_result_type_id => 'loacrit', call => 'pass' };
+ ok model->has_dre_been_applied( $params ), 'Only add Dre to well for Cre project when genotyping_result_id is puro';
+ @recombinases = model->retrieve_well({ plate_name =>'1000', well_name => 'A01' })->recombinases;
+ foreach my $rec (@{$recombinases[0]}){
+ isnt $rec, 'Dre', '.. does not have Dre recombinase';
+ }
+
+ $params = { plate_name =>'997', well_name => 'A01', genotyping_result_type_id => 'puro', call => 'pass' };
+ ok model->has_dre_been_applied( $params ), 'fail to add Dre to well for Cre project when plate type is not EP_PICK';
+ @recombinases = model->retrieve_well({ plate_name =>'997', well_name => 'A01' })->recombinases;
+ foreach my $rec (@{$recombinases[0]}){
+ isnt $rec, 'Dre', '.. does not have Dre recombinase';
+ }
+
+ $params = { plate_name =>'MOHFAQ0001_A_2', well_name => 'D04', genotyping_result_type_id => 'puro', call => 'pass' };
+ ok model->has_dre_been_applied( $params ), 'Do nothing for non Cre project';
+ @recombinases = model->retrieve_well({ plate_name =>'MOHFAQ0001_A_2', well_name => 'A04' })->recombinases;
+ foreach my $rec (@{$recombinases[0]}){
+ isnt $rec, 'Dre', '.. does not have Dre recombinase';
+ }
+
+
+ $params = { plate_name =>'1000', well_name => 'A01', genotyping_result_type_id => 'puro', call => 'pass' };
+ ok model->has_dre_been_applied( $params ), 'can add Dre to well for Cre project';
+ @recombinases = model->retrieve_well({ plate_name =>'1000', well_name => 'A01' })->recombinases;
+ is $recombinases[0][-1], 'Dre', '.. has Dre recombinase';
+
+}
note( "Add colony counts to a well" );
{
View
1  t/fixtures/00-clean-db.sql
@@ -58,6 +58,7 @@ DELETE FROM plate_types;
DELETE FROM recombinases;
DELETE FROM recombineering_result_types;
DELETE FROM cassettes;
+DELETE FROM cassette_function;
DELETE FROM backbones;
DELETE FROM species_default_assembly;
DELETE FROM assemblies;
View
12 t/fixtures/10-load-fixture-data.sql
@@ -991,6 +991,13 @@ INSERT INTO backbones VALUES (1859, 'L4L3_pD223_DTA_spec', 'INVERTED R3 and R4 G
-- Data for Name: cassette_function; Type: TABLE DATA; Schema: public; Owner: lims2_test_admin
--
+INSERT INTO cassette_function VALUES ('ko_first', NULL, true, NULL, NULL, true);
+INSERT INTO cassette_function VALUES ('ko_first_promoter', true, true, NULL, NULL, true);
+INSERT INTO cassette_function VALUES ('ko_first_promoterless', false, true, NULL, NULL, true);
+INSERT INTO cassette_function VALUES ('reporter_only', NULL, true, NULL, true, NULL);
+INSERT INTO cassette_function VALUES ('reporter_only_promoter', true, true, NULL, true, NULL);
+INSERT INTO cassette_function VALUES ('reporter_only_promoterless', false, true, NULL, true, NULL);
+INSERT INTO cassette_function VALUES ('cre_knock_in', NULL, NULL, true, NULL, NULL);
--
@@ -1017,7 +1024,7 @@ INSERT INTO cassettes VALUES (10475, 'pL1L2_GTK_nEGFPO_T2A_CreERT_puro', '', fal
INSERT INTO cassettes VALUES (10418, 'Ifitm2_intron_L1L2_GT2_LF2A_LacZ_BetactP_neo', '', true, 'Ifitm2_intron_L1L2_GT?_LF2A_LacZ_BetactP_neo', 2, true, false);
INSERT INTO cassettes VALUES (10421, 'L1L2_GT0_LacZ_BSD', '', false, 'L1L2_GT?_LacZ_BSD', NULL, true, false);
INSERT INTO cassettes VALUES (10422, 'L1L2_GT2_LF2A_LacZ_BetactP_neo', '', true, 'L1L2_GT?_LF2A_LacZ_BetactP_neo', 2, true, false);
-INSERT INTO cassettes VALUES (10447, 'pR6K_R1R2_ZP', 'Standard intermediate vector cassette', false, NULL, NULL, false, false);
+INSERT INTO cassettes VALUES (10447, 'pR6K_R1R2_ZP', 'Standard intermediate vector cassette', false, NULL, NULL, false, true);
INSERT INTO cassettes VALUES (10448, 'L1L2_hubi_P', '', true, NULL, NULL, false, false);
INSERT INTO cassettes VALUES (10449, 'L1L2_GOHANU', '', true, NULL, NULL, false, false);
INSERT INTO cassettes VALUES (10450, 'L1L2_Pgk_PM', 'PGK promoter driving mutant neo. Frame indendent IRES driven lacZ reporter', true, NULL, NULL, false, false);
@@ -9680,7 +9687,7 @@ INSERT INTO process_recombinase VALUES (968, 'Cre', 1);
INSERT INTO process_recombinase VALUES (1071, 'Flp', 1);
INSERT INTO process_recombinase VALUES (1072, 'Flp', 1);
INSERT INTO process_recombinase VALUES (1073, 'Flp', 1);
-
+INSERT INTO process_recombinase VALUES (1281, 'Dre', 1);
--
-- Data for Name: sponsors; Type: TABLE DATA; Schema: public; Owner: lims2_test_admin
@@ -11427,4 +11434,3 @@ INSERT INTO well_recombineering_results VALUES (1320, 'rec_result', 'pass', '',
--
-- PostgreSQL database dump complete
--
-
Please sign in to comment.
Something went wrong with that request. Please try again.