From 86531f48314a1978fb2e5515893e9dc61f9951b9 Mon Sep 17 00:00:00 2001 From: Marina Gourtovaia Date: Mon, 18 Dec 2023 15:30:35 +0000 Subject: [PATCH] Simplifies the default samplesheet path. An option to read the value from the configuration file is not used. --- lib/npg/samplesheet/base.pm | 6 +----- t/.npg/npg_tracking | 1 - t/47-samplesheet.t | 12 +++--------- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/lib/npg/samplesheet/base.pm b/lib/npg/samplesheet/base.pm index 834ee073..f07da45e 100755 --- a/lib/npg/samplesheet/base.pm +++ b/lib/npg/samplesheet/base.pm @@ -8,7 +8,6 @@ use MooseX::Getopt::Meta::Attribute::Trait::NoGetopt; use npg_tracking::Schema; use st::api::lims; -use npg_tracking::util::config qw(get_config_staging_areas); use WTSI::DNAP::Warehouse::Schema; with 'npg_tracking::glossary::run'; @@ -31,8 +30,7 @@ A parent class for samplesheet generator. Provides common attributes. =cut -my$config=get_config_staging_areas(); -Readonly::Scalar my $SAMPLESHEET_PATH => $config->{'samplesheets'}||q(samplesheets/); +Readonly::Scalar my $SAMPLESHEET_PATH => 'samplesheets/'; Readonly::Scalar my $LIMS_DRIVER_TYPE => 'ml_warehouse'; =head1 SUBROUTINES/METHODS @@ -221,8 +219,6 @@ __END__ =item st::api::lims -=item npg_tracking::util::config - =item npg_tracking::glossary::run =back diff --git a/t/.npg/npg_tracking b/t/.npg/npg_tracking index c16606b7..5a7b7c0d 100644 --- a/t/.npg/npg_tracking +++ b/t/.npg/npg_tracking @@ -3,7 +3,6 @@ my $VAR1 = { 'staging_areas' => { 'indexes' => [18 .. 32, 34 .. 47, 49 .. 55], 'prefix' => '/nfs/sf', - 'samplesheets' => '/nfs/sf49/ILorHSorMS_sf49/samplesheets/' }, 'staging_areas2webservers' => { 'gs01' => {'npg_tracking' => 'http://gso1.san.ac.uk:678', diff --git a/t/47-samplesheet.t b/t/47-samplesheet.t index f8753b25..a1479070 100644 --- a/t/47-samplesheet.t +++ b/t/47-samplesheet.t @@ -10,7 +10,6 @@ use Moose::Meta::Class; use t::dbic_util; local $ENV{'dev'} = q(wibble); -local $ENV{'HOME'} = q(t/); use_ok('npg::samplesheet'); use_ok('st::api::lims'); @@ -22,8 +21,6 @@ my $mlwh_schema = $class->new_object({})->create_test_db( q[WTSI::DNAP::Warehouse::Schema], q[t/data/fixtures_lims_wh_samplesheet] ); -local $ENV{NPG_WEBSERVICE_CACHE_DIR} = q(t/data/samplesheet); - my $dir = tempdir( CLEANUP => 1 ); subtest 'simple tests for the default driver' => sub { @@ -51,22 +48,19 @@ subtest 'object creation' => sub { lives_ok { $ss = npg::samplesheet->new(mlwh_schema => $mlwh_schema, repository=>$dir, npg_tracking_schema=>$schema, id_run=>7007); } 'samplesheet object - no output provided'; - cmp_ok($ss->output, 'eq', - '/nfs/sf49/ILorHSorMS_sf49/samplesheets/wibble/MS0001309-300.csv', + cmp_ok($ss->output, 'eq', 'samplesheets/wibble/MS0001309-300.csv', 'default output location (with zeroes trimmed appropriately)'); lives_ok { $ss = npg::samplesheet->new(mlwh_schema => $mlwh_schema, repository=>$dir, npg_tracking_schema=>$schema, id_run=>6946); } 'samplesheet object - no output provided'; - cmp_ok($ss->output, 'eq', - '/nfs/sf49/ILorHSorMS_sf49/samplesheets/wibble/000000000-A0616.csv', + cmp_ok($ss->output, 'eq', 'samplesheets/wibble/000000000-A0616.csv', 'default output location'); lives_ok { $ss = npg::samplesheet->new(mlwh_schema => $mlwh_schema, repository=>$dir, npg_tracking_schema=>$schema, id_run=>7007); } 'samplesheet object - no output provided'; my $orig_flowcell_id = $ss->run->flowcell_id; $ss->run->flowcell_id(q(MS2000132-500V2)); - cmp_ok($ss->output, 'eq', - '/nfs/sf49/ILorHSorMS_sf49/samplesheets/wibble/MS2000132-500V2.csv', + cmp_ok($ss->output, 'eq', 'samplesheets/wibble/MS2000132-500V2.csv', 'default output location copes with V2 MiSeq cartirdges/reagent kits'); };