[Bioperl-l] How to access an array of codons
Kevin Brown
Kevin.M.Brown at asu.edu
Wed Mar 11 18:27:30 UTC 2009
You can, using the Bio::Perl method translate_as_string
@array = @{$aa2cod{translate_as_string($codon)}};
> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org
> [mailto:bioperl-l-bounces at lists.open-bio.org] On Behalf Of manni122
> Sent: Wednesday, March 11, 2009 2:15 AM
> To: Bioperl-l at lists.open-bio.org
> Subject: [Bioperl-l] How to access an array of codons
>
>
> Hi there, if I want to access my hash of arrays %aa2cod I can
> print out the
> array key and the first value by
>
> for my $key (keys %aa2cod) {
> print "$key => $aa2cod{$key}[0]\n";
> }
>
> How can I find a specific codon within this hash of arrays
> and extract the
> corresponding array. For instance I am looking for GCA and
> want to get the
> whole array [GCA GCC GCG GCT].
>
> I appreciate any comment!!
>
>
> my %aa2cod = (
> 'A' => ['GCA', 'GCC', 'GCG', 'GCT'], # Alanine
> 'C' => ['TGC', 'TGT'], # Cysteine
> 'D' => ['GAC', 'GAT'], # Aspartic Acid
> 'E' => ['GAA', 'GAG'], # Glutamic Acid
> 'F' => ['TTC', 'TTT'], # Phenylalanine
> 'G' => ['GGA', 'GGC', 'GGG', 'GGT'], # Glycine
> 'H' => ['CAC', 'CAT'], # Histidine
> 'I' => ['ATA', 'ATC', 'ATT'], # Isoleucine
> 'K' => ['AAA', 'AAG'], # Lysine
> 'L' => ['TTA', 'TTG', 'CTA', 'CTC', 'CTG', 'CTT'], # Leucine
> 'M' => ['ATG'], # Methionine
> 'N' => ['AAC', 'AAT'], # Asparagine
> 'P' => ['CCA', 'CCC', 'CCG', 'CCT'], # Proline
> 'Q' => ['CAA', 'CAG'], # Glutamine
> 'R' => ['CGA', 'CGC', 'CGG', 'CGT', 'AGA', 'AGG'], # Arginine
> 'S' => ['TCA', 'TCC', 'TCG', 'TCT', 'AGC', 'AGT'], # Serine
> 'T' => ['ACA', 'ACC', 'ACG', 'ACT'], # Threonine
> 'V' => ['GTA', 'GTC', 'GTG', 'GTT'], # Valine
> 'W' => ['TGG'], # Tryptophan
> 'Y' => ['TAC', 'TAT'], # Tyrosine
> '_' => ['TAA', 'TAG', 'TGA'] # Stop
> );
>
> --
> View this message in context:
> http://www.nabble.com/How-to-access-an-array-of-codons-tp22451
> 211p22451211.html
> Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
More information about the Bioperl-l
mailing list