Skip to content

Commit

Permalink
Merge pull request #473 from wtsi-npg/devel
Browse files Browse the repository at this point in the history
release 64.4 prep
  • Loading branch information
dozy authored Nov 24, 2017
2 parents 8f56d63 + e8caf55 commit 62acdbc
Show file tree
Hide file tree
Showing 31 changed files with 1,705 additions and 119 deletions.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
LIST OF CHANGES FOR NPG-QC PACKAGE

- utility QC feature: db tables, DBIx classes, retrieval
- Add STAR aligner bams as a valid RNA alignments - also added tests for it
- update bam_flagstats to be able run when no markdups metrics file exists

release 64.3.1
- error in a statement for data update is fixed

Expand Down
11 changes: 10 additions & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ lib/npg_qc/Schema/Result/TagMetrics.pm
lib/npg_qc/Schema/Result/TagsReporters.pm
lib/npg_qc/Schema/Result/TileScore.pm
lib/npg_qc/Schema/Result/UpstreamTags.pm
lib/npg_qc/Schema/Result/UqcOutcomeDict.pm
lib/npg_qc/Schema/Result/UqcOutcomeEnt.pm
lib/npg_qc/Schema/Result/UqcOutcomeHist.pm
lib/npg_qc/Schema/Result/VerifyBamId.pm
lib/npg_qc/Schema/ResultSet.pm
lib/npg_qc/Schema/ResultSet/MqcOutcomeEnt.pm
Expand Down Expand Up @@ -245,6 +248,9 @@ t/50-schema-result-VerifyBamId.t
t/50-schema-result-SamtoolsStats.t
t/50-schema-result-SeqComposition.t
t/50-schema-result-SequenceSummary.t
t/50-schema-result-UqcOutcomeDict.t
t/50-schema-result-UqcOutcomeEnt.t
t/50-schema-result-UqcOutcomeHist.t
t/50-schema-resultset.t
t/50-schema-resultset-MqcOutcomeEnt.t
t/60-autoqc-autoqc.t
Expand Down Expand Up @@ -297,14 +303,15 @@ t/60-autoqc-results-verify_bam_id.t
t/70-mqc-reporter.t
t/70-mqc-outcomes.t
t/80-autoqc-qc-script.t
t/autoqc_util.pm
t/data/config.ini
t/data/api_dbic_fixtures/npg_qc/RunTimeline.yml
t/data/api_dbic_fixtures/npg/RunStatusDict.yml
t/data/api_dbic_fixtures/npg/RunStatus.yml
t/data/api_dbic_fixtures/npg/Run.yml
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/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
t/data/autoqc/bam_flagstats/4783_5_metrics_optical.txt
t/data/autoqc/bam_flagstats/4783_5.flagstat
Expand Down Expand Up @@ -579,6 +586,7 @@ t/data/fixtures/000-analysis.yml
t/data/fixtures/000-image_store.yml
t/data/fixtures/000-mqc_outcome_dict.yml
t/data/fixtures/000-mqc_library_outcome_dict.yml
t/data/fixtures/000-uqc_outcome_dict.yml
t/data/fixtures/000-run_tile.yml
t/data/fixtures/100-analysis_lane.yml
t/data/fixtures/100-cache_query.yml
Expand Down Expand Up @@ -646,6 +654,7 @@ t/data/nfs/sf44/ILorHSany_sf25/incoming/100925_HS8_05330_B_205NNABXX/Data/Intens
t/data/nfs/sf44/ILorHSany_sf25/incoming/100925_HS8_05330_B_205NNABXX/RunInfo.xml
t/data/qcoutcomes/fixtures/000-mqc_library_outcome_dict.yml
t/data/qcoutcomes/fixtures/000-mqc_outcome_dict.yml
t/data/qcoutcomes/fixtures/000-uqc_outcome_dict.yml
t/data/reporter/npg_qc/mqc_outcome_dict.yml
t/data/reporter/npg_qc/mqc_outcome_ent.yml
t/data/reporter/npg_qc/seq_component.yml
Expand Down
31 changes: 25 additions & 6 deletions lib/npg_qc/Schema/Mqc/OutcomeEntity.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ with 'npg_qc::Schema::Composition';

our $VERSION = '0';

requires 'mqc_outcome';
requires 'update';
requires 'insert';

Expand All @@ -28,8 +27,9 @@ Readonly::Hash my %DELEGATION_TO_MQC_OUTCOME => {
foreach my $this_class_method (keys %DELEGATION_TO_MQC_OUTCOME ) {
__PACKAGE__->meta->add_method( $this_class_method, sub {
my $self = shift;
my $outcome_type = $self->dict_relation();
my $that_class_method = $DELEGATION_TO_MQC_OUTCOME{$this_class_method};
return $self->mqc_outcome->$that_class_method;
return $self->$outcome_type->$that_class_method;
}
);
}
Expand All @@ -43,6 +43,17 @@ around [qw/update insert/] => sub {
return $return_super;
};

sub dict_relation {
my $self = shift;
my $name = $self->_is_mqc_type_outcome() ? 'm' : 'u';
return $name . q[qc_outcome];
}

sub _is_mqc_type_outcome {
my $name = ref shift;
return $name =~ /::Mqc(?:Library)?OutcomeEnt\Z/smx;
}

sub get_time_now {
return DateTime->now(time_zone => DateTime::TimeZone->new(name => q[local]));
}
Expand Down Expand Up @@ -159,14 +170,19 @@ npg_qc::Schema::Mqc::OutcomeEntity
=head1 DESCRIPTION
Common functionality for lane and library manual qc outcome entity DBIx objects.
Common functionality for lane and library manual qc and user utility outcomes
entity DBIx objects.
=head1 SUBROUTINES/METHODS
=head2 composition
A lazy-build attribute of type npg_tracking::glossary::composition.
It is built by inspection the linked seq_composition row.
It is built by inspecting the linked seq_composition row.
=head2 dict_relation
Returns the name of the relationship to the outcomes dictionary.
=head2 update
Expand Down Expand Up @@ -208,15 +224,18 @@ otherwise returns false.
=head2 update_outcome
Updates the outcome of the entity with values provided. Stores a new row
if this entity was not yet stored in database.
if this entity was not yet stored in database. This method has not been yet
extended to updating utility outcomes.
$obj->update_outcome($outcome, $username);
$obj->update_outcome($outcome, $username, $rt_ticket);
=head2 toggle_final_outcome
Updates the final accepted or rejected outcome to its opposite final outcome,
i.e. accepted is changed to rejected and rejected to accepted.
i.e. accepted is changed to rejected and rejected to accepted. This method is
not applicable to utility qc outcomes since there is no concept of final
for this type of outcome.
$obj->toggle_final_outcome($username);
$obj->toggle_final_outcome($username, $rt_ticket);
Expand Down
36 changes: 33 additions & 3 deletions lib/npg_qc/Schema/Result/SeqComposition.pm
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,36 @@ __PACKAGE__->might_have(
{ cascade_copy => 0, cascade_delete => 0 },
);

=head2 uqc_outcome_ent
Type: might_have
Related object: L<npg_qc::Schema::Result::UqcOutcomeEnt>
=cut

__PACKAGE__->might_have(
'uqc_outcome_ent',
'npg_qc::Schema::Result::UqcOutcomeEnt',
{ 'foreign.id_seq_composition' => 'self.id_seq_composition' },
{ cascade_copy => 0, cascade_delete => 0 },
);

=head2 uqc_outcome_hists
Type: has_many
Related object: L<npg_qc::Schema::Result::UqcOutcomeHist>
=cut

__PACKAGE__->has_many(
'uqc_outcome_hists',
'npg_qc::Schema::Result::UqcOutcomeHist',
{ 'foreign.id_seq_composition' => 'self.id_seq_composition' },
{ cascade_copy => 0, cascade_delete => 0 },
);

=head2 verify_bam_id
Type: might_have
Expand All @@ -544,8 +574,8 @@ __PACKAGE__->might_have(
);


# Created by DBIx::Class::Schema::Loader v0.07047 @ 2017-09-15 14:33:12
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:j2lqJ9ZKV4Ps0eTABP7AXQ
# Created by DBIx::Class::Schema::Loader v0.07047 @ 2017-10-06 15:50:03
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7yXOqY10w/8mHVFgahi8YA


# You can replace this text with custom code or comments, and it will be preserved on regeneration
Expand All @@ -556,7 +586,7 @@ our $VERSION = '0';

=head2 create_composition
A factory method returning a npg_tracking::glossary::composition object of illumina components.
A factory method returning a npg_tracking::glossary::composition object of illumina components.
=cut

Expand Down
Loading

0 comments on commit 62acdbc

Please sign in to comment.