in reply to Re: translating multiple DNA sequence to protein sequence
in thread translating multiple DNA sequence to protein sequence

The subroutine is called "codon2aa". You supply the sequence as the parameter, but you should run it on individual codons:
for my $codon ($seq =~ /(...)/g) { my $trans = codon2aa($codon); print "$name\t$trans\n"; }
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^3: translating multiple DNA sequence to protein sequence
by yuvraj_ghaly (Sexton) on Aug 22, 2013 at 09:18 UTC

    This won't work when numerous DNA sequences in fasta file

      I tested the code with the following data:
      >header1 ATGATCTAGTCGATCGCTAGCTAGATCGCTAGCTG CATGATCTAGTCGATCGCTAGCTAGATCGCTAGCTGC >header2 ATGATCTAGTCGATCGCTAGCTAGATCGCTAGCTGC ATGATCTAGTCGATCGCTAGCTAGATCGCTAGCTGC
      It gives the follwoing output: Please, be more specific and explain what you mean by "won't work".
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

        from the output I concluded that it is only for the ">header1". Moreover, this is not the required output

        the output which i require is something like that:

        >header1 HGADFFADJHGAJFGAFLGJ >header2 HJFSAGJFADGADKJAHGHJ

        The UPPERCASE is the translated sequence of the DNA sequences