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

Ensure insert size is returned for compositions. #778

Merged
merged 2 commits into from
Nov 24, 2023
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
2 changes: 1 addition & 1 deletion lib/st/api/lims.pm
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ sub _build_required_insert_size {
my $self = shift;

my $is_hash = {};
if (defined $self->position) {
if (defined $self->position or defined $self->rpt_list) {
dkj marked this conversation as resolved.
Show resolved Hide resolved
my @alims = $self->descendants;
@alims = @alims ? @alims : ($self);
foreach my $lims (@alims) {
Expand Down
20 changes: 17 additions & 3 deletions t/40-st-lims.t
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ subtest 'Dual index' => sub {
};

subtest 'Insert size' => sub {
plan tests => 14;
plan tests => 20;

local $ENV{NPG_CACHED_SAMPLESHEET_FILE} =
't/data/samplesheet/4pool4libs_extended.csv';
Expand All @@ -657,11 +657,25 @@ subtest 'Insert size' => sub {
is ($insert_size->{$id}->{q[to]}, 1000, 'required TO insert size');
ok (!exists $insert_size->{q[6946_7_ACAACGCAAT]}, 'no required insert size');

$lims = st::api::lims->new(id_run => 9999, position => 7, tag_index => 77);
for my $l ((
st::api::lims->new(id_run => 9999, position => 7, tag_index => 77),
st::api::lims->new(rpt_list => '9999:7:77')
)) {
$insert_size = $l->required_insert_size;
is (keys %{$insert_size}, 1, 'one entry in the insert size hash');
is ($insert_size->{$id}->{q[from]}, 100, 'required FROM insert size');
is ($insert_size->{$id}->{q[to]}, 1000,'required TO insert size');
}

local $ENV{NPG_CACHED_SAMPLESHEET_FILE} =
q[t/data/samplesheet/samplesheet_47995.csv];

$lims = st::api::lims->new(rpt_list => '47995:1:3;47995:2:3');
$insert_size = $lims->required_insert_size;
is (keys %{$insert_size}, 1, 'one entry in the insert size hash');
$id = '65934645';
is ($insert_size->{$id}->{q[from]}, 100, 'required FROM insert size');
is ($insert_size->{$id}->{q[to]}, 1000,'required TO insert size');
is ($insert_size->{$id}->{q[to]}, 400,'required TO insert size');
};

subtest 'Study and sample properties' => sub {
Expand Down
Loading