Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excluded robo study-specific lane-lane assessment. #895

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
LIST OF CHANGES FOR NPG-QC PACKAGE

- Excluded study-specific lane-lane assessment in npg_qc::autoqc::check::review
This helps to avoid uncertainty in evaluating lanes where samples belong to
different studies at a price of not being able to perform study-specific
evaluation of one-library lanes.

release 74.0.0 (2024-12-02)
- npg_qc::autoqc::qc_store - changed loading of ORM classes into memory
to on demand at run time.
Expand Down
25 changes: 18 additions & 7 deletions lib/npg_qc/autoqc/checks/review.pm
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ outcomes.
The C<robo> section of the product configuration file sits either within
the configuration for a particular study or in the C<default> section, or
in both locations. For a given entity a study-specific RoboQC definition
takes precedence over the default one.
takes precedence over the default one. For lanes only the C<default> section
of the product configuration file is examined.

Evaluation criteria for samples vary depending on the sequencing instrument
and flowcell type, library type, sample reference, etc. Each of the
Expand Down Expand Up @@ -487,14 +488,24 @@ has '_robo_config' => (
sub _build__robo_config {
my $self = shift;

my $strict = 1; # Parse study section only, ignore the default section.
my $config = $self->study_config($self->lims(), $strict);
if ($config) {
$config = $config->{$ROBO_KEY};
my $config;

# Do not examine study-specific section for lane entities, meaning that
# one-sample lanes, pools or not, cannot be evaluated according to the
# study criteria of their sample. Helps to avoid uncertainty of dealing
# with pool's samples belonging to different studies.
if (!$self->lims->is_lane) {
my $strict = 1; # Parse study section only, ignore the 'default' section.
$config = $self->study_config($self->lims(), $strict);
if ($config) {
$config = $config->{$ROBO_KEY};
}
if (!$config) {
carp 'Study-specific RoboQC config not found for ' . $self->_entity_desc;
}
}

if (!$config) {
carp 'Study-specific RoboQC config not found for ' . $self->_entity_desc;
if (!$config) { # Look at the 'default' section of the configuration file.
$config = $self->default_study_config()->{$ROBO_KEY};
}

Expand Down
27 changes: 24 additions & 3 deletions t/60-autoqc-checks-review.t
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ my $schema = Moose::Meta::Class->create_anon_class(
->create_test_db(q[npg_qc::Schema]);

subtest 'constructing object, deciding whether to run' => sub {
plan tests => 33;
plan tests => 34;

my $check = npg_qc::autoqc::checks::review->new(
conf_path => $test_data_dir,
Expand Down Expand Up @@ -148,6 +148,15 @@ subtest 'constructing object, deciding whether to run' => sub {
} 'can set lims via the constructor';
ok ($check->can_run, 'can_run returns true');

# No robo config in the default section, all samples belong to the same
# study, for which robo config is defined.
$check = npg_qc::autoqc::checks::review->new(
conf_path => "$test_data_dir/with_criteria",
qc_in => $test_data_dir,
rpt_list => '27483:1'
);
ok (!$check->can_run, 'can_run returns false for a lane');

$check = npg_qc::autoqc::checks::review->new(
conf_path => "$test_data_dir/no_applicability4single",
qc_in => $test_data_dir,
Expand Down Expand Up @@ -812,14 +821,14 @@ subtest 'evaluating generic for artic results' => sub {
};

subtest 'evaluating for LCMB library type' => sub {
plan tests => 14;
plan tests => 16;

my $test_data_path = 't/data/runfolder_49285';
my $runfolder_name = '240802_A00537_1044_BHJKCGDSXC';
my $staging_dir = tempdir( CLEANUP => 1 );
my $id_run = 49285;
local $ENV{NPG_CACHED_SAMPLESHEET_FILE} =
't/data/runfolder_49285/samplesheet_49285.csv';
"$test_data_path/samplesheet_49285.csv";

my $ae = Archive::Extract->new(
archive => "${test_data_path}/${runfolder_name}.tar.gz"
Expand Down Expand Up @@ -906,6 +915,18 @@ subtest 'evaluating for LCMB library type' => sub {
{'mqc_seq_outcome' => 'Rejected preliminary', 'username' => 'robo_qc'},
'lane QC outcome is saved correctly'
);

$check = npg_qc::autoqc::checks::review->new(
runfolder_path => $runfolder_path,
conf_path => $test_data_path,
rpt_list => "${id_run}:4",
use_db => 1,
_qc_schema => $schema
);
my $with_control = 0;
is_deeply ([$check->lims->study_ids($with_control)], [qw(7396 7397)],
'lane 4 samples belong to two different studies');
lives_and (sub {is $check->can_run, 1}, 'lane-level check can run');
};

1;
4 changes: 2 additions & 2 deletions t/data/runfolder_49285/samplesheet_49285.csv
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ Lane,Sample_ID,Sample_Name,GenomeFolder,Index,Index2,bait_name,default_library_t
4,71446140,EGAN00004549103,,CGTCGTCG,CTCAGAAA,,LCMB,CGTCGTCG,CTCAGAAA,,0,0,72659884,3,71446140,,9606,from:450 to:450,Normal,Homo sapiens,0,,,9725055,0,7396STDY14893009,,888,1,0,0,7396,Some interesting study,Homo_sapiens (GRCh38_full_analysis_set_plus_decoy_hla),0,3,
4,71446152,EGAN00004549109,,TTCTCTTT,TCAGCCTG,,LCMB,TTCTCTTT,TCAGCCTG,,0,0,72659884,3,71446152,,9606,from:450 to:450,Normal,Homo sapiens,0,,,9725056,0,7396STDY14893010,,888,1,0,0,7396,Some interesting study,Homo_sapiens (GRCh38_full_analysis_set_plus_decoy_hla),0,4,
4,71446164,EGAN00004549107,,TCTCATAT,TTTGCACC,,LCMB,TCTCATAT,TTTGCACC,,0,0,72659884,3,71446164,,9606,from:450 to:450,Normal,Homo sapiens,0,,,9725057,0,7396STDY14893011,,888,1,0,0,7396,Some interesting study,Homo_sapiens (GRCh38_full_analysis_set_plus_decoy_hla),0,5,
4,71446176,EGAN00004549106,,TCGGGCTG,CGATCTGG,,LCMB,TCGGGCTG,CGATCTGG,,0,0,72659884,3,71446176,,9606,from:450 to:450,Normal,Homo sapiens,0,,,9725058,0,7396STDY14893012,,888,1,0,0,7396,Some interesting study,Homo_sapiens (GRCh38_full_analysis_set_plus_decoy_hla),0,6,
4,51702672,phiX_for_spiked_buffers,,TGTGCAGC,ACTGATGT,,,TGTGCAGC,ACTGATGT,,1,0,72659884,3,51702672,,10847,,,,0,,,1255141,,phiX_for_spiked_buffers,PhiX (Sanger-SNPs),888,1,0,0,198,Illumina Controls, ,0,888,
4,71446176,EGAN00004549106,,TCGGGCTG,CGATCTGG,,LCMB,TCGGGCTG,CGATCTGG,,0,0,72659884,3,71446176,,9606,from:450 to:450,Normal,Homo sapiens,0,,,9725058,0,7396STDY14893012,,888,1,0,0,7397,One more interesting study,Homo_sapiens (GRCh38_full_analysis_set_plus_decoy_hla),0,6,
4,51702672,phiX_for_spiked_buffers,,TGTGCAGC,ACTGATGT,,,TGTGCAGC,ACTGATGT,,1,0,72659884,3,51702672,,10847,,,,0,,,1255141,,phiX_for_spiked_buffers,PhiX (Sanger-SNPs),888,1,0,0,198,Illumina Controls, ,0,888,
Loading