diff --git a/Changes b/Changes index 61eac87..ea5a987 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,10 @@ LIST OF CHANGES --------------- +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 + release 6.12.0 - a new iseq_product_ampliconstats table to store per sample per amplicon statistics that is generated by 'samtools diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioProductMetric.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioProductMetric.pm new file mode 100644 index 0000000..3617cfb --- /dev/null +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioProductMetric.pm @@ -0,0 +1,193 @@ + +package WTSI::DNAP::Warehouse::Schema::Result::PacBioProductMetric; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +WTSI::DNAP::Warehouse::Schema::Result::PacBioProductMetric + +=head1 DESCRIPTION + +A linking table for the pac_bio_run and pac_bio_run_well_metrics tables with a potential for adding per-product QC data + +=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 + +=back + +=cut + +__PACKAGE__->load_components('InflateColumn::DateTime'); + +=head1 TABLE: C + +=cut + +__PACKAGE__->table('pac_bio_product_metrics'); + +=head1 ACCESSORS + +=head2 id_pac_bio_pr_metrics_tmp + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 id_pac_bio_rw_metrics_tmp + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +PacBio run well metrics id, see 'pac_bio_run_well_metrics.id_pac_bio_rw_metrics_tmp' + +=head2 id_pac_bio_tmp + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +PacBio run id, see 'pac_bio_run.id_pac_bio_tmp' + +=cut + +__PACKAGE__->add_columns( + 'id_pac_bio_pr_metrics_tmp', + { data_type => 'integer', is_auto_increment => 1, is_nullable => 0 }, + 'id_pac_bio_rw_metrics_tmp', + { data_type => 'integer', is_foreign_key => 1, is_nullable => 0 }, + 'id_pac_bio_tmp', + { data_type => 'integer', is_foreign_key => 1, is_nullable => 1 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key('id_pac_bio_pr_metrics_tmp'); + +=head1 RELATIONS + +=head2 pac_bio + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + 'pac_bio', + 'WTSI::DNAP::Warehouse::Schema::Result::PacBioRun', + { id_pac_bio_tmp => 'id_pac_bio_tmp' }, + { + is_deferrable => 1, + join_type => 'LEFT', + on_delete => 'SET NULL', + on_update => 'NO ACTION', + }, +); + +=head2 pac_bio_rw_metrics + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + 'pac_bio_rw_metrics', + 'WTSI::DNAP::Warehouse::Schema::Result::PacBioRunWellMetric', + { id_pac_bio_rw_metrics_tmp => 'id_pac_bio_rw_metrics_tmp' }, + { is_deferrable => 1, on_delete => 'CASCADE', on_update => 'NO ACTION' }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-02-09 11:33:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ea+iVDOfptyUAPyi3Otvyg + +our $VERSION = '0'; + +__PACKAGE__->meta->make_immutable; +1; + +=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 + +=head1 LICENSE AND COPYRIGHT + +Copyright (C) 2021 Genome Research Limited + +This file is part of the ml_warehouse package L. + +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 . + +=cut diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioRun.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioRun.pm index a3df2f0..df65bfb 100644 --- a/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioRun.pm +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioRun.pm @@ -142,6 +142,30 @@ LIMs-specific identifier of the tag set for tag WTSI-wide tag set name for tag +=head2 tag2_sequence + + data_type: 'varchar' + is_nullable: 1 + size: 30 + +=head2 tag2_set_id_lims + + data_type: 'varchar' + is_nullable: 1 + size: 20 + +=head2 tag2_set_name + + data_type: 'varchar' + is_nullable: 1 + size: 100 + +=head2 tag2_identifier + + data_type: 'varchar' + is_nullable: 1 + size: 30 + =head2 plate_barcode data_type: 'varchar' @@ -268,6 +292,14 @@ __PACKAGE__->add_columns( { data_type => 'varchar', is_nullable => 1, size => 20 }, 'tag_set_name', { data_type => 'varchar', is_nullable => 1, size => 100 }, + 'tag2_sequence', + { data_type => 'varchar', is_nullable => 1, size => 30 }, + 'tag2_set_id_lims', + { data_type => 'varchar', is_nullable => 1, size => 20 }, + 'tag2_set_name', + { data_type => 'varchar', is_nullable => 1, size => 100 }, + 'tag2_identifier', + { data_type => 'varchar', is_nullable => 1, size => 30 }, 'plate_barcode', { data_type => 'varchar', is_nullable => 0, size => 255 }, 'plate_uuid_lims', @@ -308,6 +340,21 @@ __PACKAGE__->set_primary_key('id_pac_bio_tmp'); =head1 RELATIONS +=head2 pac_bio_product_metrics + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + 'pac_bio_product_metrics', + 'WTSI::DNAP::Warehouse::Schema::Result::PacBioProductMetric', + { 'foreign.id_pac_bio_tmp' => 'self.id_pac_bio_tmp' }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 sample Type: belongs_to @@ -339,8 +386,9 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-10 15:05:13 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dkAFMFOOZ7+MTrEn5sI6nQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-24 15:45:02 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eVqS5iL7i47o9VqosVsjTg + our $VERSION = '0'; diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioRunWellMetric.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioRunWellMetric.pm new file mode 100644 index 0000000..1fa285f --- /dev/null +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioRunWellMetric.pm @@ -0,0 +1,503 @@ + +package WTSI::DNAP::Warehouse::Schema::Result::PacBioRunWellMetric; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +WTSI::DNAP::Warehouse::Schema::Result::PacBioRunWellMetric + +=head1 DESCRIPTION + +Status and run information by well and some basic QC data from SMRT Link + +=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 + +=back + +=cut + +__PACKAGE__->load_components('InflateColumn::DateTime'); + +=head1 TABLE: C + +=cut + +__PACKAGE__->table('pac_bio_run_well_metrics'); + +=head1 ACCESSORS + +=head2 id_pac_bio_rw_metrics_tmp + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 pac_bio_run_name + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +Lims specific identifier for the pacbio run + +=head2 well_label + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +The well identifier for the plate, A1-H12 + +=head2 instrument_type + + data_type: 'varchar' + is_nullable: 0 + size: 32 + +The instrument type e.g. Sequel + +=head2 instrument_name + + data_type: 'varchar' + is_nullable: 1 + size: 32 + +The instrument name e.g. SQ54097 + +=head2 chip_type + + data_type: 'varchar' + is_nullable: 1 + size: 32 + +The chip type e.g. 8mChip + +=head2 ts_run_name + + data_type: 'varchar' + is_nullable: 1 + size: 32 + +The PacBio run name + +=head2 movie_name + + data_type: 'varchar' + is_nullable: 1 + size: 32 + +The PacBio movie name + +=head2 ccs_execution_mode + + data_type: 'varchar' + is_nullable: 1 + size: 32 + +The PacBio ccs exection mode e.g. OnInstument, OffInstument or None + +=head2 run_start + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +Timestamp of run started + +=head2 run_complete + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +Timestamp of run complete + +=head2 run_status + + data_type: 'varchar' + is_nullable: 1 + size: 32 + +Last recorded status, primarily to explain runs not completed. + +=head2 well_start + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +Timestamp of well started + +=head2 well_complete + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +Timestamp of well complete + +=head2 well_status + + data_type: 'varchar' + is_nullable: 1 + size: 32 + +Last recorded status, primarily to explain wells not completed. + +=head2 chemistry_sw_version + + data_type: 'varchar' + is_nullable: 1 + size: 32 + +The PacBio chemistry software version + +=head2 instrument_sw_version + + data_type: 'varchar' + is_nullable: 1 + size: 32 + +The PacBio instrument software version + +=head2 primary_analysis_sw_version + + data_type: 'varchar' + is_nullable: 1 + size: 32 + +The PacBio primary analysis software version + +=head2 polymerase_read_bases + + data_type: 'bigint' + extra: {unsigned => 1} + is_nullable: 1 + +Calculated by multiplying the number of productive (P1) ZMWs by the mean polymerase read length + +=head2 polymerase_num_reads + + data_type: 'integer' + extra: {unsigned => 1} + is_nullable: 1 + +The number of polymerase reads + +=head2 polymerase_read_length_mean + + data_type: 'integer' + extra: {unsigned => 1} + is_nullable: 1 + +The mean high-quality read length of all polymerase reads + +=head2 polymerase_read_length_n50 + + data_type: 'integer' + extra: {unsigned => 1} + is_nullable: 1 + +Fifty percent of the trimmed read length of all polymerase reads are longer than this value + +=head2 insert_length_mean + + data_type: 'integer' + extra: {unsigned => 1} + is_nullable: 1 + +The average subread length, considering only the longest subread from each ZMW + +=head2 insert_length_n50 + + data_type: 'integer' + extra: {unsigned => 1} + is_nullable: 1 + +Fifty percent of the subreads are longer than this value when considering only the longest subread from each ZMW + +=head2 unique_molecular_bases + + data_type: 'bigint' + extra: {unsigned => 1} + is_nullable: 1 + +The unique molecular yield in bp + +=head2 productive_zmws_num + + data_type: 'integer' + extra: {unsigned => 1} + is_nullable: 1 + +Number of productive ZMWs + +=head2 p0_num + + data_type: 'integer' + extra: {unsigned => 1} + is_nullable: 1 + +Number of empty ZMWs with no high quality read detected + +=head2 p1_num + + data_type: 'integer' + extra: {unsigned => 1} + is_nullable: 1 + +Number of ZMWs with a high quality read detected + +=head2 p2_num + + data_type: 'integer' + extra: {unsigned => 1} + is_nullable: 1 + +Number of other ZMWs, signal detected but no high quality read + +=head2 adapter_dimer_percent + + data_type: 'float' + extra: {unsigned => 1} + is_nullable: 1 + size: [5,2] + +The percentage of pre-filter ZMWs which have observed inserts of 0-10 bp + +=head2 short_insert_percent + + data_type: 'float' + extra: {unsigned => 1} + is_nullable: 1 + size: [5,2] + +The percentage of pre-filter ZMWs which have observed inserts of 11-100 bp + +=cut + +__PACKAGE__->add_columns( + 'id_pac_bio_rw_metrics_tmp', + { data_type => 'integer', is_auto_increment => 1, is_nullable => 0 }, + 'pac_bio_run_name', + { data_type => 'varchar', is_nullable => 0, size => 255 }, + 'well_label', + { data_type => 'varchar', is_nullable => 0, size => 255 }, + 'instrument_type', + { data_type => 'varchar', is_nullable => 0, size => 32 }, + 'instrument_name', + { data_type => 'varchar', is_nullable => 1, size => 32 }, + 'chip_type', + { data_type => 'varchar', is_nullable => 1, size => 32 }, + 'ts_run_name', + { data_type => 'varchar', is_nullable => 1, size => 32 }, + 'movie_name', + { data_type => 'varchar', is_nullable => 1, size => 32 }, + 'ccs_execution_mode', + { data_type => 'varchar', is_nullable => 1, size => 32 }, + 'run_start', + { + data_type => 'datetime', + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + 'run_complete', + { + data_type => 'datetime', + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + 'run_status', + { data_type => 'varchar', is_nullable => 1, size => 32 }, + 'well_start', + { + data_type => 'datetime', + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + 'well_complete', + { + data_type => 'datetime', + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + 'well_status', + { data_type => 'varchar', is_nullable => 1, size => 32 }, + 'chemistry_sw_version', + { data_type => 'varchar', is_nullable => 1, size => 32 }, + 'instrument_sw_version', + { data_type => 'varchar', is_nullable => 1, size => 32 }, + 'primary_analysis_sw_version', + { data_type => 'varchar', is_nullable => 1, size => 32 }, + 'polymerase_read_bases', + { data_type => 'bigint', extra => { unsigned => 1 }, is_nullable => 1 }, + 'polymerase_num_reads', + { data_type => 'integer', extra => { unsigned => 1 }, is_nullable => 1 }, + 'polymerase_read_length_mean', + { data_type => 'integer', extra => { unsigned => 1 }, is_nullable => 1 }, + 'polymerase_read_length_n50', + { data_type => 'integer', extra => { unsigned => 1 }, is_nullable => 1 }, + 'insert_length_mean', + { data_type => 'integer', extra => { unsigned => 1 }, is_nullable => 1 }, + 'insert_length_n50', + { data_type => 'integer', extra => { unsigned => 1 }, is_nullable => 1 }, + 'unique_molecular_bases', + { data_type => 'bigint', extra => { unsigned => 1 }, is_nullable => 1 }, + 'productive_zmws_num', + { data_type => 'integer', extra => { unsigned => 1 }, is_nullable => 1 }, + 'p0_num', + { data_type => 'integer', extra => { unsigned => 1 }, is_nullable => 1 }, + 'p1_num', + { data_type => 'integer', extra => { unsigned => 1 }, is_nullable => 1 }, + 'p2_num', + { data_type => 'integer', extra => { unsigned => 1 }, is_nullable => 1 }, + 'adapter_dimer_percent', + { + data_type => 'float', + extra => { unsigned => 1 }, + is_nullable => 1, + size => [5, 2], + }, + 'short_insert_percent', + { + data_type => 'float', + extra => { unsigned => 1 }, + is_nullable => 1, + size => [5, 2], + }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key('id_pac_bio_rw_metrics_tmp'); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint( + 'pac_bio_metrics_run_well', + ['pac_bio_run_name', 'well_label'], +); + +=head1 RELATIONS + +=head2 pac_bio_product_metrics + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + 'pac_bio_product_metrics', + 'WTSI::DNAP::Warehouse::Schema::Result::PacBioProductMetric', + { + 'foreign.id_pac_bio_rw_metrics_tmp' => 'self.id_pac_bio_rw_metrics_tmp', + }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-02-09 11:33:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JKlma3/ifTMBR3rHhKmq0w + +our $VERSION = '0'; + +__PACKAGE__->meta->make_immutable; +1; + +=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 + +=head1 LICENSE AND COPYRIGHT + +Copyright (C) 2021 Genome Research Limited + +This file is part of the ml_warehouse package L. + +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 . + +=cut + diff --git a/scripts/update_schema_6.13.0.sql b/scripts/update_schema_6.13.0.sql new file mode 100644 index 0000000..0006717 --- /dev/null +++ b/scripts/update_schema_6.13.0.sql @@ -0,0 +1,51 @@ +DROP TABLE IF EXISTS `pac_bio_run_well_metrics`; +CREATE TABLE `pac_bio_run_well_metrics` ( + `id_pac_bio_rw_metrics_tmp` int(11) NOT NULL AUTO_INCREMENT, + `pac_bio_run_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Lims specific identifier for the pacbio run', + `well_label` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'The well identifier for the plate, A1-H12', + `instrument_type` varchar(32) COLLATE utf8_unicode_ci NOT NULL COMMENT 'The instrument type e.g. Sequel', + `instrument_name` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The instrument name e.g. SQ54097', + `chip_type` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The chip type e.g. 8mChip', + `ts_run_name` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The PacBio run name', + `movie_name` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The PacBio movie name', + `ccs_execution_mode` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The PacBio ccs exection mode e.g. OnInstument, OffInstument or None', + `run_start` datetime DEFAULT NULL COMMENT 'Timestamp of run started', + `run_complete` datetime DEFAULT NULL COMMENT 'Timestamp of run complete', + `run_status` varchar(32) DEFAULT NULL COMMENT 'Last recorded status, primarily to explain runs not completed.', + `well_start` datetime DEFAULT NULL COMMENT 'Timestamp of well started', + `well_complete` datetime DEFAULT NULL COMMENT 'Timestamp of well complete', + `well_status` varchar(32) DEFAULT NULL COMMENT 'Last recorded status, primarily to explain wells not completed.', + `chemistry_sw_version` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The PacBio chemistry software version', + `instrument_sw_version` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The PacBio instrument software version', + `primary_analysis_sw_version` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'The PacBio primary analysis software version', + `polymerase_read_bases` bigint(20) unsigned DEFAULT NULL COMMENT 'Calculated by multiplying the number of productive (P1) ZMWs by the mean polymerase read length', + `polymerase_num_reads` int(10) unsigned DEFAULT NULL COMMENT 'The number of polymerase reads', + `polymerase_read_length_mean` int(10) unsigned DEFAULT NULL COMMENT 'The mean high-quality read length of all polymerase reads', + `polymerase_read_length_n50` int(10) unsigned DEFAULT NULL COMMENT 'Fifty percent of the trimmed read length of all polymerase reads are longer than this value', + `insert_length_mean` int(10) unsigned DEFAULT NULL COMMENT 'The average subread length, considering only the longest subread from each ZMW', + `insert_length_n50` int(10) unsigned DEFAULT NULL COMMENT 'Fifty percent of the subreads are longer than this value when considering only the longest subread from each ZMW', + `unique_molecular_bases` bigint(20) unsigned DEFAULT NULL COMMENT 'The unique molecular yield in bp', + `productive_zmws_num` int(10) unsigned DEFAULT NULL COMMENT 'Number of productive ZMWs', + `p0_num` int(10) unsigned DEFAULT NULL COMMENT 'Number of empty ZMWs with no high quality read detected', + `p1_num` int(10) unsigned DEFAULT NULL COMMENT 'Number of ZMWs with a high quality read detected', + `p2_num` int(10) unsigned DEFAULT NULL COMMENT 'Number of other ZMWs, signal detected but no high quality read', + `adapter_dimer_percent` float(5,2) unsigned DEFAULT NULL COMMENT 'The percentage of pre-filter ZMWs which have observed inserts of 0-10 bp', + `short_insert_percent` float(5,2) unsigned DEFAULT NULL COMMENT 'The percentage of pre-filter ZMWs which have observed inserts of 11-100 bp', + PRIMARY KEY (`id_pac_bio_rw_metrics_tmp`), + UNIQUE KEY `pac_bio_metrics_run_well` (`pac_bio_run_name`,`well_label`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 \ + COMMENT='Status and run information by well and some basic QC data from SMRT Link'; + +DROP TABLE IF EXISTS `pac_bio_product_metrics`; +CREATE TABLE `pac_bio_product_metrics` ( + `id_pac_bio_pr_metrics_tmp` int(11) NOT NULL AUTO_INCREMENT, + `id_pac_bio_rw_metrics_tmp` int(11) NOT NULL COMMENT 'PacBio run well metrics id, see "pac_bio_run_well_metrics.id_pac_bio_rw_metrics_tmp"', + `id_pac_bio_tmp` int(11) DEFAULT NULL COMMENT 'PacBio run id, see "pac_bio_run.id_pac_bio_tmp"', + PRIMARY KEY (`id_pac_bio_pr_metrics_tmp`), + KEY `pac_bio_pr_metrics_to_rwm_fk` (`id_pac_bio_rw_metrics_tmp`), + KEY `pac_bio_pr_metrics_to_run_fk` (`id_pac_bio_tmp`), + CONSTRAINT `pac_bio_product_metrics_to_rwm_fk` FOREIGN KEY (`id_pac_bio_rw_metrics_tmp`) REFERENCES `pac_bio_run_well_metrics` (`id_pac_bio_rw_metrics_tmp`) ON DELETE CASCADE ON UPDATE NO ACTION, + CONSTRAINT `pac_bio_product_metrics_to_run_fk` FOREIGN KEY (`id_pac_bio_tmp`) REFERENCES `pac_bio_run` (`id_pac_bio_tmp`) ON DELETE SET NULL ON UPDATE NO ACTION +) ENGINE=InnoDB DEFAULT CHARSET=utf8 \ + COMMENT='A linking table for the pac_bio_run and pac_bio_run_well_metrics tables with a potential for adding per-product QC data'; +