Skip to content

Commit

Permalink
Merge branch 'devel' into view_traces_manousos
Browse files Browse the repository at this point in the history
  • Loading branch information
af11-sanger committed Oct 12, 2015
2 parents 47d1a4d + 54a70b0 commit 5a5ca72
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 16 deletions.
15 changes: 15 additions & 0 deletions Changes
@@ -1,5 +1,20 @@
{{$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
Sequencing project view and create interfaces added
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

0.336 2015-09-03 12:59:33 Europe/London

Removed dependancy on lustre file system
Expand Down
4 changes: 0 additions & 4 deletions bin/add_cell_lines_to_projects.pl
Expand Up @@ -113,8 +113,4 @@ sub sponsor_cell_line{
}

return 'kolf';
<<<<<<< HEAD
}
=======
}
>>>>>>> devel
2 changes: 2 additions & 0 deletions bin/lims2_setup.sh
Expand Up @@ -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 {
Expand Down Expand Up @@ -270,6 +271,7 @@ LIMS2 useful environment variables:
\$PGUSER : $PGUSER
\$LIMS2_PRIMER_DIR : $LIMS2_PRIMER_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
Expand Down
25 changes: 24 additions & 1 deletion ddl/versions/101/audit-up.sql
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 2 additions & 4 deletions 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,
Expand All @@ -10,13 +9,12 @@ 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);

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 );
19 changes: 15 additions & 4 deletions lib/LIMS2/Model/Util/SequencingProject.pm
Expand Up @@ -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) = @_;
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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;
2 changes: 1 addition & 1 deletion root/site/user/crisprqc/crispr_es_qc_runs.tt
Expand Up @@ -16,7 +16,7 @@
[% FOR run IN runs %]
<tr>
<td><a href="[% c.uri_for('es_qc_run', run.id) %]">[% run.id.substr(0, 8) %]</a></td>
<td>[% run.plate_name %]</dt>
<td><a href="[% c.uri_for('/user/view_plate', { name => run.plate_name}) %]">[% run.plate_name %]</a></dt>
<td>[% run.sequencing_project %]</td>
<td>
[% IF run.validated %]
Expand Down
4 changes: 4 additions & 0 deletions root/static/test/fixtures/00-clean-db.sql
Expand Up @@ -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;
Expand Down

This file was deleted.

0 comments on commit 5a5ca72

Please sign in to comment.