diff --git a/Changes b/Changes index c13a36360..0e2f57b8e 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ LIST OF CHANGES FOR NPG-QC PACKAGE +release 69.10.1 + - updated documentation + release 69.10.0 - switch to bcviz@1.3.3 - Use samplesheet test data instead of XML files. diff --git a/docs/qc_outcomes_change_howto.md b/docs/qc_outcomes_change_howto.md new file mode 100644 index 000000000..2787fc96b --- /dev/null +++ b/docs/qc_outcomes_change_howto.md @@ -0,0 +1,95 @@ +## General + +- Use correct RT ticket number. +- Set id_run, position and tag_index accordingly. +- Wrap database changes into a transaction, which initially shoudl have a clause + to fail it so that it can be tried out (see some examples below). + +## Toggle the outcome of a single library + +QC outcome will change from `pass` to `fail` or `fail` to `pass`. + +``` +use npg_qc::Schema; +my $rs=npg_qc::Schema->connect()->resultset("MqcLibraryOutcomeEnt") + ->search_autoqc({id_run=>X,position=>Y,tag_index=>X}); +if ($rs->count == 1) { + my $row=$rs->next; + print "Current outcome: ".$row->mqc_outcome->short_desc; + $row->toggle_final_outcome($ENV{"USER"}, "RT#XXXXXX"); + print "New outcome: ".$row->mqc_outcome->short_desc; +} else { + die "no result or multiple results" +} +``` + +## Toggle sequencing outcome for a lane + +QC outcome will change from `pass` to `fail` or `fail` to `pass`. + +``` +use npg_qc::Schema; +my $rs=npg_qc::Schema->connect()->resultset("MqcOutcomeEnt") + ->search({id_run=>X,position=>Y}); +if ($rs->count == 1) { + my $row=$rs->next; + print "Current outcome: ".$row->mqc_outcome->short_desc; + $row->toggle_final_outcome($ENV{"USER"}, "RT#XXXXXX"); + print "New outcome: ".$row->mqc_outcome->short_desc; +} else { + die "no result or multiple results" +} +``` + +## Assigning the library outcome value + +When the lane outcome is changed from `fail` to `pass`, having consulted +the requestor, you might want to assign a pass to libraries. + +``` +use npg_qc::Schema; +my $s = npg_qc::Schema->connect(); +# Use transaction. +$s->txn_do( sub { + my $rs=npg_qc::Schema->connect()->resultset("MqcLibraryOutcomeEnt") + ->search({id_run=>X,position=>Y}); + while (my $row=$rs->next) { + print $row->tag_index . " Current outcome: ".$row->mqc_outcome->short_desc; + $row->update_outcome({"mqc_outcome" => "Accepted final"}, + $ENV{"USER"}, "RT#XXXX"); + print "New outcome: ".$row->mqc_outcome->short_desc; + } + # Comment out the next statement when ready to update the values. + die 'End of transaction, deliberate error'; +}); +``` + +## Create sequencing `fail` for lanes + +This example covers the case when QC outcomes have to be created for entities, +which do not have any associated QC outcomes. + +A typical scenario is when the `mqc_skipper` pushed the data through for +assignment downstream, the data is rejected there, and the subsequent local +QC assessment assigns a `fail`. + +``` +use npg_qc::mqc::outcomes::keys qw/ $SEQ_OUTCOMES /; +use npg_qc::Schema; +use npg_qc::mqc::outcomes; +use Data::Dumper; + +my $outcomes = {}; +my $info = {}; +my $id_run = X; +foreach my $l (1..4) { + my $key= join q(:),$id_run,$l; + $outcomes->{$SEQ_OUTCOMES}->{$key} = {mqc_outcome=>q(Rejected final)}; + $info->{$key}=[]; +} + +print Dumper [$outcomes]; +my $o = npg_qc::mqc::outcomes->new(qc_schema => npg_qc::Schema->connect()); +$o->save($outcomes, $ENV{USER}, $info); +``` + diff --git a/docs/todo.rst b/docs/todo.rst deleted file mode 100644 index 4fe42b428..000000000 --- a/docs/todo.rst +++ /dev/null @@ -1,55 +0,0 @@ -=========================== -Items from Year 2015 List -=========================== - -#. Grunt configuration for tasks -#. Use minified javascript files with random names - will force the browser to fetch newly released javascript -#. Deal with failed but should be charged scenario -#. It's currently not immediately obvious if data has been subject to a split but important if say human split has been incorrectly selected for a mouse study (or not selected for a pathogen study contaminated with human). Could be determined just using the flagstats file names. - -=============================================== -Items from Plex-level Manual QC Document (2015) -=============================================== - -Indication of Charge in Manual QC - #. An interface (GUI widgets) for making alternative charge suggestions will be displayed once a final decision for a lane is registered. - #. By default a pass means a charge and a fail means no charge. - #. The additional interface only has to be used if alternative charge decisions have to be communicated. - #. The charge decisions will be stored in the QC database (maintained by NPG). Currently there is no mechanism to communicate these decisions. The SeqQC display will give indication of the charge decision - -Target file level release flag - #. Release flags will be provided per target file. - #. The initial value will be true if either manual qc is pass or a charge is made. - #. A GUI will be provided to update (overwrite) the value. - -============================== -Items from existing RT tickets -============================== -#. VerifyBamId highlighting RT#480016 -#. Display number of times a library has been sequenced -#. Return of the collapser RT#517381 - -============================= -Other discussed topics (2015) -============================= -#. Auto-suggests (aiming towards implementation of auto pass/fail in at least some cases - SMT re-requested 2016). -#. RNA autoqc suite -#. Display samtools stats plots, especially indel per cycle plots. -#. 'Library' complete - library plex data ready to merge (or merged data ready to be picked up by downstream analysts). Requires further clarification/discussion. -#. Fix usage of numbers with and without QC fail reads from flagstats files - for bam_flagstats. To allow correct display of %mapped on QC pages (requires GCLP approval). -#. Ref match - only show top 10 or 20 matches by default, but allow access to full report. - -============================================== -Selected items from git project issues (2016) -============================================== -#. SeqQC - Create a light weight controller to provide data for what is qc-able in a page. It should work using the same/similar queries to those used for reporting current manual QC outcomes. Query the controller to take decisions about when to generate manual qc widgets in client side. (#319) -#. SeqQC run page: display lib qc stats (num_passed:num_undef:num_failed) for a lane (#281) - -========================================= -ISSUES TO CONSIDER WHEN PLANNING A CHANGE -========================================= -#. The API used to change the qc outcomes manually does not validate lib outcomes against lane outcomes, making any combinations possible. The GUI interface that is used during the qc process imposes some constraints, see https://github.com/wtsi-npg/npg_qc/blob/devel/lib/npg_qc/mqc/outcomes.pm. This discrepancy reflects current business needs. The behaviour of the API should not be changed inadvertendly. - - - -