BioPHP - Aminoacid name retrieval
Original code submitted by josebaCode bellow is covered by GNU GPL v2 license.
Description
Last change: 2010/10/18 17:04 | Edit description | Recent Changes | Original descriptionReturns complete name of aminoacid. Input may be one or three letter code.
Code
Last change: 2010/10/18 17:04 | Edit Code | Recent Changes | Download | Original codefunction identify_aminoacid ($aa){
$aa=strtoupper($aa);
if (strlen($aa)==1){
if ($aa=="A"){return "Alanine";}
if ($aa=="R"){return "Arginine";}
if ($aa=="N"){return "Asparagine";}
if ($aa=="D"){return "Aspartic Acid";}
if ($aa=="C"){return "Cysteine";}
if ($aa=="E"){return "Glutamic Acid";}
if ($aa=="Q"){return "Glutamine";}
if ($aa=="G"){return "Glycine";}
if ($aa=="H"){return "Histidine";}
if ($aa=="I"){return "Isoleucine";}
if ($aa=="L"){return "Leucine";}
if ($aa=="K"){return "Lysine";}
if ($aa=="M"){return "Methionine";}
if ($aa=="F"){return "Phenylalanine";}
if ($aa=="P"){return "Proline";}
if ($aa=="S"){return "Serine";}
if ($aa=="T"){return "Threonine";}
if ($aa=="W"){return "Tryptophan";}
if ($aa=="Y"){return "Tyrosine";}
if ($aa=="V"){return "Valine";}
}elseif (strlen($aa)==3){
if ($aa=="ALA"){return "Alanine";}
if ($aa=="ARG"){return "Arginine";}
if ($aa=="ASN"){return "Asparagine";}
if ($aa=="ASP"){return "Aspartic Acid";}
if ($aa=="CYS"){return "Cysteine";}
if ($aa=="GLU"){return "Glutamic Acid";}
if ($aa=="GLN"){return "Glutamine";}
if ($aa=="GLY"){return "Glycine";}
if ($aa=="HIS"){return "Histidine";}
if ($aa=="ILE"){return "Isoleucine";}
if ($aa=="LEU"){return "Leucine";}
if ($aa=="LYS"){return "Lysine";}
if ($aa=="MET"){return "Methionine";}
if ($aa=="PHE"){return "Phenylalanine";}
if ($aa=="PRO"){return "Proline";}
if ($aa=="SER"){return "Serine";}
if ($aa=="THR"){return "Threonine";}
if ($aa=="TRP"){return "Tryptophan";}
if ($aa=="TYR"){return "Tyrosine";}
if ($aa=="VAL"){return "Valine";}
}
}