Hi Jesus!
I'm BCCing this message to a fellow Perl programmer who also studies in
lsu.edu , and whom I've met on the IRC. He would be free to respond to the
list and/or to you and me in private.
On Monday 12 Oct 2009 23:40:51 Jesus Fernandez wrote:
> Hello friends,
>
> I wrote a program that can simulate coalescent times of gene copies in a
> single population of constant size with a N=10 000 and a k=25, now i want
> to make 5000 simulations, any help?
>
> #!jesusafernandez/bin/perl
> use warnings;
>
OK. You need "use strict;" and I think you need an absolute path like:
<<<<<<<<
#!/home/jesusfernandez/bin/perl
>>>>>>>>
I would also suggest picking up a shorter username , unless of course it's a
shared computer, because you are likely to enter it a lot.
> $n = 10000;
> $k = 25;
> while ($k>=2){
> if ($k==1) {last;}
> $mean=(4*$n)/$k*($k-1);
> $time=(-log(rand)*$mean);
> push(@coalt, $time);
> $k=$k-1;
> }
> for ($time=0; $time<24; $time++){
> print "$coalt[$time]\n";
> }
>
I think you can change $n to "20_000" (_ can be used to separate digits in
Perl) and get done with it. But you really should learn Perl better. This code
is not particularly hard to understand and you can learn Perl from the various
resources and links here:
http://perl-begin.org/
Alternatively, you may opt to hire someone to tweak that Perl code, but it
seems likely that you'd be better off learning how to read such Perl code.
Note that some Perl code would take a lot of time to read and understand (e.g:
golfed Perl, obfuscated Perl), but most production Perl code, including the
one you have given here is not that bad.
(It will take time for me to understand what the algorithm in your code is
doing, but that would be common to all languages).
Regards,
Shlomi Fish
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Why I Love Perl - http://shlom.in/joy-of-perl
Chuck Norris read the entire English Wikipedia in 24 hours. Twice.
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/