Looking at the source, the message "<IN> line 8192." is irrelevant if not misleading because IN was never closed as it should. In sub _read_bkgd(). So, all subsequent warns report it and rightly so as it is still open, alas they are irrelevant.
Line 476 of the source file is:
sub _get_seed { my $self = shift; my $n_bkgd_seq = List::Util::sum( @{ $self->{bkgd_ref}->[0] } ); my @hd_sum; for my $oligo_indice ( 0 .. $#{ $self->{oligo_ref} } ) { $hd_sum[$oligo_indice] = List::Util::sum( @{ $self->{hd_matrix_ref}->[$oligo_indice +] } ); # 476 }
Which suggests that there is something wrong with $self->{hd_matrix_ref}->[$oligo_indice]. Either $self->{hd_matrix_ref} is not an arrayref or if it is, the index $oligo_indice exceeds its size, or $self->{hd_matrix_ref}->[$oligo_indice] is not an arrayref. The construction of $self->{hd_matrix_ref} is done in line 325 (sub _build_hd_matrix).
From a glance at line 325, I think the first and second hypotheses can be ruled out because the index spans the exact same range as in line 476, that is:
for my $oligo_indice ( 0 .. $#{ $self->{oligo_ref} } ) {That is, the array has correct dimensions but may contain "holes" or has undef in its 2D span. (Edit: by "holes" i mean array elements which were never set to a value, as opposed to the "undef" which means array elemets were set to an undef value which was the result of a calculation/transformation which went wrong, and was not detected, or just bad input).
If you want to debug this, then perhaps you can add a couple of debug prints to see what's going on with that array. I would start just before line 387 (before return), with this (untested):
for my $oligo_indice ( 0 .. $#{ $self->{oligo_ref} } ) { print "index: $oligo_indice ("; for my $count_indice ( 0 .. $#{ $self->{count_matrix_ref} } ) { if( ! defined $hd_matrix[$oligo_indice][$count_indice] ){ die "prob +lem at [$oligo_indice][$count_indice]" } print $hd_matrix[$oligo_indice][$count_indice]."," } print "\n"; }
bw, bliako
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Use of uninitialized value in subroutine entry at /home/roarce/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0/Seeder/Finder.pm line 476, <IN> line 8192.
by roarce92 (Acolyte) on Apr 29, 2020 at 22:06 UTC | |
|
Re^2: Use of uninitialized value in subroutine entry at /home/roarce/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0/Seeder/Finder.pm line 476, <IN> line 8192.
by roarce92 (Acolyte) on May 25, 2020 at 15:15 UTC | |
| |