in reply to Re: Position Weight Matrix of Set of Strings
in thread Position Weight Matrix of Set of Strings
It gives:use Data::Dumper; my @inst = ( 'AAA', 'ATG', 'TTT', 'GTC' ); get_pwm(@inst); sub get_pwm { my @data = @_; my %pwm; foreach my $line (@data) { ++$pwm{ substr $line, $_, 1 }[$_] for 0 .. length($line) - 1; } my $n = $.; @$_ = map { $_ ? $_ / $n : 0 } @$_ for values %pwm; # Line 26 print Dumper \%pwm; print "$_ => @{ $pwm{ $_ } }" for keys %pwm; return; }
How can I overcome the problem above.Use of uninitialized value in division (/) at pwm.pl line 26. Illegal division by zero at pwm.pl line 26. Attempt to free temp prematurely: SV 0x8f6a3f8, Perl interpreter: 0x8f +53008. Attempt to free unreferenced scalar: SV 0x8f6a3f8, Perl interpreter: 0 +x8f53008.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Position Weight Matrix of Set of Strings
by BrowserUk (Patriarch) on Sep 06, 2006 at 09:41 UTC | |
by neversaint (Deacon) on Sep 07, 2006 at 02:31 UTC | |
by BrowserUk (Patriarch) on Sep 07, 2006 at 03:55 UTC | |
by monkfan (Curate) on Sep 19, 2006 at 01:05 UTC | |
by BrowserUk (Patriarch) on Sep 19, 2006 at 01:23 UTC |