Skip to content

Commit

Permalink
Merge pull request #456 from mgcam/hiseq4old_platforms_only
Browse files Browse the repository at this point in the history
narrow down definition of HiSeq platform
  • Loading branch information
dkj authored May 30, 2018
2 parents b98cf01 + 3bc5a33 commit 2703d44
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ t/data/run_params/RunParameters.novaseq.xml
t/data/run_params/runParameters.hiseq.rr.single.xml
t/data/run_params/runParameters.hiseq.rr.twoind.xml
t/data/run_params/runParameters.hiseq.rr.xml
t/data/run_params/runParameters.hiseq.truseq.rr.xml
t/data/run_params/runParameters.hiseq.rr.truseq.xml
t/data/run_params/runParameters.hiseq.xml
t/data/run_params/runParameters.hiseq4000.xml
t/data/run_params/runParameters.hiseqx.upgraded.xml
Expand Down
5 changes: 3 additions & 2 deletions lib/npg_tracking/illumina/run/long_info.pm
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,14 @@ foreach my $f ( qw(tilelayout_rows
=head2 platform_HiSeq
Method returns true if sequencing was performed on an Illumina
instrument belonging to HiSeq platform.
instrument belonging to an 'older' HiSeq platform (1000, 1500, 2000 and 2500).
=cut

sub platform_HiSeq {
my $self = shift;
return $self->_software_application_name() =~ /HiSeq/xms;
return ( ($self->_software_application_name() =~ /HiSeq/xms) and
not ($self->platform_HiSeqX() or $self->platform_HiSeq4000()) );
}

=head2 platform_HiSeq4000
Expand Down
22 changes: 13 additions & 9 deletions t/60-illumina-run-long_info.t
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ package main;
my $basedir = tempdir( CLEANUP => 1 );

subtest 'retrieving information from runParameters.xml' => sub {
plan tests => 143;
plan tests => 135;

my $rf = join q[/], $basedir, 'runfolder';
mkdir $rf;
Expand All @@ -50,23 +50,23 @@ subtest 'retrieving information from runParameters.xml' => sub {
RunParameters.nextseq.xml
RunParameters.novaseq.xml
RunParameters.novaseq.xp.xml
runParameters.hiseq.truseq.rr.xml
runParameters.hiseq.rr.truseq.xml
/;
my $dir = 't/data/run_params';

my @platforms = qw/MiniSeq HiSeq HiSeq4000 HiSeqX
MiSeq NextSeq NovaSeq/;
my @i5opp_platforms = qw/MiniSeq HiSeq4000 HiSeqX NextSeq/;
my @i5opp_platforms = map {lc $_} qw/MiniSeq HiSeq4000 HiSeqX NextSeq/;

for my $f (@rp_files) {
note $f;
my ($name, $pl) = $f =~ /([r|R]unParameters)\.([\w\d]+)\./;
my ($name, $pl) = $f =~ /([r|R]unParameters)\.(.+\.xml)\Z/;
$name = join q[/], $rf, $name . '.xml';
copy join(q[/],$dir,$f), $name;
copy(join(q[/],$dir,$f), $name) or die 'Failed to copy file';

my $li = $class->new_object();

foreach my $p (@platforms) {
foreach my $p ( grep {$_ ne 'HiSeq'} @platforms) {
my $method = join q[_], 'platform', $p;
if ($pl =~ /$p/i ) {
ok ($li->$method(), "platform is $p");
Expand All @@ -75,8 +75,10 @@ subtest 'retrieving information from runParameters.xml' => sub {
}
}

if ($pl =~ 'hiseq') {
ok ($li->platform_HiSeq(), 'HiSeq platform');
if ($pl =~ /hiseq\.(?:xml|rr)/ ) {
ok ($li->platform_HiSeq(), 'platform is HiSeq');
} else {
ok (!$li->platform_HiSeq(), 'platform is not HiSeq');
}

if ($f =~ /\.rr\./) {
Expand All @@ -101,7 +103,9 @@ subtest 'retrieving information from runParameters.xml' => sub {
}
}

if (grep {lc($_) eq $pl} @i5opp_platforms) {
my @i5 = grep { $pl =~ /\A$_/ } @i5opp_platforms;
if (scalar @i5 > 1) {die 'Too many matches'};
if (@i5) {
ok ($li->is_i5opposite(), 'i5opposite');
} else {
ok (!$li->is_i5opposite(), 'not i5opposite');
Expand Down

0 comments on commit 2703d44

Please sign in to comment.