[Bioperl-l] K-mer generating script

Blanchette, Marco MAB at stowers-institute.org
Fri Dec 19 19:26:51 EST 2008


Thanks Mike!

Exactly what I needed. I think I was searching too deeply!

Have a good night

Marco



On 12/19/08 6:18 PM, "Michael Eisen" <mbeisen at lbl.gov> wrote:

#!/usr/bin/perl
#

$k = shift;
@bases = ('A','C','G','T');

@words = @bases;

for ($i=1;$i<$k;$i++)
{
    undef @newwords;

    foreach $w (@words)
    {
         foreach $b (@bases)
         {
             push (@newwords,$w.$b);
         }
    }

    undef @words;

    @words = @newwords;
}

foreach $w (@words)
{
     print "$w\n";
}

--
Marco Blanchette, Ph.D.
Assistant Investigator
Stowers Institute for Medical Research
1000 East 50th St.

Kansas City, MO 64110

Tel: 816-926-4071
Cell: 816-726-8419
Fax: 816-926-2018




More information about the Bioperl-l mailing list