[Bioperl-l] How to access an array of codons

manni122 markus.liebscher at gmx.de
Wed Mar 11 09:14:45 UTC 2009


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-tp22451211p22451211.html
Sent from the Perl - Bioperl-L mailing list archive at Nabble.com.




More information about the Bioperl-l mailing list