[Bioperl-l] about retreive alinged sequence

zhuocheng Hou zchou at cau.edu.cn
Wed Oct 11 06:34:24 UTC 2006


I am a new user of Bioperl. I want to align mutiple DNA sequences based on translated proteins by using clustalw. However, I don't know how to retreive aligned sequences out.

The codes as follows (from the tutorials of HOWTOPAML):

         # These codes run  and can find the screen print out of clustalw
         my $aa_aln = $aln_factory->align(\@prots, at params);
         # project the protein alignment back to CDS coordinates
         my $dna_aln = aa_to_dna_aln($aa_aln, \%seqs);  
         my @each = $dna_aln->each_seq();         
         # The following codes were writed by me. However, it doesn't work. I want to get teh $dna_aln contents and write it to files. 

         my $in  = Bio::AlignIO->newFh(-Fh=>\$dna_aln,-format => 'fasta');
         my $aln=$dna_aln;
         my $out = Bio::AlignIO->new(-file => ">out.msf" ,
                                   -format => 'msf');
         #print $out $_ while <$in>; 
         while ($aln = $in->next_aln() ) {
               my $out->write_aln($aln);

Best regards,


More information about the Bioperl-l mailing list