Skip to content

Commit

Permalink
Merge pull request #161 from wtsi-npg/devel
Browse files Browse the repository at this point in the history
pull from devel to master to create release 6.14.0
  • Loading branch information
mgcam authored Apr 12, 2021
2 parents 52386d7 + f85fd61 commit 2b0e208
Show file tree
Hide file tree
Showing 6 changed files with 321 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
LIST OF CHANGES
---------------

release 6.14.0
- add iseq_run table to enable
a direct join between the iseq_flowcell ad iseq_run_status tables;
to provide information about the run folder name
- add hifi related columns to pac_bio_run_well_metrics table

release 6.13.0
- add tables pac_bio_run_well_metrics and pac_bio_product_metrics
to store metrics extracted from PacBio's SMRT Link LIMS
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ lib/WTSI/DNAP/Warehouse/Schema/Result/IseqHeronProductMetric.pm
lib/WTSI/DNAP/Warehouse/Schema/Result/IseqExternalProductMetric.pm
lib/WTSI/DNAP/Warehouse/Schema/Result/IseqExternalProductComponent.pm
lib/WTSI/DNAP/Warehouse/Schema/Result/IseqProductComponent.pm
lib/WTSI/DNAP/Warehouse/Schema/Result/IseqRun.pm
lib/WTSI/DNAP/Warehouse/Schema/Result/IseqRunLaneMetric.pm
lib/WTSI/DNAP/Warehouse/Schema/Result/IseqRunStatus.pm
lib/WTSI/DNAP/Warehouse/Schema/Result/IseqRunStatusDict.pm
Expand All @@ -37,6 +38,7 @@ t/00-distribution.t
t/00-pod.t
t/10-Schema.t
t/10-Schema-IseqExternalProductMetric.t
t/10-Schema-IseqRun.t
t/20-Schema-Query-IseqFlowcell.t
t/20-Schema-Query-LibraryDigest.t
t/data/fixtures/00-IseqRunStatusDict.yml
Expand Down
165 changes: 165 additions & 0 deletions lib/WTSI/DNAP/Warehouse/Schema/Result/IseqRun.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@

package WTSI::DNAP::Warehouse::Schema::Result::IseqRun;

# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE

=head1 NAME
WTSI::DNAP::Warehouse::Schema::Result::IseqRun
=head1 DESCRIPTION
Table linking run and flowcell identities with the run folder name
=cut

use strict;
use warnings;

use Moose;
use MooseX::NonMoose;
use MooseX::MarkAsMethods autoclean => 1;
extends 'DBIx::Class::Core';

=head1 COMPONENTS LOADED
=over 4
=item * L<DBIx::Class::InflateColumn::DateTime>
=back
=cut

__PACKAGE__->load_components('InflateColumn::DateTime');

=head1 TABLE: C<iseq_run>
=cut

__PACKAGE__->table('iseq_run');

=head1 ACCESSORS
=head2 id_run
data_type: 'integer'
extra: {unsigned => 1}
is_nullable: 0
NPG run identifier
=head2 id_flowcell_lims
data_type: 'varchar'
is_nullable: 1
size: 20
LIMS specific flowcell id
=head2 folder_name
data_type: 'varchar'
is_nullable: 1
size: 64
Runfolder name
=cut

__PACKAGE__->add_columns(
'id_run',
{ data_type => 'integer', extra => { unsigned => 1 }, is_nullable => 0 },
'id_flowcell_lims',
{ data_type => 'varchar', is_nullable => 1, size => 20 },
'folder_name',
{ data_type => 'varchar', is_nullable => 1, size => 64 },
);

=head1 PRIMARY KEY
=over 4
=item * L</id_run>
=back
=cut

__PACKAGE__->set_primary_key('id_run');


# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-04-06 11:14:56
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZXwdsjfvNYCPvDydZNVf5w


# You can replace this text with custom code or comments, and it will be preserved on regeneration

our $VERSION = '0';

__PACKAGE__->meta->make_immutable;
1;
__END__
=head1 SYNOPSIS
=head1 DESCRIPTION
Result class definition in DBIx binding for the multi-lims warehouse database.
=head1 DIAGNOSTICS
=head1 CONFIGURATION AND ENVIRONMENT
=head1 SUBROUTINES/METHODS
=head1 DEPENDENCIES
=over
=item strict
=item warnings
=item Moose
=item MooseX::NonMoose
=item MooseX::MarkAsMethods
=item DBIx::Class::Core
=item DBIx::Class::InflateColumn::DateTime
=back
=head1 INCOMPATIBILITIES
=head1 BUGS AND LIMITATIONS
=head1 AUTHOR
Michael Kubiak E<lt>[email protected]E<gt>
=head1 LICENSE AND COPYRIGHT
Copyright (C) 2021 Genome Research Limited
This file is part of the ml_warehouse package L<https://github.com/wtsi-npg/ml_warehouse>.
NPG is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
=cut
94 changes: 92 additions & 2 deletions lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioRunWellMetric.pm
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,78 @@ The percentage of pre-filter ZMWs which have observed inserts of 0-10 bp
The percentage of pre-filter ZMWs which have observed inserts of 11-100 bp
=head2 hifi_read_bases
data_type: 'bigint'
extra: {unsigned => 1}
is_nullable: 1
The number of HiFi bases
=head2 hifi_num_reads
data_type: 'integer'
extra: {unsigned => 1}
is_nullable: 1
The number of HiFi reads
=head2 hifi_read_length_mean
data_type: 'integer'
extra: {unsigned => 1}
is_nullable: 1
The mean HiFi read length
=head2 hifi_read_quality_median
data_type: 'smallint'
extra: {unsigned => 1}
is_nullable: 1
The median HiFi base quality
=head2 hifi_number_passes_mean
data_type: 'integer'
extra: {unsigned => 1}
is_nullable: 1
The mean number of passes per HiFi read
=head2 hifi_low_quality_read_bases
data_type: 'bigint'
extra: {unsigned => 1}
is_nullable: 1
The number of HiFi bases filtered due to low quality (<Q20)
=head2 hifi_low_quality_num_reads
data_type: 'integer'
extra: {unsigned => 1}
is_nullable: 1
The number of HiFi reads filtered due to low quality (<Q20)
=head2 hifi_low_quality_read_length_mean
data_type: 'integer'
extra: {unsigned => 1}
is_nullable: 1
The mean length of HiFi reads filtered due to low quality (<Q20)
=head2 hifi_low_quality_read_quality_median
data_type: 'smallint'
extra: {unsigned => 1}
is_nullable: 1
The median base quality of HiFi bases filtered due to low quality (<Q20)
=cut

__PACKAGE__->add_columns(
Expand Down Expand Up @@ -381,6 +453,24 @@ __PACKAGE__->add_columns(
is_nullable => 1,
size => [5, 2],
},
'hifi_read_bases',
{ data_type => 'bigint', extra => { unsigned => 1 }, is_nullable => 1 },
'hifi_num_reads',
{ data_type => 'integer', extra => { unsigned => 1 }, is_nullable => 1 },
'hifi_read_length_mean',
{ data_type => 'integer', extra => { unsigned => 1 }, is_nullable => 1 },
'hifi_read_quality_median',
{ data_type => 'smallint', extra => { unsigned => 1 }, is_nullable => 1 },
'hifi_number_passes_mean',
{ data_type => 'integer', extra => { unsigned => 1 }, is_nullable => 1 },
'hifi_low_quality_read_bases',
{ data_type => 'bigint', extra => { unsigned => 1 }, is_nullable => 1 },
'hifi_low_quality_num_reads',
{ data_type => 'integer', extra => { unsigned => 1 }, is_nullable => 1 },
'hifi_low_quality_read_length_mean',
{ data_type => 'integer', extra => { unsigned => 1 }, is_nullable => 1 },
'hifi_low_quality_read_quality_median',
{ data_type => 'smallint', extra => { unsigned => 1 }, is_nullable => 1 },
);

=head1 PRIMARY KEY
Expand Down Expand Up @@ -434,8 +524,8 @@ __PACKAGE__->has_many(
);


# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-02-09 11:33:17
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JKlma3/ifTMBR3rHhKmq0w
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-04-07 10:40:31
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Y7TFGmU6HzyUN/sRCpre6w

our $VERSION = '0';

Expand Down
30 changes: 30 additions & 0 deletions scripts/update_schema_6.14.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
DROP TABLE IF EXISTS `iseq_run`;
CREATE TABLE `iseq_run` (
`id_run` int(10) unsigned NOT NULL COMMENT 'NPG run identifier',
`id_flowcell_lims` varchar(20) DEFAULT NULL COMMENT 'LIMS specific flowcell id',
`folder_name` varchar(64) DEFAULT NULL COMMENT 'Runfolder name',
PRIMARY KEY (`id_run`),
KEY `iseq_run_id_flowcell_lims` (`id_flowcell_lims`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci\
COMMENT 'Table linking run and flowcell identities with the run folder name';


alter table pac_bio_run_well_metrics \
add column hifi_read_bases \
bigint unsigned DEFAULT NULL COMMENT 'The number of HiFi bases' after short_insert_percent, \
add column hifi_num_reads \
int unsigned DEFAULT NULL COMMENT 'The number of HiFi reads' after hifi_read_bases, \
add column hifi_read_length_mean \
int unsigned DEFAULT NULL COMMENT 'The mean HiFi read length' after hifi_num_reads , \
add column hifi_read_quality_median \
smallint unsigned DEFAULT NULL COMMENT 'The median HiFi base quality' after hifi_read_length_mean, \
add column hifi_number_passes_mean \
int unsigned DEFAULT NULL COMMENT 'The mean number of passes per HiFi read' after hifi_read_quality_median, \
add column hifi_low_quality_read_bases \
bigint unsigned DEFAULT NULL COMMENT 'The number of HiFi bases filtered due to low quality (<Q20)' after hifi_number_passes_mean, \
add column hifi_low_quality_num_reads \
int unsigned DEFAULT NULL COMMENT 'The number of HiFi reads filtered due to low quality (<Q20)' after hifi_low_quality_read_bases, \
add column hifi_low_quality_read_length_mean \
int unsigned DEFAULT NULL COMMENT 'The mean length of HiFi reads filtered due to low quality (<Q20)' after hifi_low_quality_num_reads, \
add column hifi_low_quality_read_quality_median \
smallint unsigned DEFAULT NULL COMMENT 'The median base quality of HiFi bases filtered due to low quality (<Q20)' after hifi_low_quality_read_length_mean;
26 changes: 26 additions & 0 deletions t/10-Schema-IseqRun.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
use strict;
use warnings;
use Test::More tests => 7;
use Test::Exception;

use_ok('WTSI::DNAP::Warehouse::Schema');

my $schema;
lives_ok { $schema = WTSI::DNAP::Warehouse::Schema->connect('dbi:SQLite:dbname=:memory:') }
'connected to test in-memory database';
lives_ok { $schema->deploy() } 'schema deployed';

my $rs_run = $schema->resultset('IseqRun');

lives_ok { $rs_run->create({id_run => 34726, folder_name => '34726_RUN_FOLDER_8374', id_flowcell_lims => 3847}) }
'inserted non-null values';

is_deeply(\{$rs_run->find(34726)->get_columns},
\{id_run => 34726, folder_name => '34726_RUN_FOLDER_8374', id_flowcell_lims => 3847},
'retrieved a row');

lives_ok { $rs_run->create({id_run => 80364, id_flowcell_lims => 3}) }
'inserted null value into folder_name column';

lives_ok { $rs_run->find(80364)->update({folder_name => '80364_RUN_FOLDER_8272', id_flowcell_lims => 8372}) }
'updated values of a row';

0 comments on commit 2b0e208

Please sign in to comment.