From 14478574825ab79b4c8388f529a060b7ab28788b Mon Sep 17 00:00:00 2001 From: Marina Gourtovaia Date: Tue, 17 Sep 2024 17:40:24 +0100 Subject: [PATCH] Fixed a bug in the autoqc function package. The runfolder_path attribute is passed to the constructor of the review autoqc check object when deciding whether this check should run. Updated the RoboQC section of the existing test product configuration file. --- Changes | 3 ++ MANIFEST | 1 + lib/npg_pipeline/function/autoqc.pm | 3 +- t/20-function-autoqc.t | 36 ++++++++++++++----- .../config/qc_review/product_release.yml | 14 ++++---- .../qc_review_default/product_release.yml | 22 ++++++++++++ t/data/samplesheet_8747.csv | 2 +- 7 files changed, 64 insertions(+), 17 deletions(-) create mode 100644 t/data/release/config/qc_review_default/product_release.yml diff --git a/Changes b/Changes index 68c4cc573..9ff161b56 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,9 @@ LIST OF CHANGES --------------- + - The runfolder_path attribute is passed to the constructor of the review + autoqc check object when deciding whether this check should run. + release 68.5.1 (2024-10-04) - Added .github/dependabot.yml file to auto-update GitHub actions - Following a release on 07/09/2024, see https://metacpan.org/dist/App-perlbrew/changes, diff --git a/MANIFEST b/MANIFEST index c1334cdbc..0cb54a100 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1041,6 +1041,7 @@ t/data/release/config/haplotype_caller_on_study_specific_reference/product_relea t/data/release/config/notify_off/product_release.yml t/data/release/config/notify_on/product_release.yml t/data/release/config/qc_review/product_release.yml +t/data/release/config/qc_review_default/product_release.yml t/data/release/config/pp_archival/product_release.yml t/data/release/config/pp_archival/product_release_no_array.yml t/data/release/config/pp_archival/product_release_no_filters.yml diff --git a/lib/npg_pipeline/function/autoqc.pm b/lib/npg_pipeline/function/autoqc.pm index d79aeee05..98bc9226a 100644 --- a/lib/npg_pipeline/function/autoqc.pm +++ b/lib/npg_pipeline/function/autoqc.pm @@ -318,6 +318,7 @@ sub _should_run { $init_hash{'is_paired_read'} = $self->is_paired_read() ? 1 : 0; } elsif ($self->qc_to_run() eq 'review') { $init_hash{'product_conf_file_path'} = $self->product_conf_file_path; + $init_hash{'runfolder_path'} = $self->runfolder_path; } elsif ($self->qc_to_run() eq 'genotype') { my $ref_fasta = npg_pipeline::cache::reference->instance() ->get_path($product, q(fasta), $self->repository()); @@ -416,7 +417,7 @@ Marina Gourtovaia =head1 LICENSE AND COPYRIGHT -Copyright (C) 2018,2019,2020 Genome Research Ltd. +Copyright (C) 2018,2019,2020,2024 Genome Research Ltd. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/t/20-function-autoqc.t b/t/20-function-autoqc.t index 8b1a6a7d0..b93392355 100644 --- a/t/20-function-autoqc.t +++ b/t/20-function-autoqc.t @@ -40,6 +40,8 @@ my $archive_dir = $hiseq_rf->{'archive_path'}; my $rf_path = $hiseq_rf->{'runfolder_path'}; fcopy('t/data/run_params/runParameters.hiseq.xml', "$rf_path/runParameters.xml") or die 'Fail to copy run param file'; +fcopy('t/data/run_params/RunInfo.hiseq.rr.xml', "$rf_path/RunInfo.xml") + or die 'Fail to copy run info file'; my $default = { default => { @@ -509,7 +511,7 @@ subtest 'genotype and gc_fraction and bcfstats' => sub { my $qc = npg_pipeline::function::autoqc->new($init); -# create products with the characteristics being tested + # create products with the characteristics being tested my $plexed_lane_lims = st::api::lims->new(id_run => 14043, position => 6); my $library_lane_lims = st::api::lims->new(id_run => 14043, position => 1); my $plex0_lims = st::api::lims->new(id_run => 8747, position => 6, tag_index => 0); @@ -574,7 +576,7 @@ subtest 'genotype and gc_fraction and bcfstats' => sub { }; subtest 'review' => sub { - plan tests => 6; + plan tests => 8; local $ENV{NPG_CACHED_SAMPLESHEET_FILE} = 't/data/samplesheet_8747.csv'; @@ -602,20 +604,19 @@ subtest 'review' => sub { ); $da = $qc->create(); - ok ($da && (@{$da} == 11), '11 definitions returned'); + ok ($da && (@{$da} == 10), '10 definitions returned'); my %definitions = map { $_->composition->freeze2rpt => $_ } @{$da}; my @expected_rpt_lists = qw/ 8747:1:1 8747:1:2 8747:1:3 8747:2:4 8747:2:5 8747:2:6 8747:3:7 8747:3:8 8747:3:9 - 8747:7 - 8747:8 /; + 8747:7 /; is_deeply ([sort keys %definitions], \@expected_rpt_lists, 'definitions are for correct entities'); - my $d = $definitions{'8747:8'}; - my $expected_command = q{qc --check=review --rpt_list="8747:8" } . - qq{--filename_root=8747_8 --qc_out=$archive_dir/lane8/qc } . - qq{--qc_in=$archive_dir/lane8/qc --conf_path=t/data/release/config/qc_review } . + my $d = $definitions{'8747:7'}; + my $expected_command = q{qc --check=review --rpt_list="8747:7" } . + qq{--filename_root=8747_7 --qc_out=$archive_dir/lane7/qc } . + qq{--qc_in=$archive_dir/lane7/qc --conf_path=t/data/release/config/qc_review } . qq{--runfolder_path=$rf_path}; is ($d->command, $expected_command, 'correct command for lane-level job'); @@ -625,6 +626,23 @@ subtest 'review' => sub { qq{--qc_in=$archive_dir/lane1/plex1/qc --conf_path=t/data/release/config/qc_review } . qq{--runfolder_path=$rf_path}; is ($d->command, $expected_command, 'correct command for plex-level job'); + + $qc = npg_pipeline::function::autoqc->new( + qc_to_run => 'review', + is_indexed => 1, + id_run => 8747, + runfolder_path => $rf_path, + timestamp => q{today}, + conf_path => q{t/data/release/config/qc_review_default}, + resource => $default + ); + + $da = $qc->create(); + ok ($da && (@{$da} == 6), '6 definitions returned'); + %definitions = map { $_->composition->freeze2rpt => $_ } @{$da}; + @expected_rpt_lists = map { "8747:$_:168"} qw/1 2 3 4 5 6/; + is_deeply ([sort keys %definitions], \@expected_rpt_lists, + 'definitions are for correct entities'); }; subtest 'interop' => sub { diff --git a/t/data/release/config/qc_review/product_release.yml b/t/data/release/config/qc_review/product_release.yml index 66a29c096..6e4eb36e8 100644 --- a/t/data/release/config/qc_review/product_release.yml +++ b/t/data/release/config/qc_review/product_release.yml @@ -5,19 +5,21 @@ default: study: - study_id: "1713" robo_qc: + qc_type: "mqc" criteria: - applicability_criteria: - lims: - - library_type: - - "Agilent Pulldown" + lims: + library_type: + - "Agilent Pulldown" acceptance_criteria: - "criteria1" - study_id: "2410" robo_qc: + qc_type: "mqc" criteria: - applicability_criteria: - lims: - - library_type: - - "Custom" + lims: + library_type: + - "Custom" acceptance_criteria: - "criteria2" diff --git a/t/data/release/config/qc_review_default/product_release.yml b/t/data/release/config/qc_review_default/product_release.yml new file mode 100644 index 000000000..00396359c --- /dev/null +++ b/t/data/release/config/qc_review_default/product_release.yml @@ -0,0 +1,22 @@ +--- +common: + irods: &no_irods + enable: false +default: + irods: &default_irods + enable: true + data_deletion: + staging_deletion_delay: 30 + markdup_method: "biobambam" + gbs_pipeline: &gbs_pipeline_accessible + allowed: true + robo_qc: + qc_type: "mqc" + criteria: + - applicability_criteria: + lims: + is_control: 1 + sequencing_run: + platform_HiSeq: 1 + acceptance_criteria: + - "sequence_error.pass" diff --git a/t/data/samplesheet_8747.csv b/t/data/samplesheet_8747.csv index 2077d7210..6704cda46 100644 --- a/t/data/samplesheet_8747.csv +++ b/t/data/samplesheet_8747.csv @@ -34,5 +34,5 @@ Lane,Sample_ID,Sample_Name,GenomeFolder,Index,bait_name,default_library_type,def 6,6093530,ERS183155,,TTAATC,,qPCR only,GCCAATGT,,is1@sanger.ac.uk jec@sanger.ac.uk kdj@sanger.ac.uk ncb@sanger.ac.uk nw6@sanger.ac.uk rw4@sanger.ac.uk sm11@sanger.ac.uk,is1@sanger.ac.uk jec@sanger.ac.uk kdj@sanger.ac.uk nw6@sanger.ac.uk rw4@sanger.ac.uk,ncb@sanger.ac.uk sm11@sanger.ac.uk,jec@sanger.ac.uk,,0,0,,,dag1_wt3 6093530,zebrafish,7955,S4301,82,ZF molecular phenotype,standard,,,from:70 to:270,ERS183155,,Danio rerio,,3%27 end enriched mRNA from morphologically normal sibling embryos from dag1 knockout incross 3. A 6 base indexing sequence (TTAATC) is bases 5 to 10 of read 1 followed by polyT. More information describing the mutant phenotype can be found at the Wellcome Trust Sanger Institute Zebrafish Mutation Project website http%3A%2F%2Fwww.sanger.ac.uk%2Fcgi-bin%2FProjects%2FD_rerio%2Fzmp%2Fsearch.pl%3Fq%3Dzmp_phD,,1503354,dag1_wt3,Zebrafish dag1 wt3,Danio_rerio (zv9),,168,ERP001559,1,0,0,Total RNA was extracted from wild type and mutant zebrafish embryos. Double stranded cDNA representing the 3%27 ends of transcripts was made by a variety of methods%2C including polyT priming and 3%27 pull down on magentic beads. Some samples included indexing test experiments where a sequence barcode was placed within one of the sequence reads.. This data is part of a pre-publication release. For information on the proper use of pre-publication data shared by the Wellcome Trust Sanger Institute (including details of any publication moratoria)%2C please see http%3A%2F%2Fwww.sanger.ac.uk%2Fdatasharing%2F,82,ZF molecular phenotype,,,Zebrafish transcript profiling,6, 6,4405872,phiX_for_spiked_buffers,,ACAACGCAAT,,,ACAACGCAAT,,hps@sanger.ac.uk pc10@sanger.ac.uk,pc10@sanger.ac.uk,hps@sanger.ac.uk,hps@sanger.ac.uk,,1,0,,,PhiX (10Jan12),,,,,,standard,,,,,,,,,,1255141,phiX_for_spiked_buffers,,,,168,,1,0,0,None,198,Illumina Controls,,,,168, 7,6101639,EGAN00001085924,,,,Custom,,,as16@sanger.ac.uk cdt@sanger.ac.uk cs4@sanger.ac.uk las@sanger.ac.uk lm5@sanger.ac.uk sd5@sanger.ac.uk sm2@sanger.ac.uk som@sanger.ac.uk,as16@sanger.ac.uk cs4@sanger.ac.uk las@sanger.ac.uk sd5@sanger.ac.uk som@sanger.ac.uk,cdt@sanger.ac.uk cs4@sanger.ac.uk lm5@sanger.ac.uk sm2@sanger.ac.uk,sm2@sanger.ac.uk,,0,0,6103057,0,PD4845a-RNA_rnaseq 6101639,Human,9606,S0814,1177,CGP Core Sequencing 10%2F12 to 09%2F13,standard,pass,4683991,from:175 to:225,EGAN00001085924,,Homo sapiens,,,,1505636,PD4845a-RNA_rnaseq,PD4845a-RNA,,,168,EGAS00001000377,1,0,0,We propose to definitively characterise the somatic genetics of triple negative breast cancer through generation of comprehensive catalogues of somatic mutations in breast cancer cases by high coverage genome sequencing coupled with integrated transcriptomic and methylation analyses.,2410,Triple Negative Breast Cancer RNA Sequencing,Homo_sapiens (CGP_GRCh37.NCBI.allchr_MT),,Triple Negative Breast Cancer RNA Sequencing,, -8,6101640,EGAN00001085925,,,,Custom,,,as16@sanger.ac.uk cdt@sanger.ac.uk cs4@sanger.ac.uk las@sanger.ac.uk lm5@sanger.ac.uk sd5@sanger.ac.uk sm2@sanger.ac.uk som@sanger.ac.uk,as16@sanger.ac.uk cs4@sanger.ac.uk las@sanger.ac.uk sd5@sanger.ac.uk som@sanger.ac.uk,cdt@sanger.ac.uk cs4@sanger.ac.uk lm5@sanger.ac.uk sm2@sanger.ac.uk,sm2@sanger.ac.uk,,0,0,6103058,0,PD4845a-RNA2_rnaseq 6101640,Human,9606,S0814,1177,CGP Core Sequencing 10%2F12 to 09%2F13,standard,pass,4683992,from:175 to:225,EGAN00001085925,,Homo sapiens,,,,1505637,PD4845a-RNA2_rnaseq,PD4845a-RNA2,,,168,EGAS00001000377,1,0,0,We propose to definitively characterise the somatic genetics of triple negative breast cancer through generation of comprehensive catalogues of somatic mutations in breast cancer cases by high coverage genome sequencing coupled with integrated transcriptomic and methylation analyses.,2410,Triple Negative Breast Cancer RNA Sequencing,Homo_sapiens (CGP_GRCh37.NCBI.allchr_MT),,Triple Negative Breast Cancer RNA Sequencing,, +8,6101640,EGAN00001085925,,,,Custom2,,,as16@sanger.ac.uk cdt@sanger.ac.uk cs4@sanger.ac.uk las@sanger.ac.uk lm5@sanger.ac.uk sd5@sanger.ac.uk sm2@sanger.ac.uk som@sanger.ac.uk,as16@sanger.ac.uk cs4@sanger.ac.uk las@sanger.ac.uk sd5@sanger.ac.uk som@sanger.ac.uk,cdt@sanger.ac.uk cs4@sanger.ac.uk lm5@sanger.ac.uk sm2@sanger.ac.uk,sm2@sanger.ac.uk,,0,0,6103058,0,PD4845a-RNA2_rnaseq 6101640,Human,9606,S0814,1177,CGP Core Sequencing 10%2F12 to 09%2F13,standard,pass,4683992,from:175 to:225,EGAN00001085925,,Homo sapiens,,,,1505637,PD4845a-RNA2_rnaseq,PD4845a-RNA2,,,168,EGAS00001000377,1,0,0,We propose to definitively characterise the somatic genetics of triple negative breast cancer through generation of comprehensive catalogues of somatic mutations in breast cancer cases by high coverage genome sequencing coupled with integrated transcriptomic and methylation analyses.,2410,Triple Negative Breast Cancer RNA Sequencing,Homo_sapiens (CGP_GRCh37.NCBI.allchr_MT),,Triple Negative Breast Cancer RNA Sequencing,,