Skip to content

Commit

Permalink
Simplifies the default samplesheet path.
Browse files Browse the repository at this point in the history
An option to read the value from the configuration file
is not used.
  • Loading branch information
mgcam committed Dec 18, 2023
1 parent a5a1ce3 commit 86531f4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
6 changes: 1 addition & 5 deletions lib/npg/samplesheet/base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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
Expand Down Expand Up @@ -221,8 +219,6 @@ __END__
=item st::api::lims
=item npg_tracking::util::config
=item npg_tracking::glossary::run
=back
Expand Down
1 change: 0 additions & 1 deletion t/.npg/npg_tracking
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
12 changes: 3 additions & 9 deletions t/47-samplesheet.t
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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 {
Expand Down Expand Up @@ -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');
};

Expand Down

0 comments on commit 86531f4

Please sign in to comment.