in reply to Re: Shuffling codons
in thread Shuffling CODONS
Thanks for your reply. I know it is an FAQ, That's where I got the Fisher Yates option from, But unable to correctly implement it in my code..
If I try the list util it doesnt work... My code looks like this
print "enter sequence and signal end with enter followed by ctrl d\n"; $sequence = <STDIN>; chomp $sequence; print "sequence inserted : $sequence\n"; @trips = unpack("a3" x (length($sequence)-2), $sequence); @trips = join(" ", @trips); use List::Util 'shuffle'; @shuffled = shuffle(@trips); print "@shuffled\n";
What is wrong/missing here?
I am incapable of installing the list::utils, I wouldn't know where to unpack them and how to properly install and run them. Do they need to be situated somewhere. I am on perl v5.18.2, so the list utils should already be there you mention?
How would I implement the fisher Yates algorithm correctly?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Shuffling codons
by pryrt (Abbot) on Jun 07, 2018 at 14:12 UTC | |
|
Re^3: Shuffling codons
by hippo (Archbishop) on Jun 07, 2018 at 14:13 UTC |