Skip to content

Commit

Permalink
Merge pull request #620 from wtsi-npg/devel
Browse files Browse the repository at this point in the history
prep for release 66.5
  • Loading branch information
dozy committed Jun 23, 2019
2 parents 44a21a8 + 85e35d4 commit 3d07290
Show file tree
Hide file tree
Showing 50 changed files with 1,999 additions and 113 deletions.
2 changes: 2 additions & 0 deletions Build.PL
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ my $requires = {
'URI::Escape' => 0,
'Vcf' => 0,

'WTSI::DNAP::Utilities::Timestamp' => 0,
'npg_common::Alignment' => 0,
'npg_common::extractor::fastq' => 0,
'npg_common::roles::software_location' => 0,
Expand All @@ -98,6 +99,7 @@ my $requires = {
'npg_tracking::illumina::runfolder' => 0,
'npg_tracking::Schema' => 0,
'npg_tracking::util::abs_path' => 0,
'npg_tracking::util::pipeline_config' => 0,
'npg_tracking::util::types' => 0,
'npg::util' => 0,
'st::api::base' => 0,
Expand Down
8 changes: 8 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
LIST OF CHANGES FOR NPG-QC PACKAGE

release 66.5
- update spatial_filter results parsing
- add target autosome stats to bam_flagstats qc check
- allow 'last_modified' date in mqc tables to be pre-set
- new autoqc check 'review' to evaluate results of other
checks against configurable criteria
- SeqQC: add a visual que for failed autoqc review results

release 66.4
- allow to finalise undecided library manual qc outcomes for
all entities
Expand Down
18 changes: 18 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ lib/npg_qc/autoqc/checks/insert_size.pm
lib/npg_qc/autoqc/checks/pulldown_metrics.pm
lib/npg_qc/autoqc/checks/qX_yield.pm
lib/npg_qc/autoqc/checks/ref_match.pm
lib/npg_qc/autoqc/checks/review.pm
lib/npg_qc/autoqc/checks/rna_seqc.pm
lib/npg_qc/autoqc/checks/samtools_stats.pm
lib/npg_qc/autoqc/checks/sequence_error.pm
Expand Down Expand Up @@ -62,6 +63,7 @@ lib/npg_qc/autoqc/results/pulldown_metrics.pm
lib/npg_qc/autoqc/results/qX_yield.pm
lib/npg_qc/autoqc/results/ref_match.pm
lib/npg_qc/autoqc/results/result.pm
lib/npg_qc/autoqc/results/review.pm
lib/npg_qc/autoqc/results/rna_seqc.pm
lib/npg_qc/autoqc/results/samtools_stats.pm
lib/npg_qc/autoqc/results/sequence_error.pm
Expand Down Expand Up @@ -207,6 +209,7 @@ t/60-autoqc-checks-insert_size.t
t/60-autoqc-checks-pulldown_metrics.t
t/60-autoqc-checks-qX_yield.t
t/60-autoqc-checks-ref_match.t
t/60-autoqc-checks-review.t
t/60-autoqc-checks-rna_seqc.t
t/60-autoqc-checks-sequence_error.t
t/60-autoqc-checks-spatial_filter.t
Expand Down Expand Up @@ -236,6 +239,7 @@ t/60-autoqc-results-pulldown_metrics.t
t/60-autoqc-results-qX_yield.t
t/60-autoqc-results-ref_match.t
t/60-autoqc-results-result.t
t/60-autoqc-results-review.t
t/60-autoqc-results-rna_seqc.t
t/60-autoqc-results-samtools_stats.t
t/60-autoqc-results-sequence_error.t
Expand All @@ -251,6 +255,8 @@ t/70-report-genotype_call.t
t/80-autoqc-qc-script.t
t/data/autoqc/bam_flagstats/16960_1_0.tar.gz
t/data/autoqc/bam_flagstats/17448_1_9.tar.gz
t/data/autoqc/bam_flagstats/25837_1_13.tar.gz
t/data/autoqc/bam_flagstats/29006_8_1.tar.gz
t/data/autoqc/bam_flagstats/24135_1#1.bam_flagstats.json
t/data/autoqc/bam_flagstats/24135_1#1.flagstat
t/data/autoqc/bam_flagstats/4783_5_bam_flagstats.json
Expand Down Expand Up @@ -470,6 +476,18 @@ t/data/autoqc/rendered/json_single_run/3612_7.insert_size.json
t/data/autoqc/rendered/json_single_run/3612_7.qX_yield.json
t/data/autoqc/rendered/json_single_run/3612_8.insert_size.json
t/data/autoqc/rendered/json_single_run/3612_8.qX_yield.json
t/data/autoqc/review/product_release.yml
t/data/autoqc/review/samplesheet_27483.csv
t/data/autoqc/review/samplesheet_29524.csv
t/data/autoqc/review/29524#2.composition.json
t/data/autoqc/review/29524#17.bam_flagstats.json
t/data/autoqc/review/29524#2.bam_flagstats.json
t/data/autoqc/review/29524#2.bcfstats.json
t/data/autoqc/review/29524#2.qX_yield.json
t/data/autoqc/review/29524#2.verify_bam_id.json
t/data/autoqc/review/29524#2_phix.bam_flagstats.json
t/data/autoqc/review/29524#3.bam_flagstats.json
t/data/autoqc/review/29524#7.bam_flagstats.json
t/data/autoqc/rna_seqc/data/17550_1#1.bam
t/data/autoqc/rna_seqc/data/17550_3#8.bam
t/data/autoqc/rna_seqc/samplesheet_17550.csv
Expand Down
53 changes: 49 additions & 4 deletions lib/npg_qc/Schema/Mqc/OutcomeDict.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ package npg_qc::Schema::Mqc::OutcomeDict;

use Moose::Role;
use Readonly;
use Carp;

our $VERSION = '0';

Readonly::Scalar my $FINAL => 'final';
Readonly::Scalar my $PRELIMINARY => 'preliminary';
Readonly::Scalar my $ACCEPTED => 'Accepted';
Readonly::Scalar my $REJECTED => 'Rejected';
Readonly::Scalar my $UNDECIDED => 'Undecided';

sub is_final_outcome_description {
my ($self, $desc) = @_;
Expand All @@ -20,12 +24,12 @@ sub is_final_outcome {

sub is_accepted {
my $self = shift;
return $self->short_desc =~ /\AAccepted/smx; #The short description includes the word accepted.
return $self->short_desc =~ /\A $ACCEPTED/smx; #The short description includes the word accepted.
}

sub is_rejected {
my $self = shift;
return $self->short_desc =~ /\ARejected/smx; #The short description includes the word rejected.
return $self->short_desc =~ /\A $REJECTED/smx; #The short description includes the word rejected.
}

sub is_final_accepted {
Expand All @@ -35,7 +39,7 @@ sub is_final_accepted {

sub is_undecided {
my $self = shift;
return $self->short_desc =~ /\AUndecided/smx;
return $self->short_desc =~ /\A $UNDECIDED/smx;
}

sub pk_value {
Expand All @@ -59,6 +63,19 @@ sub matching_final_short_desc {
return $desc;
}

sub generate_short_description {
my ($self, $is_final, $is_accepted) = @_;

defined $is_final or croak 'Final flag should be defined';
my $decision = $is_accepted ? $ACCEPTED :
(defined $is_accepted ? $REJECTED : $UNDECIDED);
if (defined $is_accepted || $is_final) {
$decision .= q[ ] . ($is_final ? $FINAL : $PRELIMINARY);
}

return $decision;
}

no Moose::Role;

1;
Expand Down Expand Up @@ -133,6 +150,32 @@ __END__
print $dict_row->short_desc; # Rejected final
print $dict_row->matching_final_short_desc(); # Rejected final
=head2 generate_short_description
Package-level method for generating descriptions matching short
descriptions in the dictionary tables. Note that not every description
is available in all dictionary tables.
my $is_final = 1;
my $is_accepted = 1;
__PACKAGE__->generate_short_description($is_final, $is_accepted);
# returns 'Accepted final'
__PACKAGE__->generate_short_description($is_final);
# returns 'Undecided final'
$is_accepted = 0;
__PACKAGE__->generate_short_description($is_final);
# returns 'Rejected final'
$is_final = 0;
__PACKAGE__->generate_short_description($is_final, $is_accepted);
# returns 'Rejected preliminary'
__PACKAGE__->generate_short_description($is_final);
# returns 'Undecided' !!!
=head1 DIAGNOSTICS
=head1 CONFIGURATION AND ENVIRONMENT
Expand All @@ -145,6 +188,8 @@ __END__
=item Readonly
=item Carp
=back
=head1 INCOMPATIBILITIES
Expand All @@ -157,7 +202,7 @@ Jaime Tovar <lt>jmtc@sanger.ac.uk<gt>
=head1 LICENSE AND COPYRIGHT
Copyright (C) 2017 Genome Research Ltd
Copyright (C) 2019 Genome Research Ltd
This file is part of NPG.
Expand Down
4 changes: 3 additions & 1 deletion lib/npg_qc/Schema/Mqc/OutcomeEntity.pm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ sub add_common_ent_methods {
around [qw/update insert/] => sub {
my $orig = shift;
my $self = shift;
$self->last_modified($self->get_time_now);
if (!$self->is_column_changed('last_modified')) {
$self->last_modified($self->get_time_now);
}
my $return_super = $self->$orig(@_);
$self->_create_historic();
return $return_super;
Expand Down
73 changes: 71 additions & 2 deletions lib/npg_qc/Schema/Result/BamFlagstats.pm
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,61 @@ The coverage threshold used in the perc target greater than depth calculation
The percentage of the target covered at greater than the depth specified
=head2 target_autosome_filter
data_type: 'varchar'
is_nullable: 1
size: 30
Filter used to produce the target autosome stats file
=head2 target_autosome_length
data_type: 'bigint'
extra: {unsigned => 1}
is_nullable: 1
The total length of the target autosome regions
=head2 target_autosome_mapped_reads
data_type: 'bigint'
extra: {unsigned => 1}
is_nullable: 1
The number of mapped reads passing the filter
=head2 target_autosome_proper_pair_mapped_reads
data_type: 'bigint'
extra: {unsigned => 1}
is_nullable: 1
The number of proper pair mapped reads passing the filter
=head2 target_autosome_mapped_bases
data_type: 'bigint'
extra: {unsigned => 1}
is_nullable: 1
The number of mapped bases passing the filter
=head2 target_autosome_coverage_threshold
data_type: 'integer'
is_nullable: 1
The coverage threshold used in the perc target autosome greater than depth calculation
=head2 target_autosome_percent_gt_coverage_threshold
data_type: 'float'
is_nullable: 1
size: [5,2]
The percentage of the target autosome covered at greater than the depth specified
=cut

__PACKAGE__->add_columns(
Expand Down Expand Up @@ -343,6 +398,20 @@ __PACKAGE__->add_columns(
{ data_type => 'integer', is_nullable => 1 },
'target_percent_gt_coverage_threshold',
{ data_type => 'float', is_nullable => 1, size => [5, 2] },
'target_autosome_filter',
{ data_type => 'varchar', is_nullable => 1, size => 30 },
'target_autosome_length',
{ data_type => 'bigint', extra => { unsigned => 1 }, is_nullable => 1 },
'target_autosome_mapped_reads',
{ data_type => 'bigint', extra => { unsigned => 1 }, is_nullable => 1 },
'target_autosome_proper_pair_mapped_reads',
{ data_type => 'bigint', extra => { unsigned => 1 }, is_nullable => 1 },
'target_autosome_mapped_bases',
{ data_type => 'bigint', extra => { unsigned => 1 }, is_nullable => 1 },
'target_autosome_coverage_threshold',
{ data_type => 'integer', is_nullable => 1 },
'target_autosome_percent_gt_coverage_threshold',
{ data_type => 'float', is_nullable => 1, size => [5, 2] },
);

=head1 PRIMARY KEY
Expand Down Expand Up @@ -408,8 +477,8 @@ __PACKAGE__->belongs_to(
with 'npg_qc::Schema::Composition', 'npg_qc::Schema::Flators', 'npg_qc::autoqc::role::result', 'npg_qc::autoqc::role::bam_flagstats';


# Created by DBIx::Class::Schema::Loader v0.07049 @ 2018-06-14 16:17:33
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7FncD4g/I8dgGfG9B9a0CQ
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2019-04-17 14:56:54
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YsrYNzYhK4jAltTpq12t+g


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

0 comments on commit 3d07290

Please sign in to comment.