in reply to how can I speed up this perl??

is there something in bioperl ( http://bio.perl.org/ ) that you can use?

Replies are listed 'Best First'.
Re: Re: how can I speed up this perl??
by Anonymous Monk on Nov 25, 2003 at 02:34 UTC
    Hello All

    Some genome sequence share a counter. I mapped each genome sequence to the reference of the update counter, so there is some dereferencing.

    Chris

    #!/usr/bin/perl use strict; use warnings; my @genome = ('a', 'a'); my $i = 0; my @seq = qw/ aa ag ac at ta tg tc tt ca cg cc ct ga gg gc gt /; my ($tt, $ag, $ac, $at, $ta, $tg, $ga, $cg, $cc, $gc) = (0) x 10; my %counter; @counter{@seq} = \($tt, $ag, $ac, $at, $ta, $tg, $ga, $tt, $tg, $cg, $cc, $ag, $ga, $cc, $gc, $ac); + if (exists $counter{ $genome[$i] . $genome[$i+1] }) { + ++${ $counter{ $genome[$i] . $genome[$i+1] }} }