From ca3166d26cadfc5036c4077d576994c3ac17991c Mon Sep 17 00:00:00 2001 From: Peter Keen Date: Thu, 17 Sep 2015 16:50:08 +0100 Subject: [PATCH 01/11] Added to Changes --- Changes | 2 ++ .../LIMS2/t/WebApp/Controller/User/CrisprPlateAppends.csv | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 root/static/test/fixtures/LIMS2/t/WebApp/Controller/User/CrisprPlateAppends.csv diff --git a/Changes b/Changes index 1d961b912c..7aa74fea3a 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,6 @@ {{$NEXT}} + Added create design and crispr plates function + Added experiments to summarys table 0.336 2015-09-03 12:59:33 Europe/London diff --git a/root/static/test/fixtures/LIMS2/t/WebApp/Controller/User/CrisprPlateAppends.csv b/root/static/test/fixtures/LIMS2/t/WebApp/Controller/User/CrisprPlateAppends.csv deleted file mode 100644 index 304f8271cd..0000000000 --- a/root/static/test/fixtures/LIMS2/t/WebApp/Controller/User/CrisprPlateAppends.csv +++ /dev/null @@ -1,2 +0,0 @@ -plate_id,append_id -9341,t7-barry From 3c58ce74b5ee6eee6b525cfc6439ae6797090eb7 Mon Sep 17 00:00:00 2001 From: Peter Keen Date: Thu, 17 Sep 2015 17:25:21 +0100 Subject: [PATCH 02/11] v0.337 Added create design and crispr plates function Added experiments to summarys table --- Changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changes b/Changes index 7aa74fea3a..4d96a4d5cb 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,6 @@ {{$NEXT}} + +0.337 2015-09-17 16:50:11 Europe/London Added create design and crispr plates function Added experiments to summarys table From 255e7c22e087b7dccb29d5bc9bf54d10af5c80d1 Mon Sep 17 00:00:00 2001 From: af11_sanger Date: Thu, 1 Oct 2015 12:26:07 +0100 Subject: [PATCH 03/11] v0.339 Cell line added to projects Experiments linked to genes rather than projects --- Changes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Changes b/Changes index 4d96a4d5cb..f12316c695 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ {{$NEXT}} +0.339 2015-10-01 11:50:37 Europe/London + + Cell line added to projects + Experiments linked to genes rather than projects + 0.337 2015-09-17 16:50:11 Europe/London Added create design and crispr plates function Added experiments to summarys table From 1526ee41dd2c664edf1bf10202ffdd51c0469b65 Mon Sep 17 00:00:00 2001 From: Peter Keen Date: Wed, 7 Oct 2015 14:24:32 +0100 Subject: [PATCH 04/11] Perlcritic fix --- Changes | 4 +++- bin/add_cell_lines_to_projects.pl | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Changes b/Changes index f12316c695..4f1faf7ed1 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ {{$NEXT}} - + Sequencing project 96 plate creation added + Download sequencing project xlsx added + Sequencing project view and create interfaces added 0.339 2015-10-01 11:50:37 Europe/London Cell line added to projects diff --git a/bin/add_cell_lines_to_projects.pl b/bin/add_cell_lines_to_projects.pl index b20633b122..91e3e8242d 100755 --- a/bin/add_cell_lines_to_projects.pl +++ b/bin/add_cell_lines_to_projects.pl @@ -113,8 +113,4 @@ sub sponsor_cell_line{ } return 'kolf'; -<<<<<<< HEAD } -======= -} ->>>>>>> devel From f0a40233293439f3ca5a98e641fcf06b55d47db8 Mon Sep 17 00:00:00 2001 From: Peter Keen Date: Wed, 7 Oct 2015 16:05:34 +0100 Subject: [PATCH 05/11] v0.340 Sequencing project 96 plate creation added Download sequencing project xlsx added Sequencing project view and create interfaces added --- Changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changes b/Changes index 4f1faf7ed1..4751a04545 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,6 @@ {{$NEXT}} + +0.340 2015-10-07 15:27:03 Europe/London Sequencing project 96 plate creation added Download sequencing project xlsx added Sequencing project view and create interfaces added From d89ba42e75632144402b4cfcece0f96f7fa647df Mon Sep 17 00:00:00 2001 From: Peter Keen Date: Thu, 8 Oct 2015 12:25:11 +0100 Subject: [PATCH 06/11] Changes made to data migration script --- bin/lims2_setup.sh | 1 + ddl/versions/101/audit-up.sql | 25 ++++++++++++++++++++++++- ddl/versions/101/up.sql | 5 ++--- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/bin/lims2_setup.sh b/bin/lims2_setup.sh index 3894075512..9c439c3ecd 100755 --- a/bin/lims2_setup.sh +++ b/bin/lims2_setup.sh @@ -270,6 +270,7 @@ LIMS2 useful environment variables: \$PGUSER : $PGUSER \$LIMS2_PRIMER_DIR : $LIMS2_PRIMER_DIR +\$LIMS2_SEQ_DIR : $LIMS2_SEQ_DIR \$DEFAULT_CRISPR_ES_QC_DIR : $DEFAULT_CRISPR_ES_QC_DIR \$VEP_CACHE_DIR : $VEP_CACHE_DIR \$DESIGN_CREATION_HUMAN_FA : $DESIGN_CREATION_HUMAN_FA diff --git a/ddl/versions/101/audit-up.sql b/ddl/versions/101/audit-up.sql index 3531299467..f0cce4a44b 100644 --- a/ddl/versions/101/audit-up.sql +++ b/ddl/versions/101/audit-up.sql @@ -5,7 +5,6 @@ audit_stamp TIMESTAMP NOT NULL, audit_txid INTEGER NOT NULL, id integer, name text, -qc_template_id integer, created_by_id integer, created_at timestamp without time zone, sub_projects integer, @@ -54,6 +53,30 @@ $sequencing_project_primers_audit$ LANGUAGE plpgsql; CREATE TRIGGER sequencing_project_primers_audit AFTER INSERT OR UPDATE OR DELETE ON public.sequencing_project_primers FOR EACH ROW EXECUTE PROCEDURE public.process_sequencing_project_primers_audit(); +CREATE TABLE audit.sequencing_project_templates ( +audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')), +audit_user TEXT NOT NULL, +audit_stamp TIMESTAMP NOT NULL, +audit_txid INTEGER NOT NULL, +seq_project_id integer, +qc_template_id integer +); +CREATE OR REPLACE FUNCTION public.process_sequencing_project_templates_audit() +RETURNS TRIGGER AS $sequencing_project_templates_audit$ + BEGIN + IF (TG_OP = 'DELETE') THEN + INSERT INTO audit.sequencing_project_templates SELECT 'D', user, now(), txid_current(), OLD.*; + ELSIF (TG_OP = 'UPDATE') THEN + INSERT INTO audit.sequencing_project_templates SELECT 'U', user, now(), txid_current(), NEW.*; + ELSIF (TG_OP = 'INSERT') THEN + INSERT INTO audit.sequencing_project_templates SELECT 'I', user, now(), txid_current(), NEW.*; + END IF; + RETURN NULL; + END; +$sequencing_project_templates_audit$ LANGUAGE plpgsql; +CREATE TRIGGER sequencing_project_templates_audit +AFTER INSERT OR UPDATE OR DELETE ON public.sequencing_project_templates + FOR EACH ROW EXECUTE PROCEDURE public.process_sequencing_project_templates_audit(); CREATE TABLE audit.sequencing_primer_types ( audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')), audit_user TEXT NOT NULL, diff --git a/ddl/versions/101/up.sql b/ddl/versions/101/up.sql index ac078b7dd2..32d71e4dff 100644 --- a/ddl/versions/101/up.sql +++ b/ddl/versions/101/up.sql @@ -10,6 +10,8 @@ CREATE TABLE sequencing_projects( abandoned boolean default false, is_384 boolean default false); +CREATE TABLE sequencing_primer_types( id text primary key not null ); + CREATE TABLE sequencing_project_primers( seq_project_id integer references sequencing_projects(id) not null, primer_id text references sequencing_primer_types(id) not null); @@ -17,6 +19,3 @@ CREATE TABLE sequencing_project_primers( CREATE TABLE sequencing_project_templates( seq_project_id integer references sequencing_projects(id) not null, qc_template_id integer references qc_templates(id) not null); - - -CREATE TABLE sequencing_primer_types( id text primary key not null ); From ce9c5fb22b07eee2c8974c959720092033764ca8 Mon Sep 17 00:00:00 2001 From: Peter Keen Date: Thu, 8 Oct 2015 13:11:34 +0100 Subject: [PATCH 07/11] Added sequencing project tables to fixtures file --- root/static/test/fixtures/00-clean-db.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/root/static/test/fixtures/00-clean-db.sql b/root/static/test/fixtures/00-clean-db.sql index 8832c615f2..af8c955c1a 100644 --- a/root/static/test/fixtures/00-clean-db.sql +++ b/root/static/test/fixtures/00-clean-db.sql @@ -51,8 +51,12 @@ DELETE FROM qc_template_well_cassette; DELETE FROM qc_template_well_backbone; DELETE FROM qc_template_well_recombinase; DELETE FROM qc_template_wells; +DELETE FROM sequencing_project_templates; DELETE FROM qc_templates; DELETE FROM qc_eng_seqs; +DELETE FROM sequencing_project_primers; +DELETE FROM sequencing_primer_types; +DELETE FROM sequencing_projects; DELETE FROM well_accepted_override; DELETE FROM well_comments; DELETE FROM well_chromosome_fail; From 04c2f11347a9a8ba25b291048a26b6d751e7dc49 Mon Sep 17 00:00:00 2001 From: Peter Keen Date: Thu, 8 Oct 2015 15:03:58 +0100 Subject: [PATCH 08/11] Added LIMS2-TEMP --- bin/lims2_setup.sh | 3 ++- ddl/versions/101/up.sql | 1 - lib/LIMS2/Model/Util/SequencingProject.pm | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/lims2_setup.sh b/bin/lims2_setup.sh index 9c439c3ecd..c7fa97f928 100755 --- a/bin/lims2_setup.sh +++ b/bin/lims2_setup.sh @@ -239,6 +239,7 @@ function lims2_devel { export SHARED_WEBAPP_TT_DIR=$LIMS2_SHARED/WebApp-Common/shared_templates export WGE_REST_CLIENT_CONFIG=/nfs/team87/farm3_lims2_vms/conf/wge-devel-rest-client.conf export LIMS2_PRIMER_DIR=/lustre/scratch109/sanger/team87/lims2_primer_generation/ + export LIMS2_TEMP=/opt/t87/local/tmp } function lims2_pg9.3 { @@ -270,7 +271,7 @@ LIMS2 useful environment variables: \$PGUSER : $PGUSER \$LIMS2_PRIMER_DIR : $LIMS2_PRIMER_DIR -\$LIMS2_SEQ_DIR : $LIMS2_SEQ_DIR +\$LIMS2_TEMP : $LIMS2_TEMP \$DEFAULT_CRISPR_ES_QC_DIR : $DEFAULT_CRISPR_ES_QC_DIR \$VEP_CACHE_DIR : $VEP_CACHE_DIR \$DESIGN_CREATION_HUMAN_FA : $DESIGN_CREATION_HUMAN_FA diff --git a/ddl/versions/101/up.sql b/ddl/versions/101/up.sql index 32d71e4dff..a56e7f7b89 100644 --- a/ddl/versions/101/up.sql +++ b/ddl/versions/101/up.sql @@ -1,7 +1,6 @@ CREATE TABLE sequencing_projects( id serial primary key not null, name text not null, - qc_template_id integer references qc_templates(id), created_by_id integer references users(id) not null, created_at timestamp without time zone default now() not null, sub_projects integer not null, diff --git a/lib/LIMS2/Model/Util/SequencingProject.pm b/lib/LIMS2/Model/Util/SequencingProject.pm index 720f894954..d2b857d53d 100644 --- a/lib/LIMS2/Model/Util/SequencingProject.pm +++ b/lib/LIMS2/Model/Util/SequencingProject.pm @@ -58,7 +58,8 @@ sub build_seq_data { else { return "Primers not found."; } - my $base = $ENV{ 'LIMS2_SEQ_DIR' } // '/var/tmp/seq/'; + my $base = $ENV{LIMS2_TEMP} + or die "LIMS2_TEMP not set"; my $body = read_file( $base . $file_name, {binmode => ':raw'} ); my $file_contents = ({ @@ -73,8 +74,8 @@ sub build_xlsx_file { my ($self, $c, $wells, $primer_name, $sub_num) = @_; my $project = $wells->{project_data}; my $file_name = $project->{name} . '_' . $sub_num . '_' . $primer_name . '.xlsx'; - - my $base = $ENV{ 'LIMS2_SEQ_DIR' } // '/var/tmp/seq/'; + my $base = $ENV{LIMS2_TEMP} + or die "LIMS2_TEMP not set"; my $workbook = Excel::Writer::XLSX->new( $base . $file_name ); my $worksheet = $workbook->add_worksheet(); From 58fecf0023e2142cd6c69dd9063c9ed7111580a2 Mon Sep 17 00:00:00 2001 From: Peter Keen Date: Thu, 8 Oct 2015 16:01:51 +0100 Subject: [PATCH 09/11] v0.341 --- Changes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Changes b/Changes index 4751a04545..7ae64855c6 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ {{$NEXT}} +0.341 2015-10-08 15:18:51 Europe/London + 0.340 2015-10-07 15:27:03 Europe/London Sequencing project 96 plate creation added Download sequencing project xlsx added From 5ce367abe7625c0119c1df55255d024c45cc8fe8 Mon Sep 17 00:00:00 2001 From: Peter Keen Date: Thu, 8 Oct 2015 17:21:41 +0100 Subject: [PATCH 10/11] Env variable updated --- lib/LIMS2/Model/Util/SequencingProject.pm | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/LIMS2/Model/Util/SequencingProject.pm b/lib/LIMS2/Model/Util/SequencingProject.pm index 720f894954..ef6660b072 100644 --- a/lib/LIMS2/Model/Util/SequencingProject.pm +++ b/lib/LIMS2/Model/Util/SequencingProject.pm @@ -14,6 +14,9 @@ use namespace::autoclean; use Try::Tiny; use Excel::Writer::XLSX; use File::Slurp; +use Carp; +use Path::Class; +use MooseX::Types::Path::Class::MoreCoercions qw/AbsDir/; sub build_seq_data { my ( $self, $c, $id, $primer_req, $sub_number) = @_; @@ -58,8 +61,9 @@ sub build_seq_data { else { return "Primers not found."; } - my $base = $ENV{ 'LIMS2_SEQ_DIR' } // '/var/tmp/seq/'; - my $body = read_file( $base . $file_name, {binmode => ':raw'} ); + + my $dir = dir_build($file_name); + my $body = read_file( $dir, {binmode => ':raw'} ); my $file_contents = ({ body => $body, @@ -74,8 +78,9 @@ sub build_xlsx_file { my $project = $wells->{project_data}; my $file_name = $project->{name} . '_' . $sub_num . '_' . $primer_name . '.xlsx'; - my $base = $ENV{ 'LIMS2_SEQ_DIR' } // '/var/tmp/seq/'; - my $workbook = Excel::Writer::XLSX->new( $base . $file_name ); + my $dir = dir_build($file_name); + my $workbook = Excel::Writer::XLSX->new($dir); + my $worksheet = $workbook->add_worksheet(); #Create Headers @@ -94,5 +99,11 @@ sub build_xlsx_file { return $file_name; } +sub dir_build{ + my ($file_name) = @_; + my $base = $ENV{LIMS2_TEMP} + or die "LIMS2_TEMP not set"; + return $base . '/' . $file_name; +} 1; From 54a70b0eb7cc4cd4d73f9961b11dad4aaa6ee037 Mon Sep 17 00:00:00 2001 From: Tiago Grego Date: Fri, 9 Oct 2015 15:25:18 +0100 Subject: [PATCH 11/11] Added plate link on es_qc_runs page --- root/site/user/crisprqc/crispr_es_qc_runs.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/site/user/crisprqc/crispr_es_qc_runs.tt b/root/site/user/crisprqc/crispr_es_qc_runs.tt index 003cd23030..4a97615916 100644 --- a/root/site/user/crisprqc/crispr_es_qc_runs.tt +++ b/root/site/user/crisprqc/crispr_es_qc_runs.tt @@ -16,7 +16,7 @@ [% FOR run IN runs %] [% run.id.substr(0, 8) %] - [% run.plate_name %] + [% run.plate_name %] [% run.sequencing_project %] [% IF run.validated %]