#!/usr/bin/perl 
#use warnings;
#use strict;
use Bio::AlignIO;

my $usage = "stockholm2multifasta.pl infile outfile\n";

my $infile  = shift or die $usage;
my $outfile = shift or die $usage;

my $in  = Bio::AlignIO->new(-file => $infile     , '-format' => 'stockholm');

# note: we quote -format to keep older perl's from complaining.
my $i = 0;
while ( my $aln = $in->next_aln() ) {
    $i++;
    my $out = Bio::AlignIO->new(-file => ">$outfile.$i.mfas" , '-format' => 'fasta');
    $out->write_aln($aln);
}


#bl2seq.pm          fasta.pm           mase.pm            metafasta.pm       pfam.pm            prodom.pm          stockholm.pm
#clustalw.pm        largemultifasta.pm mega.pm            msf.pm             phylip.pm          psi.pm
#emboss.pm          maf.pm             meme.pm            nexus.pm           po.pm              selex.pm
