Skip to content

Commit

Permalink
Merge pull request #798 from mgcam/drop_batch_id
Browse files Browse the repository at this point in the history
Removed st::api::lims batch_id constructor arg.
  • Loading branch information
jmtcsngr authored Jan 9, 2024
2 parents c2d8a58 + 770e6a1 commit be4b819
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 19 deletions.
52 changes: 35 additions & 17 deletions lib/st/api/lims.pm
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,46 @@ st::api::lims
=head1 SYNOPSIS
$lims = st::api::lims->new(id_run => 333); #run (batch) level object
$lims = st::api::lims->new(batch_id => 222); # as above
$lims = st::api::lims->new(batch_id => 222, position => 3); # lane level object
$lims = st::api::lims->new(id_run => 333, position => 3, tag_index => 44); # plex level object
$lims = st::api::lims->new(rpt_list => '333:3:44'); # object for a one-component composition
$lims = st::api::lims->new(rpt_list => '333:3:44;333:4:44;'); # object for a two-component composition
$lims = st::api::lims->new(driver_type => q(ml_warehouse), flowcell_barcode => q(HTC3HADXX),
position => 2, tag_index => 40); # plex level object from ml_warehouse
$lims = st::api::lims->new(driver_type => q(ml_warehouse), flowcell_barcode => q(HTC3HADXX),
position => 2, tag_index => 40, mlwh_schema=>$suitable_dbic_schema);
# Run level object
$lims = st::api::lims->new(id_run => 333);
$lims = st::api::lims->new(driver_type => q(ml_warehouse),
flowcell_barcode => q(HTC3HADXX));
# Lane level object
$lims = st::api::lims->new(id_run => 333, position => 3);
# Plex level object
$lims = st::api::lims->new(id_run => 333, position => 3, tag_index => 44);
$lims = st::api::lims->new(driver_type => q(ml_warehouse),
id_flowcell_lims => 222,
position => 2,
tag_index => 40,
mlwh_schema=>$suitable_dbic_schema);
# Objects defined via a list of one or more rpt values
$lims = st::api::lims->new(rpt_list => '333:3:44');
$lims = st::api::lims->new(rpt_list => '333:3:44;333:4:44;');
=head1 DESCRIPTION
Generic NPG pipeline oriented LIMS wrapper capable of retrieving data from multiple sources
(drivers). Provides methods performing "business" logic independent of data source.
Generic NPG LIMS wrapper capable of retrieving data from multiple sources via
a number of source-specific drivers. Provides methods implementing business
logic that is independent of data source.
Note the set of valid arguments to the constructor are a function of the driver_type passed.
A set of valid arguments to the constructor depends on the driver type. The
drivers are implemented as st::api::lims::<driver_name> classes.
Any driver attribute can be passed through to the driver's constructor via this objects's
constructor. Not all of the attributes passed through to the driver will be available
as this object's accessors. Example:
The default driver type is 'samplesheet'. The path to the samplesheet can be
set either in the 'path' constructor attribute or by setting the env. variable
NPG_CACHED_SAMPLESHEET_FILE.
All flavours of the ml_warehouse driver require access to the ml warehouse
database. If the mlwh_schema constructor argument is not set, a connection
to the database defined in a standard NPG configuration file is be used.
Any driver attribute can be passed through to the driver's constructor via
the constructor of the st::api::lims object. Not all of the attributes passed
through to the driver are be available as this object's attributes. Example:
$lims = st::api::lims->new(
id_flowcell_lims => 34567,
Expand Down Expand Up @@ -72,7 +91,6 @@ Readonly::Hash my %METHODS_PER_CATEGORY => {
id_run
path
id_flowcell_lims
batch_id
flowcell_barcode
rpt_list
/],
Expand Down
4 changes: 2 additions & 2 deletions t/40-st-lims.t
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ subtest 'Driver type, methods and driver build' => sub {
};

subtest 'Setting return value for primary attributes' => sub {
plan tests => 23;
plan tests => 21;

my @other = qw/batch_id id_flowcell_lims flowcell_barcode/;
my @other = qw/id_flowcell_lims flowcell_barcode/;
my $ss_path = 't/data/samplesheet/miseq_default.csv';
local $ENV{NPG_CACHED_SAMPLESHEET_FILE} = $ss_path;

Expand Down

0 comments on commit be4b819

Please sign in to comment.