[Bioperl-l] Shuffling sequences

Andreas Kahari ak at ebi.ac.uk
Tue May 25 15:35:26 EDT 2004

On Tue, May 25, 2004 at 06:09:51PM +0200, KHOUEIRY pierre wrote:
> Hi all,
> I'm searching for the bioperl Method that shuffle/randomize  a given 
> protein sequence. I need to shuffle my fasta sequence 1000 times to make 
> a statistics test on.

Try the shuffle() function in the List::Util module from CPAN.


It works on lists, so you will have to turn your sequence from a 
scalar into a list and back again:

    $newseq = join('', shuffle(split(//, $seq)));

(or something along those lines)


| <> | Andreas Kähäri      EMBL, European Bioinformatics Institute
|<><>|                     Wellcome Trust Genome Campus
| <> | Ensembl Developer   Hinxton, Cambridgeshire, CB10 1SD
|<><>| DAS Project Leader  United Kingdom

More information about the Bioperl-l mailing list